]> git.proxmox.com Git - ceph.git/blob - ceph/doc/cephfs/cephfs-top.rst
47e80df9d2f14a4062628cc012557a337cb553f7
[ceph.git] / ceph / doc / cephfs / cephfs-top.rst
1 ==================
2 CephFS Top Utility
3 ==================
4
5 CephFS provides `top(1)` like utility to display various Ceph Filesystem metrics
6 in realtime. `cephfs-top` is a curses based python script which makes use of `stats`
7 plugin in Ceph Manager to fetch (and display) metrics.
8
9 Manager Plugin
10 --------------
11
12 Ceph Filesystem clients periodically forward various metrics to Ceph Metadata Servers (MDS)
13 which in turn get forwarded to Ceph Manager by MDS rank zero. Each active MDS forward its
14 respective set of metrics to MDS rank zero. Metrics are aggergated and forwarded to Ceph
15 Manager.
16
17 Metrics are divided into two categories - global and per-mds. Global metrics represent
18 set of metrics for the filesystem as a whole (e.g., client read latency) whereas per-mds
19 metrics are for a particular MDS rank (e.g., number of subtrees handled by an MDS).
20
21 .. note:: Currently, only global metrics are tracked.
22
23 `stats` plugin is disabled by default and should be enabled via::
24
25 $ ceph mgr module enable stats
26
27 Once enabled, Ceph Filesystem metrics can be fetched via::
28
29 $ ceph fs perf stats
30 {"version": 1, "global_counters": ["cap_hit", "read_latency", "write_latency", "metadata_latency", "dentry_lease"], "counters": [], "client_metadata": {"client.614146": {"IP": "10.1.1.100", "hostname" : "ceph-host1", "root": "/", "mount_point": "/mnt/cephfs", "valid_metrics": ["cap_hit", "read_latency", "write_latency", "metadata_latency", "dentry_lease"]}}, "global_metrics": {"client.614146": [[0, 0], [0, 0], [0, 0], [0, 0], [0, 0]]}, "metrics": {"delayed_ranks": [], "mds.0": {"client.614146": []}}}
31
32 Details of the JSON command output are as follows:
33
34 - `version`: Version of stats output
35 - `global_counters`: List of global performance metrics
36 - `counters`: List of per-mds performance metrics
37 - `client_metadata`: Ceph Filesystem client metadata
38 - `global_metrics`: Global performance counters
39 - `metrics`: Per-MDS performance counters (currently, empty) and delayed ranks
40
41 .. note:: `delayed_ranks` is the set of active MDS ranks that are reporting stale metrics.
42 This can happen in cases such as (temporary) network issue between MDS rank zero
43 and other active MDSs.
44
45 Metrics can be fetched for a partcilar client and/or for a set of active MDSs. To fetch metrics
46 for a particular client (e.g., for client-id: 1234)::
47
48 $ ceph fs perf stats --client_id=1234
49
50 To fetch metrics only for a subset of active MDSs (e.g., MDS rank 1 and 2)::
51
52 $ ceph fs perf stats --mds_rank=1,2
53
54 `cephfs-top`
55 ------------
56
57 `cephfs-top` utility relies on `stats` plugin to fetch performance metrics and display in
58 `top(1)` like format. `cephfs-top` is available as part of `cephfs-top` package.
59
60 By default, `cephfs-top` uses `client.fstop` user to connect to a Ceph cluster::
61
62 $ ceph auth get-or-create client.fstop mon 'allow r' mds 'allow r' osd 'allow r' mgr 'allow r'
63 $ cephfs-top
64
65 To use a non-default user (other than `client.fstop`) use::
66
67 $ cephfs-top --id <name>
68
69 By default, `cephfs-top` connects to cluster name `ceph`. To use a non-default cluster name::
70
71 $ cephfs-top --cluster <cluster>
72
73 `cephfs-top` refreshes stats every second by default. To chose a different refresh interval use::
74
75 $ cephfs-top -d <seconds>
76
77 Interval should be greater or equal to 0.5 second. Fractional seconds are honoured.
78
79 Sample screenshot running `cephfs-top` with 2 clients:
80
81 .. image:: cephfs-top.png
82
83 .. note:: As of now, `cephfs-top` does not reliably work with multiple Ceph Filesystems.