Skip to content

net/http: BenchmarkClientServerParallel4 hangs and is useless #20166

Open
@bradfitz

Description

@bradfitz

It seems the BenchmarkClientServerParallel4 benchmark sometimes hangs while running. Sometimes it needs to be killed (first example) and sometimes it recovers on its own, leading to useless numbers.

In any case, I can't get good numbers out of it.

I suspect it's consuming too many sockets and running out of addresses or something.

bradfitz@gdev:~/go/src/net/http$ go test -benchtime=1s -bench=BenchmarkClientServerParallel4 -count=3 -run=XXXX | tee before
goos: linux
goarch: amd64
pkg: net/http
BenchmarkClientServerParallel4-4           30000             39470 ns/op            7539 B/op         73 allocs/op
BenchmarkClientServerParallel4-4           50000             40934 ns/op            7563 B/op         73 allocs/op
BenchmarkClientServerParallel4-4        ^C
bradfitz@gdev:~/go/src/net/http$ go test -benchtime=1s -bench=BenchmarkClientServerParallel4 -count=3 -run=XXXX | tee before
goos: linux
goarch: amd64
pkg: net/http
BenchmarkClientServerParallel4-4            5000            283132 ns/op            7244 B/op         85 allocs/op
BenchmarkClientServerParallel4-4               1        7011289330 ns/op           54720 B/op        527 allocs/op
BenchmarkClientServerParallel4-4               1        7010777787 ns/op           37472 B/op        238 allocs/op
PASS
ok      net/http        16.585s

Metadata

Metadata

Assignees

No one assigned

    Labels

    TestingAn issue that has been verified to require only test changes, not just a test failure.help wanted

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions