Memory profiling is the process of dynamic program analysis to determine a program's memory consumption and identify ways to optimize it. In this recipe, we discuss how you can use memory profilers on the Ceph daemons for memory investigation.
Start the memory profiler on a specific daemon:
# ceph tell osd.0 heap start_profiler
It's a good idea to keep the profiler running for a few hours so that it can collect as much information related to memory footprint as possible. At the same time, you can also generate some load on the cluster.
Next, print heap statistics about the memory footprint that the profiler has collected:
# ceph tell osd.0 heap stats
You can also dump heap stats on a file that can be used later; by default, it will create the dump file as
/var/log/ceph/osd.0.profile.0001.heap
:# ceph tell osd.0 heap dump
To read this...