Skip to content

I/O bottlenecks on cPanel — block-level vs filesystem-level diagnosis

An IO problem on a cPanel host can live at the disk, the controller, the filesystem, or the application. The diagnostic flow that tells you which layer is at fault.

“The server is slow” on a cPanel host with high IO wait can mean a failing disk, a saturated RAID controller, a fragmented filesystem, or an application doing one tiny synchronous write per page render. Each has the same symptom — high %iowait in top — and a completely different fix. The diagnostic flow has to walk down from the application layer to the block layer to localize the cause.

What’s happening

The Linux IO stack has four relevant layers: application (write syscalls, fsync calls), filesystem (ext4, xfs metadata operations, journal writes), block layer (the scheduler, the queue depth), and device (SSD/HDD physical IO). A bottleneck at any layer presents as high IO wait. iostat shows device-level activity; iotop shows per-process activity; strace shows what an individual process is asking for. The cheapest diagnosis runs all three in sequence.

The most common mistake: assuming “high IO wait” means “the disk is full or slow”. Often it means “one PHP script is calling fsync() on every page view” — the disk is fine, the application is asking for guarantees it does not need.

How to verify

Device-level first:

iostat -xz 1 5
nvme list  # if NVMe
smartctl -A /dev/sda | grep -E 'Reallocated|Pending|Uncorrectable'

%util near 100% on a device with await over 20 ms means the device itself is saturated. Reallocated_Sector_Ct over a few hundred or Current_Pending_Sector non-zero is a failing drive — replace, do not tune.

Process-level next:

iotop -bo -d 1 -n 5
pidstat -dl 1 5

The processes doing the most writes are usually obvious. If it is [kjournald] or [xfs_io], the FS is busy with metadata; if it is a PHP-FPM worker, the application is.

Application-level last:

strace -p <pid> -e write,fsync,fdatasync 2>&1 | head -50

If you see fsync() calls on every page render, the application is the bottleneck — the disk is just doing what it is told.

The fix

The fix depends on where the bottleneck is:

  1. Device saturated — if NVMe, the host is undersized; recommend an upgrade. If SATA SSD, consider moving busy accounts to NVMe-backed hosts. If HDD, migrate to SSD.
  2. Device failing (SMART errors) — replace the disk during a scheduled window. Do not try to tune around a failing device.
  3. Filesystem busy with metadata — ext4 with millions of small files (typical for WordPress sites with image caches) is slow at directory operations. Consider XFS for new data, or noatime,nodiratime mount options to reduce write amplification.
  4. One PHP process fsync-ing — usually a logging plugin or a session handler. File-based PHP sessions on cPanel default to /tmp with fsync on close; switching to Redis sessions removes the IO entirely.
  5. MySQL flushing on every write — innodb_flush_log_at_trx_commit=2 instead of 1 trades durability (lose 1 second of writes on crash) for a large IO reduction. Acceptable on most non-financial workloads.

Once the layer is localized, the fix is small. The walk down the stack is the hard part. Stack Harbor uses this flow as part of environment management.