{"id":1401,"date":"2026-10-14T22:34:31","date_gmt":"2026-10-14T22:34:31","guid":{"rendered":"https:\/\/virtualserversvps.com\/blog\/?p=1401"},"modified":"2026-10-14T22:34:31","modified_gmt":"2026-10-14T22:34:31","slug":"cron-jitter-drift-systemd-timer-vs-cron-vps","status":"publish","type":"post","link":"https:\/\/virtualserversvps.com\/blog\/cron-jitter-drift-systemd-timer-vs-cron-vps\/","title":{"rendered":"Cron vs systemd Timers: Measuring and Spreading Schedule Jitter on Small VPS Hosts"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">&#8220;Cron runs at the top of the minute&#8221; is the standard explanation for thundering-herd load spikes and missed maintenance windows, but on modern systemd hosts the real behaviour is subtler. Both scheduling mechanisms have drift, jitter, and catch-up semantics that are configurable \u2014 and misconfiguring them turns a harmless nightly backup into a pile-up of every job on the fleet firing within the same second. This article covers the actual timing model of <code>cron<\/code> versus <code>systemd.timer<\/code>, how to measure the jitter you are getting, and how to spread periodic jobs without breaking their correctness guarantees.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Two Different Timing Models<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Classic <code>cron<\/code> is a minute-granularity scheduler: it wakes each minute and runs every job whose five-field expression matches. It has no built-in randomised delay, no per-job jitter, and no native catch-up for missed runs \u2014 if the machine was down or suspended at the matching minute, the job simply does not run until the next match. On a fleet of identically provisioned instances, every host&#8217;s <code>cron<\/code> daemon wakes at the same wall-clock boundary, so <code>0 3 * * *<\/code> jobs all fire at 03:00:00 together.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>systemd.timer<\/code> units are event-driven and expose several timing modifiers that cron lacks:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><code>OnCalendar=<\/code> \u2014 real-time schedule with second granularity, supporting expressions like <code>*-*-* 03:00:00<\/code>.<\/li><li><code>RandomizedDelaySec=<\/code> \u2014 maximum random delay added at each trigger, the native fix for fleet-wide pile-ups.<\/li><li><code>Persistent=true<\/code> \u2014 if a run was missed while the machine was off, run it once on next boot (catch-up).<\/li><li><code>AccuracySec=<\/code> \u2014 how much the timer may defer a trigger to batch wakeups (default 1 minute).<\/li><\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Measuring Actual Jitter and Drift<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Before tuning, measure. Log the real start times your jobs are getting and diff them against the intended schedule:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># systemd: when did a timer last run, and when will it next?\nsystemctl list-timers --all\nsystemctl list-timers --all --no-pager | grep -i backup\n\n# Inspect one timer's resolved schedule and its monotonic info\nsystemctl show myservice.timer -p NextElapseUSecRealtime -p LastTriggerUSec\n\n# cron: confirm daemon cadence in the journal\njournalctl -u cron --since \"1 day ago\" | grep CRON<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Compare the logged start second across hosts. If ten instances all report <code>03:00:00<\/code>, you have the thundering-herd problem. If they scatter across <code>03:00:00<\/code>\u2013<code>03:02:00<\/code>, existing jitter is already spreading the load.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Spreading Load: RandomizedDelaySec and Persistent Together<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The canonical modern pattern is a timer with a fixed calendar anchor, a random delay sized to the acceptable spread, and catch-up enabled:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>[Unit]\nDescription=Nightly database backup\n\n[Timer]\nOnCalendar=*-*-* 03:00:00\nRandomizedDelaySec=30m\nPersistent=true\nAccuracySec=1s\nUnit=dbbackup.service\n\n[Install]\nWantedBy=timers.target<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><code>RandomizedDelaySec=30m<\/code> scatters triggers across a 30-minute window from the 03:00 anchor, which collapses peak concurrent load without changing the schedule&#8217;s guarantee that the job runs once per night. Set it large enough to matter (15\u201360 minutes for fleet jobs) but never so large it pushes the job into a busier window. <code>Persistent=true<\/code> restores the cron feature people miss most \u2014 a missed run executing once on the next boot instead of being silently skipped.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Getting Jitter in cron Without Abandoning It<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">If you must stay on cron, add randomised sleep inside the job wrapper. This preserves the minute-level schedule while de-correlating execution:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># \/etc\/cron.d\/nightly-backup \u2014 spread start over up to 30 minutes (1800s)\nSHELL=\/bin\/bash\n0 3 * * * root sleep $((RANDOM \\% 1800)) &amp;&amp; \/usr\/local\/bin\/backup.sh &gt;&gt; \/var\/log\/backup.log 2&gt;&amp;1<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">The sleep approach costs one idle process per host but requires no timer units and works on any cron implementation. For truly bursty work, combine the random sleep with a lock (<code>flock<\/code>) so overlapping runs cannot corrupt state, and consider staggering by host index rather than pure random if you want a deterministic spread:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># Deterministic stagger using a stable host identifier\n# Hosts with different hostnames map to different offsets in a 1800s window\nOFFSET=$(( $(hostname | cksum | cut -d' ' -f1) % 1800 ))\nsleep \"$OFFSET\"\n\/usr\/local\/bin\/backup.sh<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Common Jitter Pitfalls<\/h2>\n\n\n\n<ul class=\"wp-block-list\"><li><strong>AccuracySec too large with tight schedules.<\/strong> The default 1-minute accuracy lets systemd defer a trigger; on a 1-minute schedule this can merge or skip runs. Set <code>AccuracySec=1s<\/code> for tight cadences.<\/li><li><strong>Persistent with short intervals.<\/strong> A 5-minute timer with <code>Persistent=true<\/code> runs only once after boot even if hours were missed \u2014 do not assume it replays every missed interval.<\/li><li><strong>Timezone drift.<\/strong> Both systems schedule in local time; a host with the wrong TZ fires jobs at the wrong wall-clock hour. Pin with <code>OnCalendar=... UTC<\/code> for fleet consistency.<\/li><li><strong>Overlapping runs.<\/strong> Randomised start times can cause a slow job to overlap the next scheduled run; always wrap mutating jobs in a lock.<\/li><\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Choosing Per Job, Not Per Host<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Backups, log rotation, certificate renewals, and monitoring polls have different tolerance for drift and different consequences of overlap. Schedule watchful jobs (health checks) at tight, jittered intervals with <code>AccuracySec=1s<\/code> and no <code>Persistent<\/code>; schedule heavy maintenance jobs with a fixed anchor, generous <code>RandomizedDelaySec<\/code>, and <code>Persistent=true<\/code>. Document each timer&#8217;s intent so a future operator does not &#8220;fix&#8221; the random delay that is holding the fleet load smooth.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">When you provision fleets of small instances for this kind of periodic work, timing behaviour is as important as CPU and RAM \u2014 the <a href=\"https:\/\/virtualserversvps.com\/\">core VPS configuration guides<\/a> cover sizing instances for scheduled and burst workloads, and our <a href=\"https:\/\/virtualserversvps.com\/managed-vs-unmanaged\">managed versus self-managed hosting comparison<\/a> explains where automated scheduling is handled for you rather than tuned by hand.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>&#8220;Cron runs at the top of the minute&#8221; is the standard explanation for thundering-herd load spikes and missed maintenance windows, but on modern systemd hosts the real behaviour is subtler&#8230;.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"iawp_total_views":1,"footnotes":""},"categories":[1],"tags":[],"class_list":["post-1401","post","type-post","status-publish","format-standard","hentry","category-vps-guides-tutorials"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v26.1 (Yoast SEO v26.1) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Cron vs systemd Timers: Measuring and Spreading Schedule Jitter on Small VPS Hosts - Virtual Servers VPS Blog<\/title>\n<meta name=\"description\" content=\"&quot;Cron runs at the top of the minute&quot; is the standard explanation for thundering-herd load spikes and missed maintenance windows, but on modern systemd\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/virtualserversvps.com\/blog\/cron-jitter-drift-systemd-timer-vs-cron-vps\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Cron vs systemd Timers: Measuring and Spreading Schedule Jitter on Small VPS Hosts\" \/>\n<meta property=\"og:description\" content=\"Cron vs systemd Timers: Measuring and Spreading Schedule Jitter on Small VPS Hosts\" \/>\n<meta property=\"og:url\" content=\"https:\/\/virtualserversvps.com\/blog\/cron-jitter-drift-systemd-timer-vs-cron-vps\/\" \/>\n<meta property=\"og:site_name\" content=\"Virtual Servers VPS Blog\" \/>\n<meta property=\"article:published_time\" content=\"2026-10-14T22:34:31+00:00\" \/>\n<meta name=\"author\" content=\"Virtual-Servers-Vps-Editor\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Virtual-Servers-Vps-Editor\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/virtualserversvps.com\/blog\/cron-jitter-drift-systemd-timer-vs-cron-vps\/\",\"url\":\"https:\/\/virtualserversvps.com\/blog\/cron-jitter-drift-systemd-timer-vs-cron-vps\/\",\"name\":\"Cron vs systemd Timers: Measuring and Spreading Schedule Jitter on Small VPS Hosts - Virtual Servers VPS Blog\",\"isPartOf\":{\"@id\":\"https:\/\/virtualserversvps.com\/blog\/#website\"},\"datePublished\":\"2026-10-14T22:34:31+00:00\",\"author\":{\"@id\":\"https:\/\/virtualserversvps.com\/blog\/#\/schema\/person\/82a299a8284a66ff49f97c74684724a0\"},\"description\":\"\\\"Cron runs at the top of the minute\\\" is the standard explanation for thundering-herd load spikes and missed maintenance windows, but on modern systemd\",\"breadcrumb\":{\"@id\":\"https:\/\/virtualserversvps.com\/blog\/cron-jitter-drift-systemd-timer-vs-cron-vps\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/virtualserversvps.com\/blog\/cron-jitter-drift-systemd-timer-vs-cron-vps\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/virtualserversvps.com\/blog\/cron-jitter-drift-systemd-timer-vs-cron-vps\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/virtualserversvps.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Cron vs systemd Timers: Measuring and Spreading Schedule Jitter on Small VPS Hosts\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/virtualserversvps.com\/blog\/#website\",\"url\":\"https:\/\/virtualserversvps.com\/blog\/\",\"name\":\"Virtual Servers VPS Blog\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/virtualserversvps.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/virtualserversvps.com\/blog\/#\/schema\/person\/82a299a8284a66ff49f97c74684724a0\",\"name\":\"Virtual-Servers-Vps-Editor\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/virtualserversvps.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/d820b15f1cd028e97610d9adf536df7be5cb6423869967037d468d5355fa003f?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/d820b15f1cd028e97610d9adf536df7be5cb6423869967037d468d5355fa003f?s=96&d=mm&r=g\",\"caption\":\"Virtual-Servers-Vps-Editor\"},\"sameAs\":[\"https:\/\/virtualserversvps.com\/blog\"],\"url\":\"https:\/\/virtualserversvps.com\/blog\/author\/virtualserversvps\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Cron vs systemd Timers: Measuring and Spreading Schedule Jitter on Small VPS Hosts - Virtual Servers VPS Blog","description":"\"Cron runs at the top of the minute\" is the standard explanation for thundering-herd load spikes and missed maintenance windows, but on modern systemd","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/virtualserversvps.com\/blog\/cron-jitter-drift-systemd-timer-vs-cron-vps\/","og_locale":"en_US","og_type":"article","og_title":"Cron vs systemd Timers: Measuring and Spreading Schedule Jitter on Small VPS Hosts","og_description":"Cron vs systemd Timers: Measuring and Spreading Schedule Jitter on Small VPS Hosts","og_url":"https:\/\/virtualserversvps.com\/blog\/cron-jitter-drift-systemd-timer-vs-cron-vps\/","og_site_name":"Virtual Servers VPS Blog","article_published_time":"2026-10-14T22:34:31+00:00","author":"Virtual-Servers-Vps-Editor","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Virtual-Servers-Vps-Editor","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/virtualserversvps.com\/blog\/cron-jitter-drift-systemd-timer-vs-cron-vps\/","url":"https:\/\/virtualserversvps.com\/blog\/cron-jitter-drift-systemd-timer-vs-cron-vps\/","name":"Cron vs systemd Timers: Measuring and Spreading Schedule Jitter on Small VPS Hosts - Virtual Servers VPS Blog","isPartOf":{"@id":"https:\/\/virtualserversvps.com\/blog\/#website"},"datePublished":"2026-10-14T22:34:31+00:00","author":{"@id":"https:\/\/virtualserversvps.com\/blog\/#\/schema\/person\/82a299a8284a66ff49f97c74684724a0"},"description":"\"Cron runs at the top of the minute\" is the standard explanation for thundering-herd load spikes and missed maintenance windows, but on modern systemd","breadcrumb":{"@id":"https:\/\/virtualserversvps.com\/blog\/cron-jitter-drift-systemd-timer-vs-cron-vps\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/virtualserversvps.com\/blog\/cron-jitter-drift-systemd-timer-vs-cron-vps\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/virtualserversvps.com\/blog\/cron-jitter-drift-systemd-timer-vs-cron-vps\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/virtualserversvps.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Cron vs systemd Timers: Measuring and Spreading Schedule Jitter on Small VPS Hosts"}]},{"@type":"WebSite","@id":"https:\/\/virtualserversvps.com\/blog\/#website","url":"https:\/\/virtualserversvps.com\/blog\/","name":"Virtual Servers VPS Blog","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/virtualserversvps.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/virtualserversvps.com\/blog\/#\/schema\/person\/82a299a8284a66ff49f97c74684724a0","name":"Virtual-Servers-Vps-Editor","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/virtualserversvps.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/d820b15f1cd028e97610d9adf536df7be5cb6423869967037d468d5355fa003f?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/d820b15f1cd028e97610d9adf536df7be5cb6423869967037d468d5355fa003f?s=96&d=mm&r=g","caption":"Virtual-Servers-Vps-Editor"},"sameAs":["https:\/\/virtualserversvps.com\/blog"],"url":"https:\/\/virtualserversvps.com\/blog\/author\/virtualserversvps\/"}]}},"_links":{"self":[{"href":"https:\/\/virtualserversvps.com\/blog\/wp-json\/wp\/v2\/posts\/1401","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/virtualserversvps.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/virtualserversvps.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/virtualserversvps.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/virtualserversvps.com\/blog\/wp-json\/wp\/v2\/comments?post=1401"}],"version-history":[{"count":1,"href":"https:\/\/virtualserversvps.com\/blog\/wp-json\/wp\/v2\/posts\/1401\/revisions"}],"predecessor-version":[{"id":1403,"href":"https:\/\/virtualserversvps.com\/blog\/wp-json\/wp\/v2\/posts\/1401\/revisions\/1403"}],"wp:attachment":[{"href":"https:\/\/virtualserversvps.com\/blog\/wp-json\/wp\/v2\/media?parent=1401"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/virtualserversvps.com\/blog\/wp-json\/wp\/v2\/categories?post=1401"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/virtualserversvps.com\/blog\/wp-json\/wp\/v2\/tags?post=1401"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}