Skip to content

rgw: add tcmalloc heap profiler support via admin socket - #67446

Merged
mkogan1 merged 1 commit into
ceph:mainfrom
VinayakTiwari1103:rgw-tcmalloc-heap-profiler
Aug 5, 2026
Merged

mkogan1 merged 1 commit into
ceph:mainfrom
VinayakTiwari1103:rgw-tcmalloc-heap-profiler

Conversation

@VinayakTiwari1103

Copy link
Copy Markdown
Contributor

rgw: add tcmalloc heap profiler support via admin socket

Add RGWHeapProfilerHook to rgw_appmain.cc that registers a "heap" admin socket command, forwarding subcommands to the shared ceph_heap_profiler_handle_command() implementation. This enables heap stats, start_profiler, stop_profiler, dump, release, and release rate commands for RGW via "ceph daemon heap ".

Link radosgw against heap_profiler library, update memory-profiling documentation, and add an integration test script.

Signed-off-by: Vinayak Tiwari [email protected]

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

You must only issue one Jenkins command per-comment. Jenkins does not understand
comments with more than one command.

@ceph-jenkins

Copy link
Copy Markdown
Collaborator

Can one of the admins verify this patch?

13 similar comments
@ceph-jenkins

Copy link
Copy Markdown
Collaborator

Can one of the admins verify this patch?

@ceph-jenkins

Copy link
Copy Markdown
Collaborator

Can one of the admins verify this patch?

@ceph-jenkins

Copy link
Copy Markdown
Collaborator

Can one of the admins verify this patch?

@ceph-jenkins

Copy link
Copy Markdown
Collaborator

Can one of the admins verify this patch?

@ceph-jenkins

Copy link
Copy Markdown
Collaborator

Can one of the admins verify this patch?

@ceph-jenkins

Copy link
Copy Markdown
Collaborator

Can one of the admins verify this patch?

@ceph-jenkins

Copy link
Copy Markdown
Collaborator

Can one of the admins verify this patch?

@ceph-jenkins

Copy link
Copy Markdown
Collaborator

Can one of the admins verify this patch?

@ceph-jenkins

Copy link
Copy Markdown
Collaborator

Can one of the admins verify this patch?

@ceph-jenkins

Copy link
Copy Markdown
Collaborator

Can one of the admins verify this patch?

@ceph-jenkins

Copy link
Copy Markdown
Collaborator

Can one of the admins verify this patch?

@ceph-jenkins

Copy link
Copy Markdown
Collaborator

Can one of the admins verify this patch?

@ceph-jenkins

Copy link
Copy Markdown
Collaborator

Can one of the admins verify this patch?

@yuvalif

yuvalif commented Feb 20, 2026

Copy link
Copy Markdown
Contributor

@mkogan1 is the test script running as part of teuthology or just for local tests using vstart?

@mkogan1

mkogan1 commented Feb 22, 2026

Copy link
Copy Markdown
Contributor

@mkogan1 is the test script running as part of teuthology or just for local tests using vstart?

IDK, have not tried to cherry-pick and run yet, forwarding Q to @VinayakTiwari1103
(clicked on the make-check approval, let's see if compiles...)

@VinayakTiwari1103

Copy link
Copy Markdown
Contributor Author

@mkogan1 is the test script running as part of teuthology or just for local tests using vstart?

IDK, have not tried to cherry-pick and run yet, forwarding Q to @VinayakTiwari1103 (clicked on the make-check approval, let's see if compiles...)

Currently the script is for local testing with vstart.

@yuvalif

yuvalif commented Feb 22, 2026

Copy link
Copy Markdown
Contributor

@mkogan1 is the test script running as part of teuthology or just for local tests using vstart?

IDK, have not tried to cherry-pick and run yet, forwarding Q to @VinayakTiwari1103 (clicked on the make-check approval, let's see if compiles...)

Currently the script is for local testing with vstart.

then it should be under src/test/rgw stuff undet qa is expected to run in teuthology

@VinayakTiwari1103

Copy link
Copy Markdown
Contributor Author

@mkogan1 is the test script running as part of teuthology or just for local tests using vstart?

IDK, have not tried to cherry-pick and run yet, forwarding Q to @VinayakTiwari1103 (clicked on the make-check approval, let's see if compiles...)

Currently the script is for local testing with vstart.

then it should be under src/test/rgw stuff undet qa is expected to run in teuthology

Makes sense. I'll wire it into a teuthology suite yaml so it runs as part of teuthology. Would qa/suites/rgw/verify/tasks/cls.yaml be the right place to add it (alongside the other rgw workunits like test_rgw_gc_log.sh)?

@mkogan1

mkogan1 commented Feb 23, 2026

Copy link
Copy Markdown
Contributor

confirming the implementation in this PR works:

❯ sudo ./bin/ceph daemon 'client.rgw.8000' heap stats
client.rgw.8000 tcmalloc heap stats:------------------------------------------------
MALLOC:       54238064 (   51.7 MiB) Bytes in use by application
MALLOC: +     19218432 (   18.3 MiB) Bytes in page heap freelist
MALLOC: +       437072 (    0.4 MiB) Bytes in central cache freelist
MALLOC: +      2951936 (    2.8 MiB) Bytes in transfer cache freelist
MALLOC: +      2477632 (    2.4 MiB) Bytes in thread cache freelists
MALLOC: +      2883584 (    2.8 MiB) Bytes in malloc metadata
MALLOC:   ------------
MALLOC: =     82206720 (   78.4 MiB) Actual memory used (physical + swap)
MALLOC: +            0 (    0.0 MiB) Bytes released to OS (aka unmapped)
MALLOC:   ------------
MALLOC: =     82206720 (   78.4 MiB) Virtual address space used
MALLOC:
MALLOC:            692              Spans in use
MALLOC:             85              Thread heaps in use
MALLOC:           8192              Tcmalloc page size
------------------------------------------------
Call ReleaseFreeMemory() to release freelist memory to the OS (via madvise()).
Bytes released to the OS take up virtual address space but no physical memory.

@yuvalif

yuvalif commented Feb 23, 2026

Copy link
Copy Markdown
Contributor

@mkogan1 is the test script running as part of teuthology or just for local tests using vstart?

IDK, have not tried to cherry-pick and run yet, forwarding Q to @VinayakTiwari1103 (clicked on the make-check approval, let's see if compiles...)

Currently the script is for local testing with vstart.

then it should be under src/test/rgw stuff undet qa is expected to run in teuthology

Makes sense. I'll wire it into a teuthology suite yaml so it runs as part of teuthology. Would qa/suites/rgw/verify/tasks/cls.yaml be the right place to add it (alongside the other rgw workunits like test_rgw_gc_log.sh)?

i think it would be better to add it here: https://github.com/ceph/ceph/blob/main/qa/suites/rgw/tools/tasks.yaml

  • the "verify" suite is only for most basic functionality
  • "cls" is rgwe code that runs against the cluster without an actual rgw

@github-actions

Copy link
Copy Markdown

This pull request can no longer be automatically merged: a rebase is needed and changes have to be manually resolved

@mkogan1
mkogan1 force-pushed the rgw-tcmalloc-heap-profiler branch from 4664b23 to d704fe0 Compare July 26, 2026 11:32
Copilot AI review requested due to automatic review settings July 26, 2026 11:32

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Copilot AI review requested due to automatic review settings July 26, 2026 12:05
@mkogan1
mkogan1 force-pushed the rgw-tcmalloc-heap-profiler branch from d704fe0 to 3bae386 Compare July 26, 2026 12:05

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Add RGWHeapProfilerHook to rgw_appmain.cc that registers a "heap" admin
socket command, forwarding subcommands to the shared
ceph_heap_profiler_handle_command() implementation. This enables heap
stats, start_profiler, stop_profiler, dump, release, and release rate
commands for RGW via "ceph daemon heap ".

Link radosgw against heap_profiler library, update memory-profiling
documentation, and add an integration test script.

Signed-off-by: Vinayak Tiwari <[email protected]>

Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <[email protected]>
Co-authored-by: Mark Kogan <[email protected]>
Copilot AI review requested due to automatic review settings July 29, 2026 07:40
@mkogan1
mkogan1 force-pushed the rgw-tcmalloc-heap-profiler branch from 3bae386 to 6d8851a Compare July 29, 2026 07:40

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@mkogan1

mkogan1 commented Aug 2, 2026

Copy link
Copy Markdown
Contributor

jenkins test make check

@mkogan1

mkogan1 commented Aug 2, 2026

Copy link
Copy Markdown
Contributor

jenkins test make check arm64

@mkogan1

mkogan1 commented Aug 2, 2026

Copy link
Copy Markdown
Contributor

jenkins test signed

@mkogan1

mkogan1 commented Aug 2, 2026

Copy link
Copy Markdown
Contributor

jenkins test submodules

@mkogan1

mkogan1 commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

@cbodley @yuvalif hi, Teuthology is passing OK, and all checks are green - any objection to merging at this time?

@yuvalif

yuvalif commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

@cbodley @yuvalif hi, Teuthology is passing OK, and all checks are green - any objection to merging at this time?

No objections on my end

@mkogan1

mkogan1 commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

@adamemerson @anrao19 thanks,

teuthology passed PTAL at comment above
#67446 (comment)
image

any objections to press the merge button?

@mkogan1
mkogan1 merged commit 21e495a into ceph:main Aug 5, 2026
6 checks passed
@mkogan1 mkogan1 mentioned this pull request Nov 29, 2026
5 of 14 tasks
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.