x/net/http2: default random write scheduler uses too much cpu when there are a lot of streams #21200
Labels
FrozenDueToAge
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Performance
Milestone
What version of Go are you using (
go version
)?go version go1.8.3 linux/amd64
What operating system and processor architecture are you using (
go env
)?What did you do?
When we run kubernetes apiserver, we simluate 200 clients in one exe, and we have about 300 exe to simulate 60k clients. So there're many streams in one tcp connection.
This is my steps:
Here's some clues we found:
the Push of http2randomWriteScheduler use 5.78% of memory, and about 1%(175.27MB) in ws.sq, so we
guess there're many streams.
And the cpu hotspot:
It used 44.29% cpu time on http2writeQueue.consume, as the fact, most of the queue is empty.
Here the png generated by the pprof tools, it maybe help:

What did you expect to see?
The http2 random write scheduler works fine and uses lower cpu.
The scheduler should find not empty queues as soon as possible or should we have any newer scheduler can be used?
What did you see instead?
The scheduler uses so much cpu, about 45% in my case.
The text was updated successfully, but these errors were encountered: