Skip to content

Conversation

@bitfaster
Copy link
Owner

@bitfaster bitfaster commented Sep 3, 2022

In the Read+Write scenario, the bottleneck is lock contention while attempting to enter the maintenance lock.

image

Breakdown of time in maintenance:

image

Fix:

  1. Try to exit the lock early if maintenance has just run and it is possible to add to the write buffer. This reduces wait time for a queue of writes when in a lock convoy.
  2. When maintenance is running on the background thread, keep track of whether the write buffer was fully drained, and if not run maintenance again. This has the effect of maintenance constantly running in the background when the buffers are populated.
  3. Remove the spin wait, which is just slowing things down (throughput is measurably lower).

This is an approx 10% throughput gain for the Read+Write scenario.

image

@bitfaster bitfaster mentioned this pull request Sep 5, 2022
@bitfaster bitfaster merged commit 1ec0ef2 into main Sep 7, 2022
@bitfaster bitfaster deleted the users/alexpeck/lockctn branch September 7, 2022 01:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants