gpt4 book ai didi

php - WordPress的慢查询杀死服务器。如何找到原产地?

转载 作者:行者123 更新时间:2023-11-29 20:59:59 25 4
gpt4 key购买 nike

由于缓慢的查询需要很长时间才能完成,因此我的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


谁能帮我找到这根源。请帮忙。

最佳答案

如果您的静态站点没有数百万的用户,并且性能变化很大,则可能是您的主机受到了指责。我强烈建议媒体寺(mt)尝试过8位不同的主持人,并研究了十几位主持人。您可以从中获得最佳的客户服务和性能。

另外,请检查WP Engine的速度测试工具:http://speed.wpengine.com/-深入了解您的网站运行缓慢的原因。需要几个小时才能生成报告。

关于php - WordPress的慢查询杀死服务器。如何找到原产地?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37316665/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com