runtime: delay mutator pacing until the end of lock block #18558
Labels
FrozenDueToAge
WaitingForInfo
Issue is not actionable because of missing required information, which needs to be provided.
Milestone
As I understand, currently goroutines may be switched to GC work on memory allocations. This work may take some time, thus pacing goroutines doing a lot of allocations. The problem is that the switch to GC work may happen inside highly contended lock block, so other goroutines become blocked at the beginning of the block. This may significantly increase tail request latencies for highly loaded http servers. This is quite common case. For instance, if a global map is updated under the lock with each incoming request.
The proposal is to postpone GC work till the end of lock block. Additionally, allocation limit may be set at the beginning of each lock block, so the goroutine is switched to GC work after reaching this limit inside the lock block.
The text was updated successfully, but these errors were encountered: