cockroachdb / cockroachdb/cockroach

kvserver: optimize raft-replica cpu attribution

Open
#94,625 1 comment 0 reactions 0 assignees View on GitHub
A-kv-distribution C-enhancement T-kv
Dominant language
Go
Stars
32.5k
Forks
4.1k
PR merge metrics
PR metrics pending

Description

When disabling range quiescence by default, it was discovered that a major CPU consumer was the replica cputime attribution that occurs within the raft processing.

> [...] that 10% Go GC chunk on the left there is also caused by MeasureRaftCPUNanos(), so it takes a good 18% of total CPU usage. We should look into optimizing this.

This overhead per-replica is large and this issue is to minimize this cost.

**Describe the solution you'd like**

At a high level the objectives are to:
1. Remove all heap allocations that occur as a result of recording raft cpu nanos. (10% cpu on Go GC in linked experiments)
2. Reduce the per-call CPU overhead of `MeasureRaftCPUNanos()`

xref #94592

Jira issue: CRDB-23053

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.