-
Notifications
You must be signed in to change notification settings - Fork 505
Remove maxRequestKB maxResponseKB and set finagle's maxRequestSize and maxResponseSize to max allowed(2GB) #2298
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove maxRequestKB maxResponseKB and set finagle's maxRequestSize and maxResponseSize to max allowed(2GB) #2298
Conversation
IMO, these may still be useful, but semantics must change. However to be useful Your idea to remove those is very pragmatic. But there may be existing linkerd users who rely on
+1 for this. I believe, there's no good reason to have 2GiB hard limit in finagle now after support for streaming of fixed-length messages is implemented. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you think it makes sense to also describe/illustrate with tests how all these settings (fixedLengthStreamedAfter
, maxRequestKB
, etc.) impact messages with huge headers?
It has been a long time since I looked into this code, and I apologize if the question is silly... But I have never managed to memorize, whether request size in this context refers to the length of the HTTP message body or to the whole HTTP message including headers.
@edio Thanks for your comments. To be completely frank, all of this terminology is quite confusing and not documented very well at all, so it was quite the can of warms to look through that stuff. I agree with you about most what you said and will probably investigate the headers bit as well. I think the relationship will be somewhat similar to what it is between With respect to making |
I may be very off here (and can't check right now), but IIRC this is technically feasible with netty: a handler has a counter which we increment with every frame transferred by the size of the frame. Once the counter reaches the limit we abort the transmission and return 413. Obviously there may be something special about how the handler is added to netty pipeline or how the counter is declared so we count only our own message... I do not recall technicall details, but I do believe this is possible. I will try to look into it later today. |
@edio Yes, you are right, thinking about it it is quite possible to do that in such a way. I am not too familiar with the finagle/netty codebase but sounds like its possible. Will investigate what we can do (and when) |
Thanks to @zaharidichev and @edio for all of the investigation you have done on this. It's great to finally get some clarity on the behavior of these parameters. If I understand correctly, the only time the If so, that's pretty niche and I agree with @zaharidichev's original suggestion of removing The original purpose of these parameters was to protect Linkerd from excessive buffering and memory pressure from large messages. I think the It is true that having the functionality of having the service mesh limit message sizes could be useful. But that's not functionality we have today (because the @edio: if you think limiting message size is a useful feature, would you mind opening an issue with details about how you think it should work? |
@adleong at NCBI we do not use this feature of linkerd, it was just my assumption, that some developers may use it; my only concern was breaking a feature some potentially may be using. Sorry for confusion. |
Not exactly... (ammended my code comments to reflect things better)This is where it gets merky. So if there is My suggestion is do get rid of |
18d3b0e
to
84b0784
Compare
Sounds good to me! |
Signed-off-by: Zahari Dichev <zaharidichev@gmail.com>
@adleong Added a commit to proceed as discussed. Also submitted this issue to finagle to clarify things further |
1462494
to
eaff078
Compare
Signed-off-by: Zahari Dichev <zaharidichev@gmail.com>
eaff078
to
f517a6e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice
Would you mind updating the PR title and description to match the changes? |
This PR's purpose is to remove
maxRequestKB
maxResponseKB
and rely on finagle's maximum allowed size for fixed size messages which is 2GB. The semantics now are:Content-Length
set) are allowed up to 2GB and will be streamed if they are above the threshold specified instreamAfterContentLengthKB
. Note that id these messages are larger than 2GB or have theirContent-Length
set to a larger value they will be rejected.Content-Length
not set) will be streamed.Fixes: #2196
Signed-off-by: Zahari Dichev zaharidichev@gmail.com