# mClock profiles: client, recovery and background shares

*HTML: https://book.ceph-s3.ir/en/lab-mclock.html*
*Licence: CC BY-NC-SA 4.0. Author: Ramin Najarbashi.*

[Interactive lab](lab.html)mClock profiles: client, recovery and background shares
In the book: [Chapter 7](07-cluster-operations.html#sec-07-10-3)
LabmClock profiles: client, recovery and background sharesPick the device, the profile and each class's load, and see how one OSD queue shard splits its capacity between clients, recovery and background work such as scrub, and why a 4 KiB op on an HDD is charged like half a megabyte.**150 / 300**client IOPS (served / wanted)**71.43 MiB/s**recovery throughput**487.62 KiB**cost_per_io (minimum cost)**100.0%**capacity usedClient Recovery Best effort (scrub, …) · faint bar: demand · solid bar: share · black line: reservation · dashed line: limitreswgtlimCost per opOps/s wantedOps/s servedShare of the shardClient50.0%1∞487.62 KiB30015047.6%Recovery50.0%1∞4 MiB301847.6%Best effort (scrub, …)5.0%290.0%4 MiB1024.8%The reservations in use add up to more than the capacity (in high_client_ops they sum to 105%), so only the reservation phase runs and each class gets a share in proportion to its reservation.cost_per_io = 150 MiB / 315 IOPS = 499322 B · capacity_per_shard = 150 MiB / 1 shard(s) · op cost = max(size, cost_per_io) · share = min(demand, lim, max(res, wgt × λ))Replace the IOPS with your device's real figure (the osd bench result): if it is too high, cost_per_io shrinks, mClock thinks small ops are cheap and the shares stop protecting clients. To speed up recovery after a failure, switch to high_recovery_ops for a while and then switch back (chapter 7).Follows:`src/common/mclock_common.h :: HIGH_CLIENT_OPS, HIGH_RECOVERY_OPS, BALANCED` The three profiles' values`src/common/mclock_common.cc :: ClientRegistry::update_from_profile, MclockConfig::set_from_config, calc_scaled_cost` Ratios to bytes/s and the cost of one op`src/dmclock/src/dmclock_server.h :: PullPriorityQueue::pull_request, reduce_reservation_tags` The dmClock scheduler`src/common/options/osd.yaml.in :: osd_mclock_max_capacity_iops_*, osd_mclock_max_sequential_bandwidth_*, osd_op_num_shards_*` Capacity and shard optionsA fixed snapshot of the simulator; the interactive version is in the web edition's lab. [Interactive lab: mClock profiles: client, recovery and background shares](lab-mclock.html)The interactive version needs JavaScript; this is a fixed snapshot.
