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.
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: