Skip to content

cmd/trace: surprising Threads "InSyscall" count #22574

@rhysh

Description

@rhysh

What version of Go are you using (go version)?

$ go1.9 version
go version go1.9.2 darwin/amd64
$ go-tip version
go version devel +1ac8846984 Fri Nov 3 14:06:21 2017 +0000 darwin/amd64

Does this issue reproduce with the latest release?

The problem is new in tip; go1.9.2 looks fine.

What operating system and processor architecture are you using (go env)?

First seen on linux/amd64 with GOMAXPROCS=36, somewhat reproduced on darwin/amd64 with GOMAXPROCS=8.

What did you do?

I took an execution trace of a server running with Go tip (1ac8846) and compared it to one running go1.9.2. I looked at the "Threads" ribbon near the top of the window.

What did you expect to see?

With go1.9.2, the Threads ribbon shows a very small number of threads in syscall, usually one or two. This makes sense to me: the server handles data over the network so likely has a thread sitting in epoll_wait and occasionally has threads reading and writing to sockets.

What did you see instead?

The Threads ribbon hovers around 37 instead of around 1. My server runs with GOMAXPROCS=36.

I checked /debug/pprof/goroutines?debug=1 and ...?debug=2 to see if there really were more goroutines unexpectedly sitting in syscalls but did not find any.

I've produced a similar behavior on my laptop via go test net -trace=/tmp/trace && go tool trace /tmp/trace. With go1.9.2 it shows 1 thread in syscall, but on tip it shows 4 threads in syscall.


Here's my server with go1.9.2 (linux/amd64, GOMAXPROCS=36):
screen shot 2017-11-03 at 4 52 52 pm

And my server with tip—note the thick layer of periwinkle in the Threads ribbon:
screen shot 2017-11-03 at 4 53 14 pm


Here's go test net with go1.9.2 (darwin/amd64, GOMAXPROCS=8):
screen shot 2017-11-03 at 4 55 53 pm

And go test net with tip:
screen shot 2017-11-03 at 4 56 07 pm

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions