db-analyser: Ability to turn off caching for --lsm - #2156
Merged
Conversation
mgmeier
marked this pull request as ready for review
July 28, 2026 17:18
mgmeier
requested review from
bladyjoker,
dnadales,
geo2a,
jasagredo and
nfrisby
as code owners
July 28, 2026 17:18
jasagredo
reviewed
Jul 29, 2026
| , analysis :: AnalysisName | ||
| , confLimit :: Limit | ||
| , ldbBackend :: LedgerDBBackend | ||
| , lsmNoDiskCache :: Bool |
Contributor
There was a problem hiding this comment.
Can't this be included in LedgerDBBackend above to only parse it if we are using lsm?
mgmeier
force-pushed
the
mkarg/db-analyser-lsmnocache
branch
from
July 29, 2026 16:20
3ed9138 to
48fce84
Compare
Russoul
force-pushed
the
mkarg/db-analyser-lsmnocache
branch
2 times, most recently
from
July 31, 2026 20:54
7a5071d to
e49b37b
Compare
…analyser: ability to turn off caching for --lsm
Move the no-disk-cache flag into the V2LSM constructor of LedgerDBBackend so it can only be parsed together with --lsm, instead of being a free-standing switch accepted (and silently ignored) regardless of the chosen backend.
Russoul
force-pushed
the
mkarg/db-analyser-lsmnocache
branch
from
July 31, 2026 20:57
e49b37b to
a2a2607
Compare
jasagredo
approved these changes
Aug 3, 2026
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.
Description
ouroboros-consensus-lsm: exposeLSM.DiskCachePolicyas a parameterdb-analyser: allow disabling the disk cache for--lsmvia additional flag--lsm-no-cacheSummary
The LSM ledger DB backend previously always used
LSM.newTable/LSM.openTableFromSnapshotwith their default disk cache policy, so the UTxO table's disk cache behavior was hardcoded and not observable/tunable from outside the library.This PR:
LSM.DiskCachePolicythroughLSMArgs,Resources LSM,mkLSMArgsIO,tableFromValuesMK, andloadSnapshot, usingLSM.newTableWith/LSM.openTableFromSnapshotWithvariants, which allow for overriding the disk cache policy.LSM.DiskCachePolicyis now re-exported from theLSMmodule.--lsm-no-cache switchtodb-analyser, which, when combined with--lsm, sets the policy toLSM.DiskCacheNone(bypassing the OS page cache / usingO_DIRECTfor UTxO table reads and writes) instead of the defaultLSM.DiskCacheAll. This has no effect on other backends and is intended primarily for benchmarking disk I/O behavior in isolation from page-cache effects.LSMArgscall sites in the state-machine and ledger-snapshot test suites to pass an explicit cache policy (DiskCacheAll, preserving existing behavior).Motivation
For benchmarking the LSM backend's actual disk performance (e.g. comparing read/write throughput or measuring the true cost of table operations), the OS page cache can mask I/O costs by serving repeated reads from memory. Making the disk cache policy configurable lets
db-analyserruns isolate on-disk performance from cache effects.For a full rationale see input-output-hk/ouroboros-consensus-tools#12 and the
beacon/docs/METHODOLOGY.mddocument it adds.