neoremind commented on PR #16145:
URL: https://github.com/apache/lucene/pull/16145#issuecomment-6237250517
Thanks @goankur for the real-workload benchmarking! +1 on @gsmiller's neat
and smart idea of starting `consecutiveHits` at N-1! A warm file just does one
probe and goes directly to sampling mode without unnecessary ramp, a cold file
goes to ramp gating phase as designed, and a mixed warm/cold file goes through
at most one sampling before issuing more aggressive madvise.
Sharing my take in case it helps others catching up on this long thread with
many numbers, a better strategy to issue madivse smarter balancing
hot/cold/mixed, there are two phases: 1) a "gating" phase, where we probe every
call until we are confident the file is hot, once we pass "gating", we go to
next phase, 2) a "sampling" phase, where we issue less madivse since we have
"predicted" the file is likely to be warm in memory, but still notice when
pages become cold. Current main and this PR differ in on the strictness.
- main: it is more lenient gating + an unbounded exponential gap during
sampling. Great when pages are in memory. But under mixed warm/cold pressure
the gap grows large and more and more reads go without madvise help.
- this PR: stricter gating + a fixed capped gap. By issuing madvise more
aggressively we gain a lot more (3 digits %) on the mixed case (the JMH and
real-workload numbers all show this), and it traded off a bit (double digit %)
of hot. Moreover, the N-1 start balances and takes care of the hot case even
better.
In addition, throwing out an idea for a possible follow-up: the NoReuseHint
from #16682 might be a useful signal? Files flagged no-reuse (stored fields,
term vectors, raw rescore vectors) are large relative to the index, have
scattered page access and their pages are likely to be evicted once loaded, so
they may have a stricter policy, something like a bigger N and a smaller SKIP.
Others like postings, vector graph could keep what's in the PR.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]