From: Xiubo Li <xiubli@xxxxxxxxxx> *** Merry Christmas and Happy New Year! *** This will collect the dentry lease and sessions' cap hit/mis metrics. ======= SHOW METRICS IN KCLIENT SIDE ====== You can show this via the "metrics" debugfs, it will look like: $ cat /sys/kernel/debug/ceph/XXX.client4783/metrics item total miss hit ------------------------------------------------- d_lease 131 24 2891 session caps miss hit ------------------------------------------------- 0 54 3 106 1 108 13 3254 ======= SHOW METRICS IN MDS SIDE ======= And if you want to send this metrics stuff to MDS servers, you need to enable it by writing a "1" to sending_metrics debugfs: $ echo 1 > /sys/kernel/debug/ceph/XXX.client4783/sending_metrics And it will send the metric stuff periodically every second. Disabled as default. Then in the MDS we can show this by using: $ ceph mgr module enable stats $ ceph fs perf stats | python -m json.tool { "client_metadata": { "client.4783": { "IP": "v1:192.168.195.165", "hostname": "fedora1", "mount_point": "N/A", "root": "/" } }, "counters": [ "cap_hit" ], "global_counters": [ "read_latency", "write_latency", "metadata_latency" ], "global_metrics": { "client.4783": [ [ 0, 0 ], [ 0, 0 ], [ 0, 0 ] ] }, "metrics": { "delayed_ranks": [], "mds.0": { "client.4783": [ [ 106, 3 ] ] }, "mds.1": { "client.4783": [ [ 3254, 13 ] ] } } } Currently the MDS hasn't support the dentry lease metric showing yet. Xiubo Li (4): ceph: add global dentry lease metric support ceph: add caps perf metric for each session ceph: periodically send cap and dentry lease perf metrics to MDS ceph: add enable/disable sending metrics to MDS debugfs support fs/ceph/acl.c | 2 +- fs/ceph/caps.c | 63 +++++++++--- fs/ceph/debugfs.c | 94 +++++++++++++++++- fs/ceph/dir.c | 38 +++++-- fs/ceph/file.c | 6 +- fs/ceph/inode.c | 8 +- fs/ceph/mds_client.c | 188 +++++++++++++++++++++++++++++++---- fs/ceph/mds_client.h | 15 +++ fs/ceph/snap.c | 2 +- fs/ceph/super.h | 14 ++- fs/ceph/xattr.c | 8 +- include/linux/ceph/ceph_fs.h | 39 ++++++++ 12 files changed, 414 insertions(+), 63 deletions(-) -- 2.21.0