The Comprehensive Ceph Guide
فارسیGet started

Scrub scheduler: jitter and the night window

In the book: Chapter 7

Lab

Scrub scheduler: jitter and the night window

Draw scrub times for a group of PGs and see how the allowed-hour window delays them; compare uniform shallow jitter with the clipped normal distribution of deep scrubs.

1–1.5target range (days)
6.4 hmean window delay
8/24allowed hours per day
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
0d1d2d

Blue: randomized target · orange: first allowed time; the joining line is the window delay. Faint hours are outside the window; hours use the OSD's local time. Ceph's default start and end are 0 and 0 (all day); this lab starts with a 22–6 window.

delay = interval × (1 + ratio × U[0,1))

osd_scrub_max_interval is not the randomized target; PG_NOT_SCRUBBED is not raised immediately after the target either. A successful deep scrub also updates last_scrub_stamp.

Follows:

  • src/osd/scrubber/scrub_job.cc :: adjust_shallow_schedule, adjust_deep_schedule Target-time distributions
  • src/osd/scrubber/osd_scrub.cc :: isbetween_modulo, scrub_time_permit Half-open hour windows
  • src/common/options/osd.yaml.in :: osd_scrub_* Scheduling options
A fixed snapshot of the simulator; the interactive version is in the web edition's lab. Interactive lab: Scrub scheduler: jitter and the night window