[ 
https://issues.apache.org/jira/browse/OAK-12426?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Rishabh Daim updated OAK-12426:
-------------------------------
    Description: 
h3. Summary
Compare CacheLIRS, Caffeine SYNC and Caffeine ASYNC for oak-store-document 
before deciding how to roll out Caffeine.

h3. Scope
Add a reproducible benchmark in oak-benchmarks that exercises the production 
DocumentNodeStore node cache. Cover steady-state reads, warm and cold state, 
churn/eviction, invalidation and concurrent access. Report throughput, latency, 
cache statistics and loader counts under identical weights, workloads, 
persistent-write behavior and JVM settings. Enable the Document ASYNC opt-in 
explicitly for ASYNC benchmark rows; CacheLIRS remains the production default, 
FT_CAFFEINE_CACHE_OAK-12425 opts into Caffeine SYNC, and FT_OAK-12437 
additionally gates explicitly selected ASYNC caches. Keep benchmark code in PR 
#3174 above the OAK-12437 PR in the gh stack.

h3. Acceptance Criteria
* Compare LIRS, Caffeine SYNC and explicitly enabled Caffeine ASYNC through 
production DocumentNodeStore APIs.
* Keep weights, workloads, persistent-write behavior and JVM settings 
consistent across modes.
* Report throughput, latency, cache statistics and backend loads for repeatable 
runs.
* Do not change the disabled Caffeine opt-in or the SYNC default for opted-in 
Caffeine based on benchmark results.
* PR #3174 depends on OAK-12437, which is based on OAK-12425.


h2. Repository workload coverage

Keep direct-cache microbenchmarks separate from real DocumentNodeStore 
workloads. Add point reads of actual values, full child-group traversal, 
property commits and revision diffs, concurrent readers with one writer, 
concurrent writers on distinct nodes, and reopening the same persistent cache 
against the same document backend. Use production cache distribution and 
variable-size values. Verify returned/committed data and complete operation 
counts. Report document finds/queries and observed persistent-cache hits; do 
not assume reopening causes disk reuse.

Compare CacheLIRS, Caffeine SYNC with original metadata, and opted-in Caffeine 
ASYNC with entry-owned metadata at equal cache memory budgets in fresh Java 17 
processes. Preserve disabled opt-ins and effective-mode checks. Publish 
repeated results with a short TL;DR and full tables.

MemoryDocumentStore workloads measure repository/cache coordination, not remote 
MongoDB/RDB latency, cluster invalidation, failover or application throughput. 
Publish these limitations with the results.

h3. LOCAL_DIFF policy and rerun
Both Caffeine benchmark policies retain the production LOCAL_DIFF exception: 
LIRS admission, SYNC maintenance and original metadata. Other eligible caches 
use the requested Caffeine maintenance mode. Validate effective policy without 
rejecting this deliberate exception. Rerun all three policies after the 
mitigation at unchanged memory/workload/JVM settings; replace the existing 
result comment and clearly distinguish prior all-Caffeine measurements from the 
updated hybrid policy.


h3. Benchmark audit and migration goal
The goal remains Caffeine throughout oak-store-document. The LOCAL_DIFF LIRS 
exception is a temporary regression mitigation/control; do not treat the hybrid 
policy as a completed all-Caffeine migration. OAK-12426 measures normal commits 
plus saved-value verification separately from commits with an additional 
explicit parent diff. Use 256 MiB as the primary total repository-cache budget 
with production distribution, and 384 MiB for 50% more memory. Compare the 
hybrid policy against all-Caffeine LOCAL_DIFF controls. Report merge, explicit 
diff and readback time, local-diff memory hits/misses and backend finds. 
Exercise 10,000 and 120,000 total data nodes under the same 256/384 MiB 
budgets. Use a bucket/group hierarchy with 100 data children per group and at 
most 100 groups per bucket by default; total nodes are not siblings. Keep 
folder width configurable. Use the production one-second DocumentNodeStore 
background interval during setup and timing. Label 1,000-child folders and 
disabled-background runs as stress diagnostics. Pending unflushed bulk-load 
journal paths can greatly amplify a local-diff miss; do not attribute the 
entire diagnostic slowdown to cache policy alone. Keep direct NODE 
microbenchmark capacity separate from the repository total-cache budget. Label 
earlier 16/24 MiB results as memory-pressure diagnostics, not typical 
production throughput. EmptyHook and MemoryDocumentStore omit application hooks 
and remote database latency.


  was:
h3. Summary
Compare CacheLIRS, Caffeine SYNC and Caffeine ASYNC for oak-store-document 
before deciding how to roll out Caffeine.

h3. Scope
Add a reproducible benchmark in oak-benchmarks that exercises the production 
DocumentNodeStore node cache. Cover steady-state reads, warm and cold state, 
churn/eviction, invalidation and concurrent access. Report throughput, latency, 
cache statistics and loader counts under identical weights, workloads, 
persistent-write behavior and JVM settings. Enable the Document ASYNC opt-in 
explicitly for ASYNC benchmark rows; CacheLIRS remains the production default, 
FT_CAFFEINE_CACHE_OAK-12425 opts into Caffeine SYNC, and FT_OAK-12437 
additionally gates explicitly selected ASYNC caches. Keep benchmark code in PR 
#3174 above the OAK-12437 PR in the gh stack.

h3. Acceptance Criteria
* Compare LIRS, Caffeine SYNC and explicitly enabled Caffeine ASYNC through 
production DocumentNodeStore APIs.
* Keep weights, workloads, persistent-write behavior and JVM settings 
consistent across modes.
* Report throughput, latency, cache statistics and backend loads for repeatable 
runs.
* Do not change the disabled Caffeine opt-in or the SYNC default for opted-in 
Caffeine based on benchmark results.
* PR #3174 depends on OAK-12437, which is based on OAK-12425.


h2. Repository workload coverage

Keep direct-cache microbenchmarks separate from real DocumentNodeStore 
workloads. Add point reads of actual values, full child-group traversal, 
property commits and revision diffs, concurrent readers with one writer, 
concurrent writers on distinct nodes, and reopening the same persistent cache 
against the same document backend. Use production cache distribution and 
variable-size values. Verify returned/committed data and complete operation 
counts. Report document finds/queries and observed persistent-cache hits; do 
not assume reopening causes disk reuse.

Compare CacheLIRS, Caffeine SYNC with original metadata, and opted-in Caffeine 
ASYNC with entry-owned metadata at equal cache memory budgets in fresh Java 17 
processes. Preserve disabled opt-ins and effective-mode checks. Publish 
repeated results with a short TL;DR and full tables.

MemoryDocumentStore workloads measure repository/cache coordination, not remote 
MongoDB/RDB latency, cluster invalidation, failover or application throughput. 
Publish these limitations with the results.

h3. LOCAL_DIFF policy and rerun
Both Caffeine benchmark policies retain the production LOCAL_DIFF exception: 
LIRS admission, SYNC maintenance and original metadata. Other eligible caches 
use the requested Caffeine maintenance mode. Validate effective policy without 
rejecting this deliberate exception. Rerun all three policies after the 
mitigation at unchanged memory/workload/JVM settings; replace the existing 
result comment and clearly distinguish prior all-Caffeine measurements from the 
updated hybrid policy.


h3. Benchmark audit and migration goal
The goal remains Caffeine throughout oak-store-document. The LOCAL_DIFF LIRS 
exception is a temporary regression mitigation/control; do not treat the hybrid 
policy as a completed all-Caffeine migration. OAK-12426 measures normal commits 
plus saved-value verification separately from commits with an additional 
explicit parent diff. Use 256 MiB as the primary total repository-cache budget 
with production distribution, and 384 MiB for 50% more memory. Compare the 
hybrid policy against all-Caffeine LOCAL_DIFF controls. Report merge, explicit 
diff and readback time, local-diff memory hits/misses and backend finds. 
Exercise a larger working set under the same 256/384 MiB budgets. Label earlier 
16/24 MiB results as memory-pressure diagnostics, not typical production 
throughput. EmptyHook and MemoryDocumentStore omit application hooks and remote 
database latency.



> Benchmark CacheLIRS and Caffeine for oak-store-document
> -------------------------------------------------------
>
>                 Key: OAK-12426
>                 URL: https://issues.apache.org/jira/browse/OAK-12426
>             Project: Jackrabbit Oak
>          Issue Type: Task
>            Reporter: Rishabh Daim
>            Assignee: Rishabh Daim
>            Priority: Major
>
> h3. Summary
> Compare CacheLIRS, Caffeine SYNC and Caffeine ASYNC for oak-store-document 
> before deciding how to roll out Caffeine.
> h3. Scope
> Add a reproducible benchmark in oak-benchmarks that exercises the production 
> DocumentNodeStore node cache. Cover steady-state reads, warm and cold state, 
> churn/eviction, invalidation and concurrent access. Report throughput, 
> latency, cache statistics and loader counts under identical weights, 
> workloads, persistent-write behavior and JVM settings. Enable the Document 
> ASYNC opt-in explicitly for ASYNC benchmark rows; CacheLIRS remains the 
> production default, FT_CAFFEINE_CACHE_OAK-12425 opts into Caffeine SYNC, and 
> FT_OAK-12437 additionally gates explicitly selected ASYNC caches. Keep 
> benchmark code in PR #3174 above the OAK-12437 PR in the gh stack.
> h3. Acceptance Criteria
> * Compare LIRS, Caffeine SYNC and explicitly enabled Caffeine ASYNC through 
> production DocumentNodeStore APIs.
> * Keep weights, workloads, persistent-write behavior and JVM settings 
> consistent across modes.
> * Report throughput, latency, cache statistics and backend loads for 
> repeatable runs.
> * Do not change the disabled Caffeine opt-in or the SYNC default for opted-in 
> Caffeine based on benchmark results.
> * PR #3174 depends on OAK-12437, which is based on OAK-12425.
> h2. Repository workload coverage
> Keep direct-cache microbenchmarks separate from real DocumentNodeStore 
> workloads. Add point reads of actual values, full child-group traversal, 
> property commits and revision diffs, concurrent readers with one writer, 
> concurrent writers on distinct nodes, and reopening the same persistent cache 
> against the same document backend. Use production cache distribution and 
> variable-size values. Verify returned/committed data and complete operation 
> counts. Report document finds/queries and observed persistent-cache hits; do 
> not assume reopening causes disk reuse.
> Compare CacheLIRS, Caffeine SYNC with original metadata, and opted-in 
> Caffeine ASYNC with entry-owned metadata at equal cache memory budgets in 
> fresh Java 17 processes. Preserve disabled opt-ins and effective-mode checks. 
> Publish repeated results with a short TL;DR and full tables.
> MemoryDocumentStore workloads measure repository/cache coordination, not 
> remote MongoDB/RDB latency, cluster invalidation, failover or application 
> throughput. Publish these limitations with the results.
> h3. LOCAL_DIFF policy and rerun
> Both Caffeine benchmark policies retain the production LOCAL_DIFF exception: 
> LIRS admission, SYNC maintenance and original metadata. Other eligible caches 
> use the requested Caffeine maintenance mode. Validate effective policy 
> without rejecting this deliberate exception. Rerun all three policies after 
> the mitigation at unchanged memory/workload/JVM settings; replace the 
> existing result comment and clearly distinguish prior all-Caffeine 
> measurements from the updated hybrid policy.
> h3. Benchmark audit and migration goal
> The goal remains Caffeine throughout oak-store-document. The LOCAL_DIFF LIRS 
> exception is a temporary regression mitigation/control; do not treat the 
> hybrid policy as a completed all-Caffeine migration. OAK-12426 measures 
> normal commits plus saved-value verification separately from commits with an 
> additional explicit parent diff. Use 256 MiB as the primary total 
> repository-cache budget with production distribution, and 384 MiB for 50% 
> more memory. Compare the hybrid policy against all-Caffeine LOCAL_DIFF 
> controls. Report merge, explicit diff and readback time, local-diff memory 
> hits/misses and backend finds. Exercise 10,000 and 120,000 total data nodes 
> under the same 256/384 MiB budgets. Use a bucket/group hierarchy with 100 
> data children per group and at most 100 groups per bucket by default; total 
> nodes are not siblings. Keep folder width configurable. Use the production 
> one-second DocumentNodeStore background interval during setup and timing. 
> Label 1,000-child folders and disabled-background runs as stress diagnostics. 
> Pending unflushed bulk-load journal paths can greatly amplify a local-diff 
> miss; do not attribute the entire diagnostic slowdown to cache policy alone. 
> Keep direct NODE microbenchmark capacity separate from the repository 
> total-cache budget. Label earlier 16/24 MiB results as memory-pressure 
> diagnostics, not typical production throughput. EmptyHook and 
> MemoryDocumentStore omit application hooks and remote database latency.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to