# Scrub scheduler: jitter and the night window

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

[Interactive lab](lab.html)Scrub scheduler: jitter and the night window
In the book: [Chapter 7](07-cluster-operations.html#sec-07-10-5)
LabScrub scheduler: jitter and the night windowDraw 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.5**target range (days)**6.4 h**mean window delay**8/24**allowed hours per day0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23Blue: 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 optionsA fixed snapshot of the simulator; the interactive version is in the web edition's lab. [Interactive lab: Scrub scheduler: jitter and the night window](lab-scrub.html)The interactive version needs JavaScript; this is a fixed snapshot.
