Skip to content

http2: adjust stream buffer size

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)
Nghttp2Session server: Sending pending data
Nghttp2Session server: reading outbound data for stream 13
Nghttp2Session server: stream 13 found
Nghttp2Session server: processing outbound data chunk
Nghttp2Session server: nghttp2 has 16393 bytes to send
Nghttp2Session server: reading outbound data for stream 13
Nghttp2Session server: stream 13 found
Nghttp2Session server: processing outbound data chunk
Nghttp2Session server: nghttp2 has 16393 bytes to send
Nghttp2Session server: reading outbound data for stream 13
Nghttp2Session server: stream 13 found
Nghttp2Session server: processing outbound data chunk
Nghttp2Session server: nghttp2 has 16393 bytes to send
Nghttp2Session server: reading outbound data for stream 13
Nghttp2Session server: stream 13 found
Nghttp2Session server: processing outbound data chunk
Nghttp2Session server: nghttp2 has 16392 bytes to send
Nghttp2Session server: pushing 16357 bytes to the socket
Http2Session: Attempting to send data
Nghttp2Session server: pushing 35 bytes to the socket
Http2Session: Attempting to send data

This also removes the seemingly unused size_t recommended in AllocateSend and the constant it uses SEND_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), or vcbuild test (Windows) passes
  • commit message follows commit guidelines
Affected core subsystem(s)

http2

Merge request reports

Loading