x/net/http2: request-response loop is ~2-3 times slower on http2 than on https #18309
Labels
FrozenDueToAge
WaitingForInfo
Issue is not actionable because of missing required information, which needs to be provided.
Milestone
What version of Go are you using (
go version
)?go version go1.7.4 linux/amd64
What operating system and processor architecture are you using (
go env
)?GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/root/go"
GORACE=""
GOROOT="/usr/local/go"
GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"
CC="gcc"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build416699138=/tmp/go-build -gno-record-gcc-switches"
CXX="g++"
CGO_ENABLED="1"
What did you do?
I need a fastest way to securely communicate between microservices. And I tested request-responce loop with https and http2. Client starts 10 goroutines and each of them does 10k requests to server
And it turned out that https is 2 to 3 times faster when sending and receiving relatively small amounts of data(129 bytes request, 173 bytes response)
Server: https://play.golang.org/p/22hOHrHNZs
Client: https://play.golang.org/p/OdEh9cUvah (change IP on line 42)
I have 2 2xcpu servers with ~1 ms latency between them
When I run this test with http2 enabled it takes about 14 seconds for 100k requests divided in 10 goroutines
without http2 it takes about 7 seconds
Moreover, if I reuse client between goroutines it takes ~24 seconds on http2.
What did you expect to see?
A speed up between client and server when using http2
What did you see instead?
2x slowdown
The text was updated successfully, but these errors were encountered: