-
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
storage: tick only raft groups which are not quiesced #26910
Conversation
Previously we were ticking every replica, regardless of whether or not it was part of a quiesced range, at each tick interval. For 10,000 ranges this was noticeable. Each `Replica.tick()` operation enqueues on a scheduler queue, is serviced by a goroutine which calls `time.Now()`, and acquires several mutexes before discovering it's quiesced and exiting. We happen to have a carefully maintained map of unquiesced replicas, which this change uses instead of all of the store's replicas, when populating the `rangeIDs` slice used to enqueue Raft ticks. Release note (performance improvement): less CPU utilization with many ranges.
FYI, @bdarnell previously made this change (he introduced the Review status: Comments from Reviewable |
Yes, this reverts #26291. I didn't find any other bugs in the use of this map so it's time to give this another shot. Review status: Comments from Reviewable |
Ok, I'll merge this for Spencer then while he's out. bors r=bdarnell |
26910: storage: tick only raft groups which are not quiesced r=bdarnell a=spencerkimball Previously we were ticking every replica, regardless of whether or not it was part of a quiesced range, at each tick interval. For 10,000 ranges this was noticeable. Each `Replica.tick()` operation enqueues on a scheduler queue, is serviced by a goroutine which calls `time.Now()`, and acquires several mutexes before discovering it's quiesced and exiting. We happen to have a carefully maintained map of unquiesced replicas, which this change uses instead of all of the store's replicas, when populating the `rangeIDs` slice used to enqueue Raft ticks. Release note (performance improvement): less CPU utilization with many ranges. Co-authored-by: Spencer Kimball <[email protected]>
Build succeeded |
Previously we were ticking every replica, regardless of whether
or not it was part of a quiesced range, at each tick interval.
For 10,000 ranges this was noticeable. Each
Replica.tick()
operation enqueues on a scheduler queue, is serviced by a
goroutine which calls
time.Now()
, and acquires several mutexesbefore discovering it's quiesced and exiting.
We happen to have a carefully maintained map of unquiesced
replicas, which this change uses instead of all of the store's
replicas, when populating the
rangeIDs
slice used to enqueueRaft ticks.
Release note (performance improvement): less CPU utilization
with many ranges.