Skip to content

kvserver: revisit COCKROACH_SCHEDULER_CONCURRENCY cap #99063

Description

@erikgrinaker

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

Metadata

Metadata

Assignees

Labels

C-performancePerf of queries or internals. Solution not expected to change functional behavior.

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions