Detect & Resolve CPU Steal Time Caused by Noisy Neighbors
Detect and mitigate CPU steal time on your VPS: spot noisy neighbors, measure st in top/htop, tune I/O, and know when to ask for migration.
6 min read
Running a VPS on a shared physical server gives you great value, but it also means you share resources with other customers. When a “noisy neighbor” consumes more than its fair share of CPU cache or disk I/O, your applications can suffer latency spikes, higher response times, and occasional time‑outs. This article explains what CPU steal time is, how to spot a noisy neighbor on a Linux VPS, and what practical steps you can take to mitigate the impact.
What Is CPU Steal Time and Why It Matters
In a virtualised environment the hypervisor (KVM, Xen, VMware, etc.) schedules physical CPU cycles among all guest VMs. Steal time is the amount of CPU time that the guest OS wanted to use but was denied because the hypervisor was busy serving other guests. The kernel records this as the st field in /proc/stat and shows it in tools such as top and vmstat.
Low steal time (0‑2 %) – the hypervisor has enough capacity for your VM.
Moderate steal time (5‑15 %) – other VMs are contending for CPU; you may notice occasional slow‑downs.
High steal time (>20 %) – the host is overloaded; your workloads will be noticeably throttled.
Steal time is a symptom, not a cause. The real culprit is often a neighbor that generates heavy CPU cache pressure, intensive disk I/O, or both. Detecting the source helps you decide whether to optimise your own stack or request a migration from your provider.
Detecting Steal Time on Your VPS
First, confirm that the issue is indeed steal time and not a local bottleneck. Install the required monitoring tools. The examples are split for Debian/Ubuntu (using apt) and AlmaLinux/Rocky/RHEL (using dnf).
In top, the st column shows the percentage of steal time. In htop, look for the “St” field in the CPU meter.
Historical View with mpstat
# Show steal time per minute for the last 10 minutes
mpstat -P ALL 60 10 | grep -i steal
This command samples every 60 seconds (60) for ten intervals (10) and prints the %steal column for each CPU core. Consistently high values indicate a noisy neighbor.
Is Disk I/O the Real Problem?
Even if CPU steal looks modest, heavy disk I/O from another VM can cause latency that appears as CPU stalls. Use iostat (part of sysstat) to see how much time the block device spends waiting for I/O.
# Show average I/O wait per device
iostat -xz 5 3
The %util column shows how busy the device is (values above 80 % suggest saturation). The await column reports the average wait time per request. High values together with elevated st often mean the host’s storage subsystem is overloaded by another tenant.
Mitigation Strategies You Can Apply Yourself
While you cannot control other customers’ workloads, you can reduce the impact on your own applications.
1. Tune Your Application for Better Cache Locality
Prefer data structures that fit into the CPU L1/L2 cache (e.g., arrays over linked lists).
Enable madvise(MADV_RANDOM) or posix_fadvise for large sequential reads that are not cache‑friendly.
Use connection pooling to limit the number of concurrent threads competing for CPU.
2. Adjust Linux Scheduler Parameters
Changing a process’s “nice” value can give it higher priority relative to other processes inside the same VM. This does not affect other VMs, but it can help your workload stay ahead of background jobs.
# Lower the nice value (increase priority) for a critical process
sudo renice -n -5 -p <pid>
# Make the change persistent for a service (systemd example)
sudo systemctl edit myservice.service
# Add the following lines:
[Service]
Nice=-5
3. Use I/O Scheduler Optimisation
For latency‑sensitive workloads, switch to the deadline or mq-deadline scheduler, which reduces I/O wait under contention.
# Identify the current scheduler
cat /sys/block/sda/queue/scheduler
# Set deadline scheduler temporarily
echo deadline | sudo tee /sys/block/sda/queue/scheduler
# To make it permanent, add the setting to a startup script (Debian/Ubuntu) or a systemd unit (AlmaLinux/Rocky/RHEL)
4. Enable Write‑Back Caching (If Supported)
If your VPS offers a virtual block device with a write cache, enabling it can absorb bursts of writes from noisy neighbors.
# Check if write cache is enabled
cat /sys/block/sda/queue/write_cache
# Enable write cache (may require provider support)
echo write back | sudo tee /sys/block/sda/queue/write_cache
5. Deploy a Lightweight Cache Layer
Running an in‑memory cache (Redis, Memcached) reduces disk reads for frequently accessed data, lowering the chance of I/O stalls caused by other tenants.
When to Ask Your Provider for a Migration
If, after applying the above tweaks, you still see sustained steal time above 15 % or disk utilisation above 80 % during peak periods, contact AtoZNode support. Provide the following evidence:
Output of mpstat showing %steal per core over a representative interval.
Output of iostat with high %util and await values.
Application‑level logs that correlate latency spikes with the timestamps of the measurements.
With this data the provider can verify whether the physical node is over‑committed and, if necessary, migrate your VPS to a less contended host.
Proactive Monitoring for Ongoing Health
Set up a simple cron job that logs steal and I/O metrics every five minutes. Store the logs in a file you can review or ship to a monitoring service.
# Make it executable and schedule
chmod +x /usr/local/bin/monitor.sh
(crontab -l ; echo "*/5 * * * * /usr/local/bin/monitor.sh") | crontab -
Review the logs periodically or set up alerts (e.g., using mail or a webhook) when steal exceeds a threshold you define.
Conclusion
CPU steal time and noisy neighbors are inherent challenges of shared hosting, but they are not fatal. By regularly measuring st and I/O wait, tuning your application and the Linux scheduler, and keeping a clear line of communication with AtoZNode, you can keep your services responsive even when the underlying physical node is busy. Proactive monitoring helps you catch problems early, and a well‑documented migration request gives the provider the information needed to act quickly.
cpu steal timenoisy neighborlinux vpsiostatmpstatsysstatdisk i/oserver monitoring
Try it on your own server
Follow along on a Cloud VPS with full root access, or read the step-by-step knowledge base guides.