crypto/tls: connection speed decreases significantly when enable TLS #22761
Labels
FrozenDueToAge
Performance
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.9.2 darwin/amd64
Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/will/go"
GORACE=""
GOROOT="/usr/local/Cellar/go/1.9.2/libexec"
GOTOOLDIR="/usr/local/Cellar/go/1.9.2/libexec/pkg/tool/darwin_amd64"
GCCGO="gccgo"
CC="clang"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/26/bqp0svv9187cxr93vbhdh86m0000gn/T/go-build149896180=/tmp/go-build -gno-record-gcc-switches -fno-common"
CXX="clang++"
CGO_ENABLED="1"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
What did you do?
I write a simple code to test the go TLS performance. The connection speed decreases significantly when I enable TLS.
Server with TLS enabled:
Server without TLS:
What did you expect to see?
I use curl to test the network speed:
curl -k https://127.0.0.1:8080 -o test.bin
gives the speed:
and
curl http://127.0.0.1:8080 -o test.bin
gives the speed:
The speed is only around 35.7MB/s when enabling TLS while it is more than 500MB/s with a plain TCP connection.
P.S. I generated the
server.pem
andserver.key
by following these command: https://github.com/denji/golang-tlsThe text was updated successfully, but these errors were encountered: