Closed
Description
We are using pprof for online profiling and we found goroutine dumping may take too much time when there are many goroutines.
In this case, it will take ~300ms when there are 100k goroutines on my side.
https://gist.github.com/doujiang24/9d066bce3a2bdd0f1b9fe1ef49699e4e
It's a too long time since there are almost 10k-100k goroutines in our system.
I think the easier way is to introduce a new API SetMaxDumpGoroutineNum
.
I have implemented it in this PR: #50771
But, the SetMaxDumpGoroutineNum
API introduced a new global variable.
This may not be a good idea.
Any feedback would be greatly appreciated. Thank you!