Open Rohsichan opened 9 months ago
Thanks for the report. Could you please post (via playground link) the code you are using?
@neild @tombergan per owners
The test code is here. https://go.dev/play/p/et4HPzU3wLq?v=goprev
I checked 1 connection on my machine. The response time was 10 seconds in total. In http1.1, the response time is within 2 seconds.
http2
time is 10.555606421
http1.1
time is 1.013303016s
Please let me know if you need any more information.
note that the server can set MaxConcurrentStreams, similar performance improvements can be achieved through #47840
I think we need a way to set MaxConcurrentStreams on the client. (http2.transport)
In addition to the go server, I am using a server such as go reverse proxy, nginx, etc. If Golang becomes a client, it is the same.
The MaxReadFrameSize fluctuates and the numbers remain the same.
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
I downloaded 9M files using 100 goroutines from http2.transport.
What did you expect to see?
There are currently more than 100 active streams in http2. I thought the connection would be newly opened, but it didn't.
What did you see instead?
After checking the http2.transport connection pool, we are reusing a single connection. The netstat -nap check shows that there is 1 connection, rx full, tx full a lot.
The following modifications improve performance by creating connections in units of 20 active streams.
As the number of active streams increases, http2 becomes slower and slower.