Professional Documents
Culture Documents
on Linux Servers
Disk IO errors (input/output) issues are a common cause of poor performance
on web hosting servers. Hard drives have speed limits, and if software tries to
read or write too much data too quickly, applications and users are forced to
wait. To put it another way, storage devices can be a bottleneck that stops the
server from reaching its full performance potential.
Disk IO is not the only cause of slow servers, so in this article, we’ll explain
how to use Linux IO stats to identify disk IO issues and how to diagnose and
fix servers with storage bottlenecks.
If you observe any of these, high IO loads might be the culprit, but how do you
know it’s a storage bottleneck rather than a problem with the network or
processor?
IO-wait is one of a series of processor activity figures in the %CPU row. It also
includes:
vmstat 1 10
iostat -md
The -m option tells iostat to display statistics in megabytes per second, and -d
says we’re interested in device utilization.
The device called vda is writing 730 MB of data each second. Whether that’s
a problem depends on the capabilities of the server and the device, but with
the observed performance degradation and large IO wait times, it’s
reasonable to conclude that excessive disk IO on vda is the cause of our
issues.
There is one other piece of information that could help us narrow things down:
the mount point of the vda device. The mount point is the directory on the
server’s filesystem the device is connected to. You can find it with
the lsblk command.
DMA isn’t available on all servers and, with virtual servers in particular, you
may not be able to modify hard drive settings.
Disk IO bottlenecks can be tricky to diagnose, but the process we’ve outlined
here will help you to quickly determine whether you have an IO problem,
which drives are affected, and what you can do to improve your server’s
performance.
As always, if you have any feedback or comments, please let us know. We
are here to help in the best ways we can. You’ll find us on Discord, the cPanel
forums, and Reddit.
[junhee.lee:root@* /]# ls -al
[junhee.lee:root@* /test]# ls
1. If you enter a command in the / directory, the phrase cannot access test is displayed.
2. If you enter a command in the /test directory, the message ls: cannot open directory .: Input/output
error is displayed.
- I thought it was a simple disk problem, but it was an error that occurred because the mount settings
were wrong.
[junhee.lee:root@* ~]# df -h
total 129640
d?????????? ?? ? ? ? test
After entering the ls -al command in the /(root) directory, I checked that the owner and permission
were not set in the test directory.
[junhee.lee:root@* /]# df -h
umount /dev/sdb1
mount -a
df -h
total 129640
.
.
After umount -> mount -a, check that information is output when entering ls -al in the /(root)
directory
[junhee.lee:root@* /teset]# ls
[junhee.lee:root@* /test/log]# ls
backup * error * * * * *
[junhee.lee:root@* /test/log/error]# ls
*.err
total 72
3. Analysis: The above situations are generally caused by hard disk problems leading to file system
damage
2. Use fsck to repair the file system. The repair needs to unmount the disk mount first, and then use:
fsck -y /dev/sdb1; after the repair is completed, remount the directory, and enter the directory again to
view the problem solution.