How many threads can the Go runtime (scheduler, garbage collector, etc.) use? For example, if GOMAXPROCS
is 10
, how many of those kernel threads would be used by the runtime?
Edit:
I was reading the rationale for changing GOMAXPROCS
to runtime.NumCPU()
in Go 1.5. There was a sentence that claimed that “the performance of single-goroutine programs can improve by raising GOMAXPROCS
due to parallelism of the runtime, especially the garbage collector.”
My real question is: If I have a single-goroutine program running in a Docker container that has a CPU quota, what is the minimum number of logical processors that I need in order to have maximum performance?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…