All ArticlesDevOps2026-11-19T11:15:36+08:00

VPS Slows Down Every Night? Check Disk I/O Wait Around Backup and Cron Jobs

A VPS that becomes slow at the same hour every night usually has backup jobs, log rotation, or cron tasks competing for disk I/O. Readers will learn how to match iowait and per-process disk activity from iostat and iotop to those scheduled jobs, and how to move or throttle the jobs so the slowdown tickets stop.

Your VPS runs fine all day, then turns sluggish at the same hour every night. Pages take seconds to load, SSH feels laggy, and by morning everything is normal again. The pattern is too consistent to be random traffic. Nine times out of ten, something scheduled — a backup job, log rotation, or a cron task — is saturating disk I/O while your application still needs to read and write.

This guide walks through the exact CLI steps to catch the culprit, confirm it is disk-bound, and then throttle or reschedule it.

Confirm iowait is the bottleneck

When a process waits for disk, the CPU reports that time as iowait — the percentage of time the CPU is idle specifically because it is waiting on I/O to complete. High iowait with low user/system CPU is the classic sign of a disk-bound server, not a CPU-bound one.

Run vmstat with a one-second interval during the slow window:

vmstat 1 30

Look at the wa column (iowait) and the bi/bo columns (blocks in/out per second). If wa climbs above 20-30% while us and sy stay low, disk I/O is the constraint.

For more detail per device, use iostat from the sysstat package:

# Install if missing: apt install sysstat (Debian/Ubuntu) or yum install sysstat (CentOS/RHEL)
iostat -xz 2 10

Key columns to watch:

  • %util — how saturated the device is. Sustained values near 100% mean the disk cannot keep up.
  • await — average time in milliseconds each I/O request waits. On a healthy SSD this is typically under 5ms; on a busy spinning disk, it can climb into hundreds.
  • r/s, w/s — read and write operations per second. A sudden spike in w/s during the slow window points to a write-heavy job like a backup or log compression.

If you are on a Proxmox VM and want to figure out whether the bottleneck is inside the guest or on the host storage layer, the related article on high iowait in a Proxmox VM covers that distinction.

Identify which process is doing the I/O

iotop shows per-process disk read/write rates in real time. It needs root and a kernel compiled with CONFIG_TASK_IO_ACCOUNTING (most mainstream distro kernels have this).

sudo iotop -oa

The -o flag shows only processes currently doing I/O, and -a accumulates totals so you can see which process has done the most I/O since you started watching. Leave this running when the slowdown window hits.

Typical culprits that show up:

  • tar, gzip, pigz, rsync, rclone — backup scripts compressing or copying files.
  • vzdump — Proxmox's built-in backup tool, which reads entire disk images.
  • logrotate calling gzip or xz to compress rotated logs.
  • mysqlcheck, mysqldump, mariabackup — database maintenance or dump jobs.
  • updatedb (mlocate) — rebuilds the file index, reads every directory on disk.
  • fstrim or a TRIM cron — can cause latency spikes on some storage backends.

Once you see the process name and PID, check what scheduled it.

Trace the process back to a cron job or timer

Cron jobs live in several places. Check all of them:

  • /var/spool/cron/crontabs/ (Debian/Ubuntu) or /var/spool/cron/ (CentOS/RHEL) — per-user crontabs.
  • /etc/crontab — system crontab.
  • /etc/cron.d/ — drop-in cron files from packages.
  • /etc/cron.daily/, /etc/cron.hourly/, /etc/cron.weekly/ — scripts run by anacron or run-parts.

Grep for the process name you found in iotop:

grep -r 'rsync\\|tar\\|mysqldump\\|vzdump\\|logrotate' /etc/cron* /var/spool/cron/ 2>/dev/null

Also check systemd timers, which are increasingly common:

systemctl list-timers --all

This lists every active timer, when it last ran, and when it fires next. If a timer lines up with your slowdown window, you found it.

Control panels like cPanel and Plesk schedule their own backup jobs outside of the normal crontab. cPanel backups are configured in WHM under "Backup Configuration" and typically run via /usr/local/cpanel/scripts/cpbackup. Plesk uses its own scheduler. Check the panel's backup settings if you do not find the job in cron.

Fix it: reschedule, throttle, or both

Once you know which job causes the I/O storm, you have three options.

Reschedule to a quieter window. If the backup runs at 2 AM and your traffic is lowest at 5 AM, move it. This is the simplest fix and often sufficient. Edit the crontab entry or systemd timer to shift the start time. If multiple heavy jobs run at the same hour, stagger them so they do not overlap.

Throttle with ionice. ionice sets the I/O scheduling class and priority for a process. Wrapping your backup command with ionice -c3 puts it in the "idle" class, meaning it only gets disk time when nothing else needs it:

# In the crontab entry, prefix the command:
0 3 * * * ionice -c3 nice -n 19 /usr/local/bin/backup.sh

nice -n 19 lowers CPU priority too, which helps if the job also compresses data. The combination means the backup still finishes, but yields to your web server and database whenever they need the disk or CPU.

One caveat: ionice effectiveness depends on the I/O scheduler. The cfq scheduler respects ionice classes well. The mq-deadline and none schedulers (common on NVMe and virtio devices) may ignore ionice classes entirely. Check your scheduler:

cat /sys/block/vda/queue/scheduler

Replace vda with your actual block device. If the output shows [none] or [mq-deadline], ionice's idle class may have limited effect, and you would need cgroup-based I/O throttling instead (using systemd's IOReadBandwidthMax/IOWriteBandwidthMax in a service unit, or cgroup v2's io.max directly).

Use bandwidth-limited tools. Many backup tools have built-in throttling. rsync has --bwlimit (in KBps). rclone has --bwlimit. mysqldump does not, but piping it through pv -L 10m limits throughput. Using tool-level throttling is often more predictable than ionice.

Verify the fix

After rescheduling or throttling, confirm the improvement during the next scheduled run. Run the same vmstat 1 or iostat -xz 2 session during the new window and compare wa and %util to your earlier baseline. If iowait dropped and your application response times stayed normal, the fix holds.

For ongoing monitoring, a lightweight approach: add a one-liner to cron that logs iowait every minute to a file, so you have historical data without installing a full monitoring stack:

* * * * * echo "(date +\\%H:\\%M)(awk '{print $5}' /proc/stat | head -1)" >> /var/log/iowait.log

That said, parsing /proc/stat for iowait requires a delta calculation between two readings, so for a proper per-minute average, sar from the sysstat package (enabled via its own cron or systemd timer) is more reliable. Once sysstat collection is active, sar -d gives you historical per-device I/O stats you can review the next morning.

When the problem is not your cron

On shared or oversold host nodes, the I/O saturation might come from a neighbor VM's backup job, not yours. If your iotop shows no heavy process inside your VPS but iostat still reports high await and low throughput, the bottleneck is on the host's storage layer. You cannot fix that from inside the guest. Contact your provider with the iostat output showing high await with low internal I/O — that is concrete evidence the problem is external.

Nightly slowdowns are one of the most common support complaints on shared and VPS hosting. The fix is almost always boring: find the scheduled job, move it or throttle it, verify the next night. The commands above give you the evidence to stop guessing and start fixing.