We currently cap COCKROACH_SCHEDULER_CONCURRENCY at 96, to avoid mutex collapse as seen in #56851.
|
var storeSchedulerConcurrency = envutil.EnvOrDefaultInt( |
|
// For small machines, we scale the scheduler concurrency by the number of |
|
// CPUs. 8*NumCPU was determined in 9a68241 (April 2017) as the optimal |
|
// concurrency level on 8 CPU machines. For larger machines, we've seen |
|
// (#56851) that this scaling curve can be too aggressive and lead to too much |
|
// contention in the Raft scheduler, so we cap the concurrency level at 96. |
|
// |
|
// As of November 2020, this default value could be re-tuned. |
|
"COCKROACH_SCHEDULER_CONCURRENCY", min(8*runtime.GOMAXPROCS(0), 96)) |
However, with recent changes such as scheduler sharding (#98854) and async IO (#94165), this may no longer be appropriate, and we should revisit the policy here.
Jira issue: CRDB-25685
We currently cap
COCKROACH_SCHEDULER_CONCURRENCYat 96, to avoid mutex collapse as seen in #56851.cockroach/pkg/kv/kvserver/store.go
Lines 116 to 124 in 4e8e867
However, with recent changes such as scheduler sharding (#98854) and async IO (#94165), this may no longer be appropriate, and we should revisit the policy here.
Jira issue: CRDB-25685