Analyzing I/O (iostat) Use iostat and sysstat on a HolyCloud VPS to diagnose disk bottlenecks, latency, and volume saturation. ~8 min read Beginner #iostat #disk #io #sysstat Analyzing I/O (iostat) HolyCloud VPS performance often depends on disk I/O (local storage or NVMe). The iostat tool (sysstat package) shows throughput, utilization, and latency per device. Prerequisites Linux VPS with sudo access Representative load (backup, SQL import, compile) to see peaks Storage type identification (HolyCloud panel / lsblk) Installation sudo apt install -y sysstat sudo systemctl enable --now sysstat iostat -V On RHEL: sudo dnf install -y sysstat Real-time reading Every 2 seconds, 5 samples: iostat -xz 2 5 Important columns (extended mode -x): | Column | Meaning | |---------|-------------| | %util | Time the disk was busy (100% = saturation) | | r/s, w/s | Reads / writes per second | | rkB/s, wkB/s | Read / write throughput | | await | Average I/O latency (ms) — critical | | avgqu-sz | Queue depth | If %util is near 100% and await rises (e.g. > 20 ms on NVMe), the disk is the bottleneck. Per partition iostat -xz 2 5 /dev/vda df -hT lsblk -o NAME,SIZE,TYPE,MOUNTPOINT,FSTYPE On a VPS, the disk often appears as vda, sda, or nvme0n1. History with sar sysstat stores archives: sar -d -f /var/log/sysstat/sa$(date +%d) | tail -30 Overnight backup activity is visible the next day. Typical scenarios Slow MySQL import iostat -xz 1 # in another terminal mysql < gros_dump.sql If w/s and wkB/s are high with high await, prefer off-peak imports or an appropriate innodb_buffer_pool_size. rsync backup watch -n2 'iostat -xz 1 1 | grep -E "Device|vda|nvme"' Active swap vmstat 1 free -h If si/so (swap in/out) > 0 continuously, RAM is insufficient — iostat will also show disk reads. Compare with fio (optional) One-off test (warning: intensive load): sudo apt install -y fio fio --name=randread --ioengine=libaio --rw=randread --bs=4k \ --numjobs=4 --size=256M --runtime=30 --filename=/tmp/fiotest rm -f /tmp/fiotest Compare results between two VPS Performance plans. Best practices Measure during an incident, not only at idle. Note the timezone and parallel cron job (grep CRON /var/log/sysstat). Do not confuse high CPU and I/O: use top, mpstat as well. apt install -y sysstat mpstat -P ALL 1 3 Indicative thresholds (NVMe VPS) | Metric | Comfortable zone | Alert | |----------|------------------|--------| | await | < 2 ms | > 10 ms sustained | | %util | < 70% average | 100% prolonged | | avgqu-sz | < 2 | > 10 | Thresholds vary by workload; an OLTP database server tolerates less latency than a static site. Troubleshooting | Observation | Approach | |-------------|-------| | Low %util but slow app | Network, CPU, application locks | | Huge w/s, little CPU | Logs, tmp, antivirus scan | | Constant reads | Cold cache, missing SQL indexes | Need help? Provide HolyCloud support: iostat -xz 2 10 output during slowness, df -h, VPS plan, and exact incident time. Continue reading Next article Configure swap Read