Repository navigation
Benchmark compaction against the JE cleaner - #65
Merged
Merged
Conversation
--compaction-live-ratio and --pages-per-segment set the matching engine options for HStore runs, so compaction behaviour can be compared across settings.
HStore calls StorageEngine.compact. JE runs cleanLog until it cleans nothing and then forces a checkpoint, which deletes the cleaned files.
After the churn, two 10 s windows of single-update commits on a fixed schedule: one without compaction and one with a full compaction starting 1 s in. disk.churned is now recorded at a reopen before them, and disk.compacted at the end.
Reclaimed space is the first measure where more is better, so its ratio is inverted, and negative sizes are printed as such.
This was referenced Oct 5, 2026
HStore deletes a retired segment only once no older reader can need it, which often happens after compact() returns. Measuring the disk while open, right after the window, missed that space. Both sides of the figure now come from a reopen. The delay before compaction now loops until its deadline, and the two fixed-rate windows are left out of the main table, where their ratio only showed the schedule.
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #60
Adds a compaction phase after the churn, for both stores:
disk.churnedis recorded at a reopen, so it still means "after the deletes".compaction.baseline: 10 s of single-update commits every 20 ms on a fixed schedule, with latency measured from the scheduled time.compaction: the same, with a full compaction starting 1 s in. The window runs until the compaction finishes, so a long pass can't fall outside it.disk.compacted: bytes on disk after a clean shutdown.HStore calls
StorageEngine.compact(). HyperGraphDB runs JE'scleanLog()until it cleans nothing, then forces a checkpoint so the cleaned files get deleted.The report shows both windows in the latency table, plus compaction time and space reclaimed in the Resources table. Reclaimed space is the first measure where more is better, so its ratio is flipped. It can also be negative, which the report now prints properly.
It also adds
--compaction-live-ratioand--pages-per-segment(COMPACTION_LIVE_RATIOandPAGES_PER_SEGMENTinrun.sh) for HStore.Smoke runs at scale 1, async, one run each, on a loaded machine:
So HStore gets far more space back, but stops commits for the whole pass, while JE keeps committing. That's #50, now measured by the benchmark.
Tested:
./mvnw installpassesRUNS=1 PAGES_PER_SEGMENT=1024 benchmarks/run.shruns end to end