search
Homephp教程php手册php include类文件超时问题处理

php include类文件超时问题处理

Jun 13, 2016 am 09:15 AM
includephpDiscoverdeal withdocumentkindtime outrunquestion

php include类文件超时问题处理

  最近发现,php运行自动加载类函数时总是超时,跟踪php慢查询日志,发现程序卡在了include某个类文件时竟然超时。

  初步定位是io响应超时,硬盘读取有问题。

  通过几个命令来定位:

  iostat -d -x -k 1 10 // 运行10次查看iostat中wait参数很大,一般不超过5ms,await svctm这2个参数越接近,io性能越好。

  参考别的博客,

  await: 每一个IO请求的处理的平均时间(单位是微秒毫秒)。这里可以理解为IO的响应时间,一般地系统IO响应时间应该低于5ms,如果大于10ms就比较大了。

  这个时间包括了队列时间和服务时间,也就是说,一般情况下,await大于svctm,它们的差值越小,则说明队列时间越短,反之差值越大,队列时间越长,说明系统出了问题。svctm 表示平均每次设备I/O操作的服务时间(以毫秒为单位)。如果svctm的值与await很接近,表示几乎没有I/O等待,磁盘性能很好,如果await的值远高于svctm的值,则表示I/O队列等待太长, 系统上运行的应用程序将变慢。

  sudo iotop -o , // 查看在划硬盘的程序,查看进程io占用比例

  sudo perf top // 查看进程io占用比例

  sudo hdparm -t /dev/**** 查看磁盘读取效率

  显示: Timing buffered disk reads: 10 MB in 3.14 seconds = 3.18 MB/sec

  查看非中断睡眠

  while true; do date; ps auxf | awk '{if($8=="D") print $0;}'; sleep 1; done

 

  通过上述命令跟踪后,硬盘读取效率很低,进一步原因,还不得而知,猜想可能是硬盘有坏道。

Statement
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

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

MantisBT

MantisBT

Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.

SAP NetWeaver Server Adapter for Eclipse

SAP NetWeaver Server Adapter for Eclipse

Integrate Eclipse with SAP NetWeaver application server.

MinGW - Minimalist GNU for Windows

MinGW - Minimalist GNU for Windows

This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

PhpStorm Mac version

PhpStorm Mac version

The latest (2018.2.1) professional PHP integrated development tool

Atom editor mac version download

Atom editor mac version download

The most popular open source editor