cockroachdb / cockroach

CockroachDB - the open source, cloud-native distributed SQL database.
https://www.cockroachlabs.com
Other
29.51k stars 3.7k forks source link

kvcoord: DistSender circuit breaker benchmarking and optimization #119919

Open erikgrinaker opened 4 months ago

erikgrinaker commented 4 months ago

The DistSender circuit breakers added in https://github.com/cockroachdb/cockroach/pull/118943 need additional benchmarking and performance testing, particularly at large scale and high concurrency. We should consider using a sync.Map or IntMap variant, look at the effect of large numbers of probes (e.g. when a high-density node's disk stalls), consider batching probes, and use a sync.Pool for circuit breaker construction.

Jira issue: CRDB-36388

blathers-crl[bot] commented 3 months ago

Hi @erikgrinaker, please add branch-* labels to identify which branch(es) this release-blocker affects.

:owl: Hoot! I am a Blathers, a bot for CockroachDB. My owner is dev-inf.

erikgrinaker commented 3 months ago

The sync.Map was addressed in #120597. If we make it generic in #120604, it might save some allocations when creating circuit breakers in ForReplica().

At this point, circuit breakers don't appear to have a significant effect on end-to-end benchmarks, so they may already be "good enough".

Some known optimization opportunities:

nvanbenschoten commented 2 months ago

Removing this from blocking the release, but https://github.com/cockroachdb/cockroach/issues/121206 is still a GA-blocker.