Handling the timeout problem of php include class files_PHP tutorial

WBOY
Release: 2016-07-13 10:07:47
Original
893 people have browsed it

Handling the timeout problem of php include class files

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.

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/954520.htmlTechArticleProcessing of php include class file timeout problem Recently, it was discovered that php always times out when running automatic loading class functions, and tracking php is slow Checking the log, I found that the program got stuck when including a certain class file and it exceeded...
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template