Skip to content

kv/RocksDB: Add instrumentation to BinnedLRUCache - #64819

Merged
Jayaprakash-ibm merged 1 commit into
ceph:mainfrom
aclamk:aclamk-rocksdb-binned-cache-perf-counters
Feb 9, 2026
Merged

Jayaprakash-ibm merged 1 commit into
ceph:mainfrom
aclamk:aclamk-rocksdb-binned-cache-perf-counters

Conversation

@aclamk

@aclamk aclamk commented Aug 4, 2025 •

Copy link
Copy Markdown
Contributor
  1. perf counters
    For each cache section in perf counters is created.
    "rocksdb-cache-O": {
    "capacity": 134217728,
    "usage": 134182832,
    "pinned": 0,
    "elems": 24502,
    "inserts": 25806978,
    "lookups": 150436987,
    "hits": 124629911,
    "misses": 25807076
    }
    In default configuration there are 2 sections: "rocksdb-cache-O", "rocksdb-cache-default".

  2. admin command
    For each cache admin command "rocksdb show cache x" is added.
    "./bin/ceph tell osd.0 rocksdb show cache O"

shard capacity usage pinned elems inserts lookups hits misses
0 13631488 11076400 0 2099 136987 822679 685923 136756
1 13631488 11549712 0 2043 133359 571500 438383 133117
2 13631488 11060608 0 2232 135076 908468 773313 135155
3 13631488 11166896 0 2269 134006 427070 293147 133923
4 13631488 11117984 0 2297 133367 700242 567318 132924
5 13631488 11306672 0 2155 137501 1130135 991810 138325
6 13631488 11506512 0 2353 134515 662792 528514 134278
7 13631488 11093856 0 2316 135348 718971 583421 135550
8 13631488 11660624 0 2424 137363 1092043 954248 137795
9 13631488 10962000 0 2561 131982 431702 300467 131235
10 13631488 11379392 0 1916 134543 477118 342854 134264
11 13631488 11294272 0 2555 134508 512393 378337 134056
12 13631488 11277136 0 2079 137312 1131571 993692 137879
13 13631488 10887776 0 2543 134001 567073 432903 134170
14 13631488 10986528 0 2394 133288 584452 451018 133434
15 13631488 11954464 0 2456 134615 708285 573374 134911

  1. admin command
    "./bin/ceph tell osd.0 rocksdb reset cache O"
    clears "inserts", "lookups", "hits" and "misses"

Contribution Guidelines

  • To sign and title your commits, please refer to Submitting Patches to Ceph.

  • If you are submitting a fix for a stable branch (e.g. "quincy"), please refer to Submitting Patches to Ceph - Backports for the proper workflow.

  • When filling out the below checklist, you may click boxes directly in the GitHub web UI. When entering or editing the entire PR message in the GitHub web UI editor, you may also select a checklist item by adding an x between the brackets: [x]. Spaces and capitalization matter when checking off items this way.

Checklist

  • Tracker (select at least one)
    • References tracker ticket
    • Very recent bug; references commit where it was introduced
    • New feature (ticket optional)
    • Doc update (no ticket needed)
    • Code cleanup (no ticket needed)
  • Component impact
    • Affects Dashboard, opened tracker ticket
    • Affects Orchestrator, opened tracker ticket
    • No impact that needs to be tracked
  • Documentation (select at least one)
    • Updates relevant documentation
    • No doc update is appropriate
  • Tests (select at least one)
Show available Jenkins commands

@aclamk
aclamk requested a review from a team as a code owner August 4, 2025 13:10
@github-actions github-actions Bot added the core label Aug 4, 2025
@markhpc
markhpc self-requested a review August 7, 2025 14:56
@markhpc

markhpc commented Aug 7, 2025

Copy link
Copy Markdown
Member

I wonder if we are going to the effort to expose these metrics via the admin commands and performance counters if we should standardize the commands and output across all priority caches?

@aclamk
aclamk force-pushed the aclamk-rocksdb-binned-cache-perf-counters branch from 39ff993 to d2776a6 Compare August 13, 2025 09:00
@aclamk
aclamk force-pushed the aclamk-rocksdb-binned-cache-perf-counters branch from d2776a6 to 625bb95 Compare August 13, 2025 11:41
@aclamk

aclamk commented Aug 26, 2025

Copy link
Copy Markdown
Contributor Author

jenkins test make check

@aclamk

aclamk commented Aug 27, 2025

Copy link
Copy Markdown
Contributor Author

I wonder if we are going to the effort to expose these metrics via the admin commands and performance counters if we should standardize the commands and output across all priority caches?

@markhpc
I can standardize admin socket commands, but not content of the output. Each cache: rocksdb block, onode, block, (maybe bluefs) will have its own specifics.
What can, and should be in uniform way is the priority cache (bins length, bins reuse, bins hit rate) but that is outside of this PR's scope.

@aclamk aclamk added the aclamk-testing-ceres bluestore testing label Aug 27, 2025
@aclamk
aclamk force-pushed the aclamk-rocksdb-binned-cache-perf-counters branch from 625bb95 to e5c0d58 Compare August 28, 2025 09:48
@github-actions

Copy link
Copy Markdown

This pull request has been automatically marked as stale because it has not had any activity for 60 days. It will be closed if no further activity occurs for another 30 days.
If you are a maintainer or core committer, please follow-up on this pull request to identify what steps should be taken by the author to move this proposed change forward.
If you are the author of this pull request, thank you for your proposed contribution. If you believe this change is still appropriate, please ensure that any feedback has been addressed and ask for a code review.

@github-actions github-actions Bot added the stale label Oct 27, 2025
@aclamk

aclamk commented Nov 4, 2025

Copy link
Copy Markdown
Contributor Author

jenkins test make check

@github-actions github-actions Bot removed the stale label Nov 4, 2025
@aclamk

aclamk commented Dec 9, 2025

Copy link
Copy Markdown
Contributor Author

jenkins test windows

Comment thread src/kv/rocksdb_cache/BinnedLRUCache.cc Resolved
Comment thread src/kv/rocksdb_cache/BinnedLRUCache.cc Resolved
Comment thread src/kv/rocksdb_cache/BinnedLRUCache.h Resolved
Comment thread src/kv/rocksdb_cache/BinnedLRUCache.h Resolved
1) perf counters
For each cache section in perf counters is created.
    "rocksdb-cache-O": {
        "capacity": 134217728,
        "usage": 134182832,
        "pinned": 0,
        "elems": 24502,
        "inserts": 25806978,
        "lookups": 150436987,
        "hits": 124629911,
        "misses": 25807076
    }
In default configuration there are 2 sections: "rocksdb-cache-O", "rocksdb-cache-default".

2) admin command
For each cache admin command "rocksdb show cache x" is added.
> ./bin/ceph tell osd.0 rocksdb show cache O
shard  capacity     usage    pinned     elems   inserts   lookups      hits    misses
    0  13631488  11076400         0      2099    136987    822679    685923    136756
    1  13631488  11549712         0      2043    133359    571500    438383    133117
    2  13631488  11060608         0      2232    135076    908468    773313    135155
    3  13631488  11166896         0      2269    134006    427070    293147    133923
    4  13631488  11117984         0      2297    133367    700242    567318    132924
    5  13631488  11306672         0      2155    137501   1130135    991810    138325
    6  13631488  11506512         0      2353    134515    662792    528514    134278
    7  13631488  11093856         0      2316    135348    718971    583421    135550
    8  13631488  11660624         0      2424    137363   1092043    954248    137795
    9  13631488  10962000         0      2561    131982    431702    300467    131235
   10  13631488  11379392         0      1916    134543    477118    342854    134264
   11  13631488  1129427         0      2555    134508    512393    378337    134056
   12  13631488  11277136         0      2079    137312   1131571    993692    137879
   13  13631488  10887776         0      2543    134001    567073    432903    134170
   14  13631488  10986528         0      2394    133288    584452    451018    133434
   15  13631488  11954464         0      2456    134615    708285    573374    134911

3) admin command
" ./bin/ceph tell osd.0 rocksdb reset cache O" clears "inserts",
"lookups", "hits" and "misses"

Signed-off-by: Adam Kupczyk <[email protected]>
@aclamk
aclamk force-pushed the aclamk-rocksdb-binned-cache-perf-counters branch from e5c0d58 to cadd4a4 Compare February 5, 2026 11:08
@Jayaprakash-ibm

Copy link
Copy Markdown
Contributor

@Jayaprakash-ibm

Copy link
Copy Markdown
Contributor

jenkins test windows

@Jayaprakash-ibm
Jayaprakash-ibm merged commit 86d02c0 into ceph:main Feb 9, 2026
6 checks passed
@nhoad

nhoad commented Feb 13, 2026

Copy link
Copy Markdown
Contributor

I'm obviously late to the party here, but @aclamk how difficult would it be to extend this to include tombstones?

batrick pushed a commit to aclamk/ceph that referenced this pull request Apr 6, 2026
1) perf counters
For each cache section in perf counters is created.
    "rocksdb-cache-O": {
        "capacity": 134217728,
        "usage": 134182832,
        "pinned": 0,
        "elems": 24502,
        "inserts": 25806978,
        "lookups": 150436987,
        "hits": 124629911,
        "misses": 25807076
    }
In default configuration there are 2 sections: "rocksdb-cache-O", "rocksdb-cache-default".

2) admin command
For each cache admin command "rocksdb show cache x" is added.
> ./bin/ceph tell osd.0 rocksdb show cache O
shard  capacity     usage    pinned     elems   inserts   lookups      hits    misses
    0  13631488  11076400         0      2099    136987    822679    685923    136756
    1  13631488  11549712         0      2043    133359    571500    438383    133117
    2  13631488  11060608         0      2232    135076    908468    773313    135155
    3  13631488  11166896         0      2269    134006    427070    293147    133923
    4  13631488  11117984         0      2297    133367    700242    567318    132924
    5  13631488  11306672         0      2155    137501   1130135    991810    138325
    6  13631488  11506512         0      2353    134515    662792    528514    134278
    7  13631488  11093856         0      2316    135348    718971    583421    135550
    8  13631488  11660624         0      2424    137363   1092043    954248    137795
    9  13631488  10962000         0      2561    131982    431702    300467    131235
   10  13631488  11379392         0      1916    134543    477118    342854    134264
   11  13631488  1129427         0      2555    134508    512393    378337    134056
   12  13631488  11277136         0      2079    137312   1131571    993692    137879
   13  13631488  10887776         0      2543    134001    567073    432903    134170
   14  13631488  10986528         0      2394    133288    584452    451018    133434
   15  13631488  11954464         0      2456    134615    708285    573374    134911

3) admin command
" ./bin/ceph tell osd.0 rocksdb reset cache O" clears "inserts",
"lookups", "hits" and "misses"

Signed-off-by: Adam Kupczyk <[email protected]>
(cherry picked from commit cadd4a4)
(contributed as ceph#64819)
mertsunacoglu pushed a commit to mertsunacoglu/ceph that referenced this pull request Aug 26, 2026
1) perf counters
For each cache section in perf counters is created.
    "rocksdb-cache-O": {
        "capacity": 134217728,
        "usage": 134182832,
        "pinned": 0,
        "elems": 24502,
        "inserts": 25806978,
        "lookups": 150436987,
        "hits": 124629911,
        "misses": 25807076
    }
In default configuration there are 2 sections: "rocksdb-cache-O", "rocksdb-cache-default".

2) admin command
For each cache admin command "rocksdb show cache x" is added.
> ./bin/ceph tell osd.0 rocksdb show cache O
shard  capacity     usage    pinned     elems   inserts   lookups      hits    misses
    0  13631488  11076400         0      2099    136987    822679    685923    136756
    1  13631488  11549712         0      2043    133359    571500    438383    133117
    2  13631488  11060608         0      2232    135076    908468    773313    135155
    3  13631488  11166896         0      2269    134006    427070    293147    133923
    4  13631488  11117984         0      2297    133367    700242    567318    132924
    5  13631488  11306672         0      2155    137501   1130135    991810    138325
    6  13631488  11506512         0      2353    134515    662792    528514    134278
    7  13631488  11093856         0      2316    135348    718971    583421    135550
    8  13631488  11660624         0      2424    137363   1092043    954248    137795
    9  13631488  10962000         0      2561    131982    431702    300467    131235
   10  13631488  11379392         0      1916    134543    477118    342854    134264
   11  13631488  1129427         0      2555    134508    512393    378337    134056
   12  13631488  11277136         0      2079    137312   1131571    993692    137879
   13  13631488  10887776         0      2543    134001    567073    432903    134170
   14  13631488  10986528         0      2394    133288    584452    451018    133434
   15  13631488  11954464         0      2456    134615    708285    573374    134911

3) admin command
" ./bin/ceph tell osd.0 rocksdb reset cache O" clears "inserts",
"lookups", "hits" and "misses"

Signed-off-by: Adam Kupczyk <[email protected]>
(cherry picked from commit cadd4a4)
(contributed as ceph#64819)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants