-
Notifications
You must be signed in to change notification settings - Fork 29.6k
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
http2: adjust stream buffer size #16445
http2: adjust stream buffer size #16445
Conversation
@@ -818,7 +818,7 @@ int Http2Session::DoWrite(WriteWrap* req_wrap, | |||
return 0; | |||
} | |||
|
|||
void Http2Session::AllocateSend(size_t recommended, uv_buf_t* buf) { | |||
void Http2Session::AllocateSend(uv_buf_t* buf) { |
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.
I'm good with removing this. Just fwiw, I included this to follow a pattern used elsewhere (tho slightly differently)
e.g. https://github.com/nodejs/node/blob/master/src/tls_wrap.cc#L675
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.
Awesome.. I love it when other people cross items off my todo list :-) ... LGTM!
Adjust stream buffer size to allow full 4 default-sized frames including their frame headers to allow more efficient sending of data to the socket.
a704c3c
to
83b77a9
Compare
Landed in 3690a72 |
Adjust stream buffer size to allow full 4 default-sized frames including their frame headers to allow more efficient sending of data to the socket. PR-URL: #16445 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Colin Ihrig <[email protected]>
Adjust stream buffer size to allow full 4 default-sized frames including their frame headers to allow more efficient sending of data to the socket. PR-URL: #16445 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Colin Ihrig <[email protected]>
Adjust stream buffer size to allow full 4 default-sized frames including their frame headers to allow more efficient sending of data to the socket. PR-URL: #16445 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Colin Ihrig <[email protected]>
Adjust stream buffer size to allow full 4 default-sized frames including their frame headers to allow more efficient sending of data to the socket. PR-URL: #16445 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Colin Ihrig <[email protected]>
Adjust stream buffer size to allow full 4 default-sized frames including their frame headers to allow more efficient sending of data to the socket. PR-URL: nodejs/node#16445 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Colin Ihrig <[email protected]>
Adjust stream buffer size to allow full 4 default-sized frames including their frame headers to allow more efficient sending of data to the socket. PR-URL: nodejs/node#16445 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Colin Ihrig <[email protected]>
Adjust stream buffer size to allow full 4 default-sized frames including their frame headers to allow more efficient sending of data to the socket. PR-URL: nodejs/node#16445 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Colin Ihrig <[email protected]>
So I have no idea if there was reasoning for this originally — and if there was feel free to let me know and I'll close — but the current
kAllocBufferSize
is just a tad too small for fully efficient writes given default window size & frame size.64 * 1024
will be 35 bytes smaller than the full default window size due to the 4 frame headers that are included.Obviously this all goes out the window with different frame sizes & window sizes but seems to make sense to at least sort of optimize for the default here.
Here's a log that shows what was happening before the change (note the last few lines)
This also removes the seemingly unused
size_t recommended
inAllocateSend
and the constant it usesSEND_BUFFER_RECOMMENDED_SIZE
. Again, let me know if this is here for some future functionality that hasn't been added yet.Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passesAffected core subsystem(s)
http2