-
Notifications
You must be signed in to change notification settings - Fork 3.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
kvserver: revisit COCKROACH_SCHEDULER_CONCURRENCY
cap
#99063
Comments
cc @cockroachdb/replication |
COCKROACH_SCHEDULER_CONCURRENCY
capCOCKROACH_SCHEDULER_CONCURRENCY
cap
COCKROACH_SCHEDULER_CONCURRENCY
capCOCKROACH_SCHEDULER_CONCURRENCY
cap
COCKROACH_SCHEDULER_CONCURRENCY
capCOCKROACH_SCHEDULER_CONCURRENCY
cap
Tried dropping the 96 worker cap now that we have scheduler sharding. A few quick runs of It might have more of an effect with 8 stores. Will try a few runs. |
I've run a few experiments. Setup:
Results showing throughput as a function of Raft scheduler concurrency per CPU. Additional runs with a fixed 96 workers were also run to compare with the current default value. Current defaults are highlighted in bold.
Overall, the number of workers per CPU does not significantly affect the results. With 2/4 CPUs we see some possible degradation at 10 workers/CPU, but 8 workers/CPU seems reasonable. With 96 cores, we see significant degradation. The nodes were only running at about 50% CPU. Mutex profiles mostly showed contention on per-replica mutexes (see below), so another set of benchmarks were run with 10k rather than 1k ranges, but this showed similar degradation. Another set of benchmarks were run with 8 stores, which removed the performance degradation with increasing worker counts, but failed to significantly increase throughput -- at this point the nodes were running at about 65-70% CPU. Given the above, it seems reasonable to retain 8 workers/CPU with a hard cap. However, I'll increase the cap from 96 to 128 -- this did not appear to impact results for 32 cores and below (we don't recommend running beyond 32 cores anyway), and it somewhat reduces the starvation risk with sharding and multi-store. Mutex profile of 96-core 1k range single-store run with 6 workers/CPU primarily shows per-replica and Pebble contention, as well as Raft transport (likely introduced by recent Raft flow control work). This goes some way towards explaining why multi-store performed better. |
I suppose it's possible that we hit a resource ceiling on the worker node at this point. I didn't examine it. We were able to push 10% more throughput with 96 CPUs on 96 Raft workers though, which indicates this wasn't the case. |
We currently cap
COCKROACH_SCHEDULER_CONCURRENCY
at 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
The text was updated successfully, but these errors were encountered: