Skip to content

Post large file failed when the initialWindowSize of HTTP2 Settings Object set to 6553500 #19141

Closed
@SeaOceanLiu

Description

@SeaOceanLiu

Version: 9.5.0
Platform: Windows7 x64 / Windows10 x64
Subsystem: node_http2

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!

Metadata

Metadata

Assignees

Labels

http2Issues or PRs related to the http2 subsystem.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions