{"id":1246,"date":"2026-09-28T23:06:15","date_gmt":"2026-09-28T23:06:15","guid":{"rendered":"https:\/\/virtualserversvps.com\/blog\/?p=1246"},"modified":"2026-10-05T22:02:28","modified_gmt":"2026-10-05T22:02:28","slug":"systemd-timer-oncalendar-persistent-replay-randomizeddelaysec","status":"publish","type":"post","link":"https:\/\/virtualserversvps.com\/blog\/systemd-timer-oncalendar-persistent-replay-randomizeddelaysec\/","title":{"rendered":"systemd Timer OnCalendar Accuracy: Replay Storms, AccuracySec and RandomizedDelaySec on Small Hosts"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">On a single-vCPU or 1&nbsp;GB VPS, a misconfigured <code>OnCalendar<\/code> expression combined with <code>Persistent=true<\/code> can fire dozens of jobs simultaneously the moment the host boots after downtime. systemd replays every missed activation it recorded in <code>\/var\/lib\/systemd\/timers\/<\/code>, and if those timers also share an <code>OnCalendar<\/code> boundary, they collide on the same wall-clock instant. The result looks like a random load spike minutes after boot that nobody scheduled. This article shows how to observe, measure and fix that behaviour without disabling the timers you actually depend on.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">See what the timer is really doing<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Before editing anything, read the state systemd already keeps. Every persistent timer records its last trigger in a stamp file, and <code>list-timers<\/code> projects the next elapse for you:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>systemctl list-timers --all --no-pager\nsystemctl status myapp-backup.timer\nstat \/var\/lib\/systemd\/timers\/myapp-backup.timer\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">The <code>LEFT<\/code> and <code>LAST<\/code> columns matter most. If <code>LAST<\/code> is stale but <code>NEXT<\/code> is seconds away after a reboot, you are about to experience a replay. The mtime of the stamp file is the exact instant systemd last honoured the timer &mdash; a useful ground truth when unit logs are noisy.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Why a replay storm happens<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">With <code>Persistent=true<\/code>, systemd compares the current time to the stamp file. If activations were missed, it runs the unit <strong>once<\/strong> immediately &mdash; not once per missed interval. That single replay is usually desirable for backups. The storm arrives when you have many timers whose schedule anchors on the same minute. On a 1&nbsp;GB host, ten backups plus log maintenance jobs waking in the same second saturate both CPU and disk queue depth, and the OOM killer or I\/O stall that follows is frequently misdiagnosed as a kernel bug.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Two directives control the spread:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>AccuracySec=<\/code> lets systemd coalesce timers onto the same wakeup. The default is 1 minute, which is <em>why<\/em> co-scheduled jobs bunch up. Set it to a value that represents your real tolerance &mdash; <code>0<\/code> for precise work, larger to let the system batch wakeups and save idle power.<\/li>\n<li><code>RandomizedDelaySec=<\/code> adds a random offset up to the given value. This is the single most effective anti-collision knob. A <code>RandomizedDelaySec=900<\/code> spreads a fleet of hourly jobs across a fifteen-minute window.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">A worked example<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Consider a database dump that should run nightly but must not stampede with other maintenance. The unit that storms looks like this:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>[Unit]\nDescription=Nightly database dump\n\n[Timer]\nOnCalendar=*-*-* 02:00:00\nPersistent=true\n\n[Install]\nWantedBy=timers.target\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">The hardened version separates precision from collision avoidance. We keep the wall-clock anchor but give systemd permission to drift the actual start:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>[Timer]\nOnCalendar=*-*-* 02:00:00\nPersistent=true\nAccuracySec=1s\nRandomizedDelaySec=1800\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Now the dump fires somewhere in the 02:00&ndash;02:30 window. Backups stay inside their retention envelope while the disk sees one write stream instead of many. After editing, reload and confirm the new schedule:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>systemctl daemon-reload\nsystemctl restart myapp-backup.timer\nsystemctl list-timers myapp-backup.timer --no-pager\n<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Verifying the spread empirically<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Do not trust the config &mdash; watch the actual trigger times. The unit&#8217;s own journal records when it started, and you can extract the delta between consecutive runs to prove the randomisation is working:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>journalctl -u myapp-backup.service --since \"7 days ago\" -o short-iso | grep -i Started\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">If every line shows the same <code>02:00:00<\/code> timestamp, <code>RandomizedDelaySec<\/code> is not taking effect &mdash; usually because the timer was reloaded without a <code>daemon-reload<\/code>, or because the drop-in is shadowed by a later unit file. Run <code>systemctl cat myapp-backup.timer<\/code> to see the merged result and confirm which file wins.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Transient timers for one-shot maintenance<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">For an ad-hoc job you do not want to persist to disk, <code>systemd-run<\/code> accepts the same scheduling syntax and is ideal for a deferred, randomised reboot or scrub on a production box:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>systemd-run --on-calendar=\"*-*-* 03:00:00\" --timer-property=RandomizedDelaySec=1200 \\\n  \/usr\/local\/bin\/fstrim-all\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">This creates a transient timer that disappears after it fires, so it cannot silently survive a reboot and replay weeks later.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Putting it together during a boot storm<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">If you are diagnosing an unexplained post-reboot spike right now, the fastest path is to correlate timer replays with resource pressure. On a host already starved for memory, the extra replay load is exactly the kind of pressure that <a href=\"https:\/\/virtualserversvps.com\/\">a well-sized virtual server<\/a> is meant to absorb &mdash; but sizing cannot fix a schedule that deliberately synchronises every job. Combine <code>list-timers<\/code>, the stamp-file mtimes and the unit journal to name the culprit, then apply <code>RandomizedDelaySec<\/code> and re-measure.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The principles here &mdash; observe before tuning, spread contention, verify empirically &mdash; are the same ones behind <a href=\"https:\/\/virtualserversvps.com\/\">premium cloud solutions<\/a> that keep maintenance windows predictable on small instances. A timer is cheap to configure; an unmanaged replay storm on a 1&nbsp;GB VPS is not.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>How systemd Persistent timers replay missed activations on small VPS hosts, why co-scheduled OnCalendar jobs storm after reboot, and how AccuracySec and RandomizedDelaySec spread the load.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"iawp_total_views":4,"footnotes":""},"categories":[1],"tags":[],"class_list":["post-1246","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>systemd Timer OnCalendar Accuracy: Replay Storms, AccuracySec and RandomizedDelaySec on Small Hosts - Virtual Servers VPS Blog<\/title>\n<meta name=\"description\" content=\"How systemd Persistent timers replay missed activations on small VPS hosts, why co-scheduled OnCalendar jobs storm after reboot, and how AccuracySec and RandomizedDelaySec spread the load.\" \/>\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\/systemd-timer-oncalendar-persistent-replay-randomizeddelaysec\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"systemd Timer OnCalendar Accuracy: Replay Storms, AccuracySec and RandomizedDelaySec on Small Hosts\" \/>\n<meta property=\"og:description\" content=\"systemd Timer OnCalendar Accuracy: Replay Storms, AccuracySec and RandomizedDelaySec on Small Hosts\" \/>\n<meta property=\"og:url\" content=\"https:\/\/virtualserversvps.com\/blog\/systemd-timer-oncalendar-persistent-replay-randomizeddelaysec\/\" \/>\n<meta property=\"og:site_name\" content=\"Virtual Servers VPS Blog\" \/>\n<meta property=\"article:published_time\" content=\"2026-09-28T23:06:15+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-10-05T22:02:28+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\/systemd-timer-oncalendar-persistent-replay-randomizeddelaysec\/\",\"url\":\"https:\/\/virtualserversvps.com\/blog\/systemd-timer-oncalendar-persistent-replay-randomizeddelaysec\/\",\"name\":\"systemd Timer OnCalendar Accuracy: Replay Storms, AccuracySec and RandomizedDelaySec on Small Hosts - Virtual Servers VPS Blog\",\"isPartOf\":{\"@id\":\"https:\/\/virtualserversvps.com\/blog\/#website\"},\"datePublished\":\"2026-09-28T23:06:15+00:00\",\"dateModified\":\"2026-10-05T22:02:28+00:00\",\"author\":{\"@id\":\"https:\/\/virtualserversvps.com\/blog\/#\/schema\/person\/82a299a8284a66ff49f97c74684724a0\"},\"description\":\"How systemd Persistent timers replay missed activations on small VPS hosts, why co-scheduled OnCalendar jobs storm after reboot, and how AccuracySec and RandomizedDelaySec spread the load.\",\"breadcrumb\":{\"@id\":\"https:\/\/virtualserversvps.com\/blog\/systemd-timer-oncalendar-persistent-replay-randomizeddelaysec\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/virtualserversvps.com\/blog\/systemd-timer-oncalendar-persistent-replay-randomizeddelaysec\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/virtualserversvps.com\/blog\/systemd-timer-oncalendar-persistent-replay-randomizeddelaysec\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/virtualserversvps.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"systemd Timer OnCalendar Accuracy: Replay Storms, AccuracySec and RandomizedDelaySec on Small 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":"systemd Timer OnCalendar Accuracy: Replay Storms, AccuracySec and RandomizedDelaySec on Small Hosts - Virtual Servers VPS Blog","description":"How systemd Persistent timers replay missed activations on small VPS hosts, why co-scheduled OnCalendar jobs storm after reboot, and how AccuracySec and RandomizedDelaySec spread the load.","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\/systemd-timer-oncalendar-persistent-replay-randomizeddelaysec\/","og_locale":"en_US","og_type":"article","og_title":"systemd Timer OnCalendar Accuracy: Replay Storms, AccuracySec and RandomizedDelaySec on Small Hosts","og_description":"systemd Timer OnCalendar Accuracy: Replay Storms, AccuracySec and RandomizedDelaySec on Small Hosts","og_url":"https:\/\/virtualserversvps.com\/blog\/systemd-timer-oncalendar-persistent-replay-randomizeddelaysec\/","og_site_name":"Virtual Servers VPS Blog","article_published_time":"2026-09-28T23:06:15+00:00","article_modified_time":"2026-10-05T22:02:28+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\/systemd-timer-oncalendar-persistent-replay-randomizeddelaysec\/","url":"https:\/\/virtualserversvps.com\/blog\/systemd-timer-oncalendar-persistent-replay-randomizeddelaysec\/","name":"systemd Timer OnCalendar Accuracy: Replay Storms, AccuracySec and RandomizedDelaySec on Small Hosts - Virtual Servers VPS Blog","isPartOf":{"@id":"https:\/\/virtualserversvps.com\/blog\/#website"},"datePublished":"2026-09-28T23:06:15+00:00","dateModified":"2026-10-05T22:02:28+00:00","author":{"@id":"https:\/\/virtualserversvps.com\/blog\/#\/schema\/person\/82a299a8284a66ff49f97c74684724a0"},"description":"How systemd Persistent timers replay missed activations on small VPS hosts, why co-scheduled OnCalendar jobs storm after reboot, and how AccuracySec and RandomizedDelaySec spread the load.","breadcrumb":{"@id":"https:\/\/virtualserversvps.com\/blog\/systemd-timer-oncalendar-persistent-replay-randomizeddelaysec\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/virtualserversvps.com\/blog\/systemd-timer-oncalendar-persistent-replay-randomizeddelaysec\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/virtualserversvps.com\/blog\/systemd-timer-oncalendar-persistent-replay-randomizeddelaysec\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/virtualserversvps.com\/blog\/"},{"@type":"ListItem","position":2,"name":"systemd Timer OnCalendar Accuracy: Replay Storms, AccuracySec and RandomizedDelaySec on Small 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\/1246","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=1246"}],"version-history":[{"count":3,"href":"https:\/\/virtualserversvps.com\/blog\/wp-json\/wp\/v2\/posts\/1246\/revisions"}],"predecessor-version":[{"id":1303,"href":"https:\/\/virtualserversvps.com\/blog\/wp-json\/wp\/v2\/posts\/1246\/revisions\/1303"}],"wp:attachment":[{"href":"https:\/\/virtualserversvps.com\/blog\/wp-json\/wp\/v2\/media?parent=1246"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/virtualserversvps.com\/blog\/wp-json\/wp\/v2\/categories?post=1246"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/virtualserversvps.com\/blog\/wp-json\/wp\/v2\/tags?post=1246"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}