Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
base: increase
RaftTickInterval
from 200 ms to 500 ms
Tick costs for unquiesced ranges can use a large amount of CPU on nodes with many replicas. Increasing the tick interval from 200 ms to 500 ms reduces this CPU cost by 60%. On a 3-node cluster with 50.000 unquiesced ranges, this reduced the total CPU usage when idle from 54% to 32%. All derived intervals and timeouts have been adjusted such that they remain the same in wall time. This increases the latency (from 200 to 500 ms) for tick-driven actions: * Transfers of Raft leadership to leaseholders. * Follower overload pausing. * Updating the node liveness map. * Updating the IO thresholds map. Furthermore, because it reduces the resolution of the randomized Raft election timeout interval from [10-20) ticks to [4-8) ticks, it increases the chance of collisions and thus the chance of unsuccessful elections. Environment variables have been added to adjust this and any tick-dependant values at runtime in case problems arise. Epic: none Release note (performance improvement): The Raft tick interval has been increased from 200 ms to 500 ms in order to reduce per-replica CPU costs, and can now be adjusted via `COCKROACH_RAFT_TICK_INTERVAL`. Dependant parameters such as the Raft election timeout (`COCKROACH_RAFT_ELECTION_TIMEOUT_TICKS`), reproposal timeout (`COCKROACH_RAFT_REPROPOSAL_TIMEOUT_TICKS`), and heartbeat interval (`COCKROACH_RAFT_HEARTBEAT_INTERVAL_TICKS`) have been adjusted such that their wall-time value remains the same.
- Loading branch information