这看起来像是一个应用程序特定的问题,并且我的服务器(Linode)正在使用过多的 I/O。
(配置:Ubuntu 12.0.4+Nginx+MariaDB+PHP-FPM+APC+iONCube+igBinary)
我正在尝试找出正确的方向,但调试起来可能非常复杂。然而我的 I/O 肯定会给您的系统带来问题。
Total DISK READ: 0.00 B/s | Total DISK WRITE: 132.51 M/s
TID PRIO USER DISK READ DISK WRITE SWAPIN IO> COMMAND
26474 be/4 www-data 0.00 B/s 91.29 M/s 0.00 % 0.31 % php-fpm: pool www
26255 be/4 www-data 0.00 B/s 72.49 M/s 0.00 % 0.82 % php-fpm: pool www
根据您的错误日志,该问题似乎具体出在 PHP 上:
: 66.249.76.233, server: myprestashop.com, request: "POST /module/mailalerts/actions?process=check HTTP/1.1", upstream: "fastcgi://unix:/tmp/php5-fpm.sock:", host: "myprestashop.com", referrer: "https://myprestashop.com/farmacia-y-medicinas/15038-garamicina-frasco-ampula-5-80mg-antibiotico-7501050610537.html"
2014/05/03 04:27:32 [crit] 13627#0: *25936 connect() to unix:/tmp/php5-fpm.sock failed (2: No such file or directory) while connecting to upstream, client: 66.249.76.233, server: myprestashop.com, request: "GET /sistema-nervioso/11634-rapix-capsulas-10-10mg-7501314703821.html HTTP/1.1", upstream: "fastcgi://unix:/tmp/php5-fpm.sock:", host: "myprestashop.com"
我重新启动了PHP:
root@luna:/etc/nginx/sites-enabled# killall php5-fpm root@luna:/etc/nginx/sites-enabled# /etc/init.d/php5-fpm start
然而此后我在错误日志中收到新消息:
2014/05/03 04:31:43 [error] 13627#0: *26155 FastCGI sent in stderr: "PHP message: PHP Warning: array_shift() expects parameter 1 to be array, boolean given in /sites/myprestashop.com/public/modules/productcomments/ProductComment.php on line 140
PHP message: PHP Warning: array_shift() expects parameter 1 to be array, boolean given in /sites/myprestashop.com/public/modules/productcomments/ProductComment.php on line 140" while reading response header from upstream, client: 65.55.55.231, server: myprestashop.com, request: "GET /higiene-personal/4519-koleston-cast-osc-viol-int-366-7501007455174.html HTTP/1.1", upstream: "fastcgi://unix:/tmp/php5-fpm.sock:", host: "myprestashop.com"
2014/05/03 04:32:06 [error] 13626#0: *26195 FastCGI sent in stderr: "PHP message: PHP Notice: Undefined index: product_mode in /sites/myprestashop.com/public/cache/smarty/compile/b0/9a/32/b09a3295da69c6626cf2789ed62cd44f2fbed7f6.file.product-list.tpl.php on line 36
PHP message: PHP Notice: Undefined index: product_mode in /sites/myprestashop.com/public/cache/smarty/compile/b0/9a/32/b09a3295da69c6626cf2789ed62cd44f2fbed7f6.file.product-list.tpl.php on line 146
PHP message: PHP Notice: Undefined index: product_mode in /sites/myprestashop.com/public/cache/smarty/compile/b0/9a/32/b09a3295da69c6626cf2789ed62cd44f2fbed7f6.file.product-list.tpl.php on line 146" while reading response header from upstream, client: 66.249.76.233, server: myprestashop.com, request: "GET /26-cuidado-del-cabello?amp%252525252525253Bselected_filters=%3Fcontroller%3D404&p=14 HTTP/1.1", upstream: "fastcgi://unix:/tmp/php5-fpm.sock:", host: "myprestashop.com"
看起来代码本身存在需要解决的问题。
编辑
有 2 个 APC 实例,一个在 modes-available 中,另一个在 conf.d 中
还有 php-fpm 日志
[03-May-2014 11:38:11] ERROR: An another FPM instance seems to already listen on /tmp/php5-fpm.sock
[03-May-2014 11:38:11] ERROR: FPM initialization failed
解决方案可能是删除 php+igbinary+ioncube
答案1
每次我看到这样的事情,都是因为
- Apache 配置 / .htaccess 定义了一些导致无限循环的内容 -> AIEEEE
- 有人编写了一个 PHP 或其他脚本,其中的某种 for 循环执行了一些恶意操作,或者造成了问题
- 一些脚本尝试调用一些外部资源,但无法做到,并且以某种方式决定过快重试 -> AIEE
- 你的 PHP 脚本启用了一些日志记录,并且在 X 条件下它开始淹没日志 -> AIEEEE
这些有可能吗?