-
Notifications
You must be signed in to change notification settings - Fork 29.8k
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 server receive speed is 20x slower than send speed #51014
Labels
http2
Issues or PRs related to the http2 subsystem.
performance
Issues and PRs related to the performance of Node.js.
Comments
tniessen
added
performance
Issues and PRs related to the performance of Node.js.
http2
Issues or PRs related to the http2 subsystem.
labels
Dec 2, 2023
Wondering, if piping to a filestream would make any difference! |
Finally, I realized the documentation was wrong. The So it should have been: server.on("session", (session) => {
session.setLocalWindowSize(windowSize);
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
http2
Issues or PRs related to the http2 subsystem.
performance
Issues and PRs related to the performance of Node.js.
Version
v20.10.0
Platform
Linux temp-vps1 6.1.0-13-arm64 #1 SMP Debian 6.1.55-1 (2023-09-29) aarch64 GNU/Linux
Subsystem
http2
What steps will reproduce the bug?
Define a small http2 server that can send a stream, or receive a stream.
generate ssl certs:
go to a different machine (preferably on the same local network) and run:
observer the difference in speed between up and downstream.
How often does it reproduce? Is there a required condition?
I've manged to reproduce this with multiple vps on different cloud providers. switching around server and client side.
Loopback never reproduces it, and sometimes if you have 2 machines on the same switch, it also doesn't reproduce.
I suspect it's some kind of window related issue, I've already applied the manual fixes suggested in #38426. Without these the download speed is also this slow.
What is the expected behavior? Why is that the expected behavior?
The performance should be comparable to raw tcp speed (with some lee-way for http2 overhead).
See netcat performance between the 2 machines:
on server:
on second machine:
using nodejs as a http2 client has same performance issue
invoke with:
TARGET_HOST="https://other-machine:8443" node n2-upload.js
What do you see instead?
Slow upload while the tcp connnection speed would allow for fast upload.
Additional information
I'm closing a previous issue (#50972) I reported, that one got too complex and big. This is a much smaller case and easier to debug, I hope. If there is something I can do to help out, please let me know.
I think this is not a dupe of #38426 as even when you manually setup a big enough window, the receive side is still slow. I suspect there is a call to nghttp2 missing that is not exposed on the nodejs side?
The text was updated successfully, but these errors were encountered: