MDS_SLOW_REQUEST: what lowering mds_op_complaint_time changes
Lowering mds_op_complaint_time below 30s makes MDS_SLOW_REQUEST and slow request log lines fire sooner and more often. What the source does, and the undo.
MDS_SLOW_REQUEST 1 MDSs report slow requests mds.fs-01(mds.0): 5 slow requests are blocked > 30 secsThat is the output from the CephFS health messages doc, unchanged (fs-01 is the doc's example name). mds_op_complaint_time is the number after blocked >, and its default is 30. Lower it and a request counts as slow sooner, so the same cluster raises the warning more often. It does not make the MDS faster.
[1] Check the current value first. The default is 30 seconds in both Reef 18.2.4 and Squid 19.2.3 ([Squid 19.2.3 mds.yaml.in L1271-L1279](https://github.com/ceph/ceph/blob/v19.2.3/src/common/options/mds.yaml.in#L1271-L1279), [Reef 18.2.4 mds.yaml.in L1188-L1195](https://github.com/ceph/ceph/blob/v18.2.4/src/common/options/mds.yaml.in#L1188-L1195)).
$ ceph config get mds mds_op_complaint_time$ ceph config help mds_op_complaint_timeThe docs agree. MDS_SLOW_REQUEST appears when any client request takes longer than mds_op_complaint_time (default 30s). Listed causes: the MDS is very slow, RADOS is not acknowledging journal writes promptly, or a bug. To list outstanding metadata operations use ceph daemon mds.<name> ops (same doc, L162-L174).
[2] See where the value is used. In the source it is one threshold. The MDS OpTracker receives it and, among the requests registered with it, counts those older than that as slow. Continuous ops and ops whose warn-interval multiplier is 0 are skipped, not counted ([TrackedOp.cc L389-L399](https://github.com/ceph/ceph/blob/v19.2.3/src/common/TrackedOp.cc#L389-L399), [MDSRank.cc L559](https://github.com/ceph/ceph/blob/v19.2.3/src/mds/MDSRank.cc#L559), [TrackedOp.cc L379-L423](https://github.com/ceph/ceph/blob/v19.2.3/src/common/TrackedOp.cc#L379-L423)). The option is in the list of values the MDS re-reads when they change at runtime, so no restart is indicated ([MDSRank.cc L4113](https://github.com/ceph/ceph/blob/v19.2.3/src/mds/MDSRank.cc#L4113), L4144-L4145).
[3] Separate the three things that change when you lower it.
| What | Behavior seen in the source |
|---|---|
MDS_SLOW_REQUEST warning | If the slow-request count is not zero, the MDS puts N slow requests are blocked > <value> secs in its beacon. A smaller value counts shorter requests ([Beacon.cc L440-L451](https://github.com/ceph/ceph/blob/v19.2.3/src/mds/Beacon.cc#L440-L451)) |
| Cluster log | The same check (check_ops_in_flight) writes a slow request N seconds old, received at … warning per slow request. mds_op_log_threshold (default 5) limits how many show per pass, and an op already reported waits twice as long before the next warning ([MDSRank.cc L3824-L3838](https://github.com/ceph/ceph/blob/v19.2.3/src/mds/MDSRank.cc#L3824-L3838), [TrackedOp.cc L426-L457](https://github.com/ceph/ceph/blob/v19.2.3/src/common/TrackedOp.cc#L426-L457)) |
dump_blocked_ops | The cutoff for "blocked" ops in that command is the same value ([TrackedOp.cc L252](https://github.com/ceph/ceph/blob/v19.2.3/src/common/TrackedOp.cc#L252)) |
The check runs in the MDS periodic tick, and the tick skips it when the connection to the monitors looks laggy ([MDSRank.cc L731-L740](https://github.com/ceph/ceph/blob/v19.2.3/src/mds/MDSRank.cc#L731-L740)). mds_tick_interval defaults to 5 seconds and mds_beacon_interval to 4.
[4] Know what does not change. MDS_SLOW_METADATA_IO ("slow metadata IOs are blocked") uses osd_op_complaint_time (default 30) in the same beacon code, not mds_op_complaint_time ([Beacon.cc L453-L471](https://github.com/ceph/ceph/blob/v19.2.3/src/mds/Beacon.cc#L453-L471), [global.yaml.in L3130-L3136](https://github.com/ceph/ceph/blob/v19.2.3/src/common/options/global.yaml.in#L3130-L3136)). Lowering the MDS value leaves that threshold alone.
[5] Decide before you lower it. What the source supports is "a lower threshold lets more requests cross it". How long a normal request takes differs per cluster, and no source says which value is right. Lower thresholds mean more alerts and real ones can get buried. Decide whether you want earlier warning or you are hunting a latency cause. For the second, leave the value alone and use dump_blocked_ops and dump_historic_ops, which do not change cluster-wide warnings.
[6] If you must change it, apply it to one MDS first and keep the undo ready.
$ ceph config set mds.a mds_op_complaint_time 10$ ceph config get mds.a mds_op_complaint_timeTo undo, remove the entry from the central config. config rm removes only the entry for the target you name (mds.a here), so the value goes back to 30 only if no mds or global entry sets the option too ([config rm definition](https://github.com/ceph/ceph/blob/v19.2.3/src/mon/MonCommands.h#L1385)).
$ ceph config rm mds.a mds_op_complaint_time$ ceph config dump | grep mds_op_complaint_timeIf the last command still prints a line, another level has a setting; run ceph config rm once more for the target shown on that line. config dump lists every entry in the central config (config docs).