forked from cockroachdb/pebble
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
*: Introduce read triggered compaction heuristic
Previously, our compactions were triggered on write based heuristics. This change introduces compactions based on high read activity to improve read performance in read-heavy workloads. It is inspired from LevelDB's read based compaction heuristic which is outlined in the following issue: cockroachdb#29. These compactions are triggered using an `AllowedSeeks` parameter on each file's `FileMetadata`. Reads are sampled based on a rate defined in `iterator.MaybeSampleRead()`. If a read is sampled, `AllowedSeeks` is decremented on the file in the top-most level containing the key. Once `AllowedSeeks` reaches 0, a compaction for the key range is scheduled. Read triggered compactions are only considered if no other compaction is possible at the time. This helps prioritize score based compactions to maintain a healthy LSM shape. The results of this change in benchmarks are outlined in the github issue: cockroachdb#29.
- Loading branch information
1 parent
100e1a4
commit d5d9287
Showing
22 changed files
with
1,362 additions
and
53 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
Oops, something went wrong.