You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Post large file failed when the initialWindowSize of HTTP2 Settings Object set to 6553500 #19141
It is required to post large file (~100MB) to a HTTP/2 server in a project, we implement the HTTP/2 server using node.js v9.5.0.
The speed is too low when comparing to HTTPS when post via HTTP/2 with the default settings. It was the reason the TCP package sending speed is too low after we checked a lot of captured package. So, we had to adjust the initialWindowSize of HTTP2 Settings Object quite larger than the default value (65535), to 6553500.
After that, we got an error from the client saying the connection timeout during the file transition. And more we found is the WINDOW_SIZE is not updated by the server anymore. We had to analysis the node.js source code without helpful searching result from the internet. In the node_http2.c, we found it only set the stream level WINDOW_SIZE when we adjust initialWindowSize of HTTP2 Settings Object, left the session level one. That is the root reason cause the HTTP/2 server stopping update the WINDOW_SIZE.
NGHTTP2 lib has provided the API interface to modify both the stream and session level WINDOW_SIZE, so we temporarily modify Http2Session::Http2Settings::Send() to call the API (nghttp2_session_set_local_window_size()) with the stream_id = 0 when the stream level WINDOW_SIZE > session level WINDOWS_SIZE.
We are still looking for the best solution...
Thanks for any help!
I still need to actually test this but two things:
The fact that a window update is not being propagated seems to either be an nghttp2 bug or with whatever client is being used. The C++ code consumes data as it comes in, so the blame can't be there.
I'm not really certain what the correct behaviour here is. I'm leaning towards exposing an additional initialConnectionWindowSize option because I'm not convinced that changing initialWindowSize should affect the connection level flow-control window.
I am unable to replicate any issues here with the current code in master. It is possible that the 9.x branch was simply out of date. I will be opening a PR with a test that transfers 100 MB of data from client to server with a large initial window size that confirms that it should be working end to end.
Activity
bzoz commentedon Mar 8, 2018
/cc @nodejs/http2
mcollina commentedon Mar 8, 2018
@jasnell what do you think?
apapirovski commentedon Jun 24, 2018
I still need to actually test this but two things:
The fact that a window update is not being propagated seems to either be an nghttp2 bug or with whatever client is being used. The C++ code consumes data as it comes in, so the blame can't be there.
I'm not really certain what the correct behaviour here is. I'm leaning towards exposing an additional
initialConnectionWindowSizeoption because I'm not convinced that changinginitialWindowSizeshould affect the connection level flow-control window.@jasnell thoughts?
jasnell commentedon Aug 10, 2018
Oy, just spotted this. It ended up buried in a backlog. Will investigate.
jasnell commentedon Aug 10, 2018
I am unable to replicate any issues here with the current code in master. It is possible that the 9.x branch was simply out of date. I will be opening a PR with a test that transfers 100 MB of data from client to server with a large initial window size that confirms that it should be working end to end.
test: add test-http2-large-file sequential test
test: add test-http2-large-file sequential test
test: add test-http2-large-file sequential test
TimothyGu commentedon Aug 18, 2018
Now that #22254 is landed, let's call this resolved.
test: add test-http2-large-file sequential test
test: add test-http2-large-file sequential test