Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
x/net/http2: request-response loop is ~2-3 times slower on http2 than on https #18309
What version of Go are you using (
I don't think anyone will have a chance to look at this in detail until after Go 1.8 is released. In the meantime, the following may help:
Brad has done some optimization work for grpc-over-http2 that may help. I'm not sure if all of those optimizations have been submitted yet.
I wouldn't expect a speedup. The https version probably pipelines all 100k requests over just 10 TCP connections. I doubt you will see any benefits from muxing all requests onto a single TCP connection unless you're on a congested WAN or have many fewer requests-per-connection. That said, a 2x slowdown is not expected. Thanks for the report.
Hi and thanks for your response.
I've tested with current master
Here are profiles made with go 1.7.4: (http2, one client per goroutine)
I understand that 10 keepalive https connections might be faster than one http2 connection but don't understand why are they faster than 10 http2 connections.
Also I've tested this very client against nginx http2 server with the same response size and for some reason using one http2 connection in client is faster than 1 per goroutine. Have no idea why