I recently discovered that php always times out when running automatic loading class functions. I tracked the php slow query log and found that the program was stuck in an include. class file actually timed out.
The initial positioning is that the io response timed out and there was a problem with hard disk reading.
Use several commands to locate:
iostat -d -x -k 1 10 // Run 10 times to see that the wait parameter in iostat is very large, generally no more than 5ms. The closer the two parameters of await svctm are, the better the io performance will be.
Refer to other blogs,
await: The average processing time of each IO request (unit is microseconds and milliseconds). This can be understood as the IO response time. Generally, the system IO response time should be less than 5ms. If it is greater than 10ms, it will be larger.
This time includes queue time and service time. That is to say, generally speaking, await is greater than svctm. The smaller the difference between them, the shorter the queue time. On the contrary, the larger the difference, the longer the queue time. It means there is something wrong with the system. svctm represents the average service time (in milliseconds) of each device I/O operation. If the value of svctm is very close to await, it means that there is almost no I/O waiting and the disk performance is very good. If the value of await is much higher than the value of svctm, it means that the I/O queue wait is too long and the applications running on the system will Slow down.
sudo iotop -o, // Check the programs being allocated on the hard disk and check the io occupation ratio of the process
sudo perf top // Check the process io usage ratio
sudo hdparm -t /dev/**** View disk read efficiency
Display: Timing buffered disk reads: 10 MB in 3.14 seconds = 3.18 MB/sec
View uninterrupted sleep
while true; do date; ps auxf | awk '{if($8=="D") print $0;}'; sleep 1; done
After tracing through the above command, the hard disk reading efficiency is very low. The further reason is unknown. It is speculated that the hard disk may have bad sectors.