Please answer these questions before submitting your issue. Thanks!
What version of Go are you using (go version)?
go version devel +dfad3f8 Tue Apr 5 16:10:33 2016 +0300 linux/amd64
What operating system and processor architecture are you using (go env)?
GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GORACE=""
CC="gcc"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build040466407=/tmp/go-build -gno-record-gcc-switches"
CXX="g++"
CGO_ENABLED="1"
What did you do?
I run an http server serving more than a million concurrent TCP keep-alive connections on a system with 32 CPU cores. Each connection has read and write deadlines set via net.Conn.SetReadDeadline and net.Conn.SetWriteDeadline.
What did you expect to see?
Server performance should scale with GOMAXPROCS up to the number of CPU cores.
What did you see instead?
addtimer and deltimer functions from runtime/time.go are at the top of CPU profile.
iowait reaches 20% due to memory ping-pong across CPU cores inside siftupTimer and siftdownTimer functions in runtime/time.go.
@dvyukov , could you look into this?
Please answer these questions before submitting your issue. Thanks!
What version of Go are you using (
go version)?What operating system and processor architecture are you using (
go env)?What did you do?
I run an http server serving more than a million concurrent TCP keep-alive connections on a system with 32 CPU cores. Each connection has read and write deadlines set via
net.Conn.SetReadDeadlineandnet.Conn.SetWriteDeadline.What did you expect to see?
Server performance should scale with
GOMAXPROCSup to the number of CPU cores.What did you see instead?
addtimeranddeltimerfunctions fromruntime/time.goare at the top of CPU profile.iowaitreaches 20% due to memory ping-pong across CPU cores insidesiftupTimerandsiftdownTimerfunctions inruntime/time.go.@dvyukov , could you look into this?