Skip to content

Disk Performance Diagnostics

In this article

If the server is slow while CPU and memory usage are normal, the cause is often the disk subsystem. First check the overall server load, then follow the steps below.

Checking Free Space and Inodes

A full disk leads to database errors, service failures, and a sharp drop in write speed.

df -h      # free space per partition
df -i      # free inodes (number of files)

If Use% or IUse% is close to 100%, find large directories and directories with many small files:

du -xhd1 / 2>/dev/null | sort -h | tail -n 15
find / -xdev -type f -size +1G -exec ls -lh {} \; 2>/dev/null

Note

You can run out of inodes while there is still free space if the disk holds millions of small files: PHP sessions, cache, mail queue. The error still looks like No space left on device.

Monitoring Disk Load on Linux

Install the utilities:

# Ubuntu/Debian
sudo apt install sysstat iotop ioping

# AlmaLinux/Rocky/CentOS 8
sudo dnf install sysstat iotop ioping

# CentOS 7 (ioping is in the EPEL repository)
sudo yum install epel-release
sudo yum install sysstat iotop ioping

iostat

iostat -xz 2 5

The command prints extended statistics every 2 seconds, 5 times. Pay attention to these columns:

Column Meaning What to look for
r/s, w/s Read/write operations per second (IOPS) Compare with the expected load
rkB/s, wkB/s Read/write volume per second Throughput
r_await, w_await Average request time, ms For SSD/NVMe usually a few ms; tens or hundreds of ms indicate overload
aqu-sz Average queue length Consistently above 1–2 means the disk cannot keep up
%util Share of time the disk was busy Close to 100% for a long time means the disk is fully loaded

Note

For SSD and NVMe, %util = 100% does not always mean the limit has been reached: such disks process requests in parallel. Focus primarily on await and the queue length.

A high %wa (iowait) value in top also indicates that processes are waiting for the disk.

iotop

Shows which processes are generating disk load:

sudo iotop -oPa

The -o option shows only active processes, and -a shows accumulated I/O.

ioping

Measures disk latency, similar to ping for the network:

ioping -c 10 /var/lib

Values in the tens of milliseconds for SSD/NVMe indicate a problem or high load.

Disk Type on a VPS

On virtual servers, lsblk shows rota=1 for all disks — this does not mean an HDD is used instead of an SSD. See the FAQ for details.

Testing Disk Speed with fio

Install fio: sudo apt install fio, sudo dnf install fio, or sudo yum install fio (CentOS 7).

Attention

Never run a write test with fio against a block device (/dev/sda, /dev/nvme0n1, /dev/vda) that contains data — this will destroy the file system. Test only on a file, as in the examples below, and make sure the partition has enough free space.

The tests create a 2 GB fio-test.bin file in the current directory. Change to a directory on the partition you want to test, for example cd /var/tmp.

Random read with 4 KB blocks (shows IOPS, important for databases):

fio --name=randread --filename=fio-test.bin --size=2G \
    --rw=randread --bs=4k --direct=1 --ioengine=libaio \
    --iodepth=32 --numjobs=1 --runtime=60 --time_based --group_reporting

Sequential write with 1 MB blocks (shows throughput):

fio --name=seqwrite --filename=fio-test.bin --size=2G \
    --rw=write --bs=1M --direct=1 --ioengine=libaio \
    --iodepth=16 --numjobs=1 --runtime=60 --time_based --group_reporting

In the results, look at the IOPS=, BW=, and clat lines (latency, 99.00th percentile). Delete the file after the test:

rm -f fio-test.bin

Tip

Run the tests during periods of minimal load and repeat them 2–3 times. A test on a busy server with an active database will show lower values and will itself create load.

Do not use dd if=/dev/zero for benchmarking — without oflag=direct, it measures the speed of the memory cache, not the disk.

Disk Diagnostics on Windows

  1. Open Resource Monitor (resmon) → Disk tab. The Processes with Disk Activity section shows which processes are reading and writing, and the Storage section shows Disk Queue Length and Response Time (ms).
  2. Check the free space in File Explorer or with the command:

    Get-PSDrive -PSProvider FileSystem
    
  3. Quick built-in disk test (run as Administrator):

    winsat disk -drive c
    
  4. For a detailed test, use Microsoft's DiskSpd utility. Example: 4 KB random read for 60 seconds on a 2 GB test file:

    diskspd.exe -c2G -b4K -r -w0 -o32 -t1 -d60 -Sh -L C:\diskspd-test.dat
    

    The -w0 option means read only, and -w100 means write only. Delete the C:\diskspd-test.dat file after the test.

What to Send to Technical Support

You can contact technical support in two ways: by email from the address specified in your account, or through the Help Center in the Invapi control panel by creating a ticket (how to create a ticket).

If you believe the disk performance is lower than expected, include the following in your request:

  • the server IP address and the time when the problem occurred;
  • the output of df -h and df -i;
  • the output of iostat -xz 2 5 during the problem;
  • the output of iotop -oPa (or a screenshot of the Disk tab in Resource Monitor);
  • the full output of the fio or diskspd tests, along with the commands used to run them;
  • for dedicated servers, the output of smartctl -a /dev/sdX (smartmontools package) for each disk.

Note

Individual measurements may vary, especially on virtual servers. Attach several measurements taken at different times.

question_mark
Is there anything I can help you with?
question_mark
AI Assistant ×