-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reduce the lock hold time during Map.clear (fixes #835)
When invalidating the cache, it is faster and simpler to discard under the eviction lock. This avoids thrashing on the write buffer and causing excessive maintenence runs, which are triggered per write. However, for a large cache this hold time may be excessive by causing other writes to pile up so that the write buffer is full and backpressure causes delays. In that case removing through the write buffer allows fairer throughput as all writes compete to append into the buffer and async draining will captures a batch of work. This avoids delaying any other write, or at least makes the backpressure times short, so that writes have better latencies by disfavoring the clear throughput. The cache adapts strategies by monitoring the size of the write buffer. If it grows over a threshold then the clear operation backs off by releasing the eviction lock and performing a one-by-one removal instead.
- Loading branch information
Showing
4 changed files
with
48 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters