Site icon New Generation Enterprise Linux

Stop systemd timers from clobbering your system boot

Cron & Task Scheduling (Cron/Systemd Timers/At)

Stop systemd timers from clobbering your system boot

🧩 The Challenge

Setting a service to run on boot via cron or systemd is fine until the server reboots and ten different tasks try to slam your disk and CPU at the exact same second. I’ve watched load averages spike to 50 because of this, and it’s a total headache to troubleshoot when the box is unresponsive.

💡 The Fix

Use the RandomizedDelaySec setting in your systemd timer unit to stagger the start times. This prevents that massive initial bottleneck and spreads the load out over a few minutes.

[Timer]
OnBootSec=5min
RandomizedDelaySec=300

⚙️ Why It Works

Adding this offset tells systemd to pick a random time between zero and your specified window to actually trigger the service. It essentially turns a herd of stampeding tasks into a nice, steady trickle.

🚀 Pro-Tip: Use systemd-analyze calendar to check exactly when your timers will trigger next.

Linux Tips & Tricks | © ngelinux.com | 8/29/2026

0 0 votes
Article Rating
Exit mobile version