我的Wordpress安装因为查询速度慢而需要很长时间才能完成。因此产生了很多php-fpm进程并最终占用了所有CPU。
查询
SELECT post_id, meta_key, meta_value
FROM wp_postmeta
WHERE post_id IN (95,150,155,160,165,181,183,186, ...goes on to total post count)
ORDER BY meta_id ASC;
如果你发现它试图为所有发布的帖子发布元数据。这是一个巨大的问题。我无法知道它在哪里运行。
这导致php-fpm进程等待它并产生大量消耗100%CPU的孩子
[19-May-2016 03:28:47] WARNING: [pool www] child 1397, script '/var/www/index.php' (request: "GET /index.php") execution timed out (225.592993 sec), terminating
[19-May-2016 03:28:47] WARNING: [pool www] child 514, script '/var/www/index.php' (request: "GET /index.php") execution timed out (211.881885 sec), terminating
[19-May-2016 03:28:47] WARNING: [pool www] child 315, script '/var/www/index.php' (request: "GET /index.php") execution timed out (208.906923 sec), terminating
[19-May-2016 03:28:47] WARNING: [pool www] child 32244, script '/var/www/index.php' (request: "GET /index.php") execution timed out (187.837381 sec), terminating
[19-May-2016 03:28:47] WARNING: [pool www] child 30977, script '/var/www/index.php' (request: "GET /index.php") execution timed out (214.641630 sec), terminating
[19-May-2016 03:28:47] WARNING: [pool www] child 30339, script '/var/www/index.php' (request: "GET /index.php") execution timed out (195.576432 sec), terminating
[19-May-2016 03:28:49] WARNING: [pool www] child 32244 exited on signal 15 (SIGTERM) after 1498.089029 seconds from start
[19-May-2016 03:28:49] NOTICE: [pool www] child 2584 started
[19-May-2016 03:28:49] WARNING: [pool www] child 30977 exited on signal 15 (SIGTERM) after 2098.495078 seconds from start
[19-May-2016 03:28:49] NOTICE: [pool www] child 2585 started
[19-May-2016 03:28:49] WARNING: [pool www] child 315 exited on signal 15 (SIGTERM) after 1200.897107 seconds from start
[19-May-2016 03:28:49] NOTICE: [pool www] child 2586 started
[19-May-2016 03:28:49] WARNING: [pool www] child 514 exited on signal 15 (SIGTERM) after 1079.468196 seconds from start
[19-May-2016 03:28:49] NOTICE: [pool www] child 2587 started
[19-May-2016 03:28:49] WARNING: [pool www] child 1397 exited on signal 15 (SIGTERM) after 660.145154 seconds from start
[19-May-2016 03:28:49] NOTICE: [pool www] child 2588 started
[19-May-2016 03:28:50] WARNING: [pool www] child 30339 exited on signal 15 (SIGTERM) after 2401.324683 seconds from start
任何人都可以帮我找到根源。请帮忙。
答案 0 :(得分:0)
如果您的静态网站没有数百万用户且性能变化很大,那么您的主机可能会受到指责。我已经尝试了大约8个不同的主机并研究了其他十几个,我强烈建议Media Temple(mt)。您可以获得最佳的客户服务和性能。
另外,请查看WP引擎的速度测试工具:http://speed.wpengine.com/ - 深入了解您的网站速度缓慢的原因。需要几个小时才能生成报告。