首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Webserver php和mysql滞后

Webserver php和mysql滞后
EN

Stack Overflow用户
提问于 2018-05-05 15:33:09
回答 1查看 149关注 0票数 0

拜托我需要你的帮助。我有一个网站(电子商店) 3.500产品-> 52 DB Mysql DB (MariaDB)

更新:我将服务器更新为4核/ 4.200 bogomps,每个16 10内存,在webserver (访问日志)和php中都是单独的,执行起来太长了:/ 4core 16 10,刷新需要5-10秒。

更新2:我格式化并清理安装,nginx,mariadb再次安装了wordperss,并且网站非常快(太快了),没有以前那么快了。虽然我在woocommerce中发现了产品列表(edit.php)上的2个php错误,这导致了前端没有显示产品-while,但一切都运行得很完美

**结论可能是以前的一些错误的php配置,或者不知道。总之,干净的安装,ubuntu和固定的**

当我是唯一一个在网站上(深夜),我按下重新加载产品列表( wordpress/woocommerce管理仪表板),它需要5-10秒,所有4cpu去100% -我增加了一个动作,创建一个自定义字段列我创建)

PHP FPM7.0 nginx

代码语言:javascript
复制
 SO:             Ubuntu 16.04.3 LTS 64 bits
 kernel:         4.4.0-112-generic
 virtual:        KVM
 cpu:            Intel Xeon Processor (Skylake, IBRS)
 vcpu:           1 core / 4200.00 bogomips
 RAM:            1952 MB (26% used) / swap 0 MB (0% used)
 HD:             22G (39% used) / inkling speed 0.213781 s,
 cachefly 10MB:  43.1 MB/s (probably Gigabit Port)

它的wordpress Woocommerce (带有高级Woo搜索插件,Woo产品过滤器等)。

虽然在我分配域名之前(大约2周的时间),当我们测试和添加更多的产品时,它是可以的。在启动时,站点会被重载(CPU 100%,RAM 30%,大多数情况下mysql/php使用它)多次(用户可能需要等待30-60秒才能看到页面),当然也有加载速度快的时候。用户还不多(为网站做广告)。

当添加指向该域的服务器的dns域时,我忘记了创建nginx.conf文件,因此它在默认情况下运行(我创建该文件并重新启动nginx),我读到了一些类似的问题,并且通过重新启动服务器而不是nginx来修复。我会在晚上重新启动,但想要任何提示,因为它可能不是。

是否有一个指南/方法来开始调查造成所有这些滞后的原因?(php?一些查询处于睡眠模式)

提前感谢

部分缓慢查询日志文件(其大小正在快速增长)

代码语言:javascript
复制
# User@Host: username[username] @ localhost []  Id:   561
# Query_time: 0.000105  Lock_time: 0.000058 Rows_sent: 0  Rows_examined: 0
SET timestamp=1525543514;
select * from wp_revslider_static_slides where slider_id = '1';
# Time: 2018-05-05T18:05:14.268625Z
# User@Host: username[username] @ localhost []  Id:   561
# Query_time: 0.000058  Lock_time: 0.000029 Rows_sent: 0  Rows_examined: 0
SET timestamp=1525543514;
select * from wp_revslider_layer_animations;
# Time: 2018-05-05T18:05:14.270439Z
# User@Host: username[username] @ localhost []  Id:   561
# Query_time: 0.000074  Lock_time: 0.000032 Rows_sent: 0  Rows_examined: 0
SET timestamp=1525543514;
select * from wp_revslider_layer_animations;
# Time: 2018-05-05T18:05:14.322818Z
# User@Host: username[username] @ localhost []  Id:   561
# Query_time: 0.000068  Lock_time: 0.000035 Rows_sent: 0  Rows_examined: 0
SET timestamp=1525543514;
select * from wp_revslider_layer_animations;
# Time: 2018-05-05T18:05:14.323465Z
# User@Host: username[username] @ localhost []  Id:   561
# Query_time: 0.000077  Lock_time: 0.000037 Rows_sent: 0  Rows_examined: 0
SET timestamp=1525543514;
select * from wp_revslider_layer_animations;
# Time: 2018-05-05T18:05:14.383319Z
# User@Host: username[username] @ localhost []  Id:   561
# Query_time: 0.000070  Lock_time: 0.000036 Rows_sent: 0  Rows_examined: 0
SET timestamp=1525543514;
select * from wp_revslider_layer_animations;
# Time: 2018-05-05T18:05:14.387182Z
# User@Host: username[username] @ localhost []  Id:   561
# Query_time: 0.000085  Lock_time: 0.000038 Rows_sent: 0  Rows_examined: 0
SET timestamp=1525543514;
select * from wp_revslider_layer_animations;
# Time: 2018-05-05T18:05:14.435005Z
# User@Host: username[username] @ localhost []  Id:   561
# Query_time: 0.000093  Lock_time: 0.000059 Rows_sent: 0  Rows_examined: 0
SET timestamp=1525543514;
select * from wp_revslider_layer_animations;
# Time: 2018-05-05T18:05:14.435195Z
# User@Host: username[username] @ localhost []  Id:   561
# Query_time: 0.000050  Lock_time: 0.000025 Rows_sent: 0  Rows_examined: 0
SET timestamp=1525543514;
select * from wp_revslider_layer_animations;
# Time: 2018-05-05T18:05:14.510109Z
# User@Host: username[username] @ localhost []  Id:   561
# Query_time: 0.000069  Lock_time: 0.000033 Rows_sent: 0  Rows_examined: 0
SET timestamp=1525543514;
select * from wp_revslider_layer_animations;
# Time: 2018-05-05T18:05:14.512806Z
# User@Host: username[username] @ localhost []  Id:   562
# Query_time: 0.000138  Lock_time: 0.000058 Rows_sent: 1  Rows_examined: 1
SET timestamp=1525543514;
SELECT COUNT(id) FROM wp_wpgmza WHERE latlng IS NULL LIMIT 1;
# Time: 2018-05-05T18:05:14.514431Z
# User@Host: username[username] @ localhost []  Id:   561
# Query_time: 0.000063  Lock_time: 0.000032 Rows_sent: 0  Rows_examined: 0
SET timestamp=1525543514;
select * from wp_revslider_layer_animations;
# Time: 2018-05-05T18:05:14.536728Z
# User@Host: username[username] @ localhost []  Id:   563
# Query_time: 0.021959  Lock_time: 0.000042 Rows_sent: 829  Rows_examined: 3864
SET timestamp=1525543514;
SELECT option_name, option_value FROM wp_options WHERE autoload = 'yes';
# Time: 2018-05-05T18:05:14.570560Z
# User@Host: username[username] @ localhost []  Id:   561
# Query_time: 0.000091  Lock_time: 0.000022 Rows_sent: 1  Rows_examined: 1
SET timestamp=1525543514;
SELECT * FROM wp_revslider_navigations;
# Time: 2018-05-05T18:05:14.579461Z
# User@Host: username[username] @ localhost []  Id:   561
# Query_time: 0.000357  Lock_time: 0.000035 Rows_sent: 109  Rows_examined: 109
SET timestamp=1525543514;
select * from wp_revslider_css;
# Time: 2018-05-05T18:05:14.582797Z
# User@Host: username[username] @ localhost []  Id:   561
# Query_time: 0.000112  Lock_time: 0.000040 Rows_sent: 1  Rows_examined: 1
SET timestamp=1525543514;
SELECT * FROM wp_revslider_navigations;
# Time: 2018-05-05T18:05:14.743284Z
# User@Host: username[username] @ localhost []  Id:   563
# Query_time: 0.000200  Lock_time: 0.000032 Rows_sent: 177  Rows_examined: 177
SET timestamp=1525543514;
SELECT * FROM wp_woocommerce_attribute_taxonomies;
# Time: 2018-05-05T18:05:14.790214Z
# User@Host: username[username] @ localhost []  Id:   564
# Query_time: 0.012663  Lock_time: 0.000053 Rows_sent: 829  Rows_examined: 3864
SET timestamp=1525543514;
SELECT option_name, option_value FROM wp_options WHERE autoload = 'yes';
# Time: 2018-05-05T18:05:14.879039Z
# User@Host: username[username] @ localhost []  Id:   565
# Query_time: 0.007580  Lock_time: 0.000039 Rows_sent: 829  Rows_examined: 3864
SET timestamp=1525543514;
SELECT option_name, option_value FROM wp_options WHERE autoload = 'yes';
# Time: 2018-05-05T18:05:14.987623Z
# User@Host: username[username] @ localhost []  Id:   564
# Query_time: 0.000267  Lock_time: 0.000068 Rows_sent: 177  Rows_examined: 177
SET timestamp=1525543514;
SELECT * FROM wp_woocommerce_attribute_taxonomies;
# Time: 2018-05-05T18:05:15.042806Z
# User@Host: username[username] @ localhost []  Id:   565
# Query_time: 0.000510  Lock_time: 0.000062 Rows_sent: 177  Rows_examined: 177
SET timestamp=1525543515;
SELECT * FROM wp_woocommerce_attribute_taxonomies;
# Time: 2018-05-05T18:05:15.062377Z
# User@Host: username[username] @ localhost []  Id:   563
# Query_time: 0.000092  Lock_time: 0.000043 Rows_sent: 1  Rows_examined: 1
SET timestamp=1525543515;
SELECT COUNT(id) FROM wp_wpgmza WHERE latlng IS NULL LIMIT 1;
# Time: 2018-05-05T18:05:15.290944Z
# User@Host: username[username] @ localhost []  Id:   564
# Query_time: 0.000115  Lock_time: 0.000050 Rows_sent: 1  Rows_examined: 1
SET timestamp=1525543515;
SELECT COUNT(id) FROM wp_wpgmza WHERE latlng IS NULL LIMIT 1;
# Time: 2018-05-05T18:05:15.394652Z
# User@Host: username[username] @ localhost []  Id:   565
# Query_time: 0.000205  Lock_time: 0.000102 Rows_sent: 1  Rows_examined: 1
SET timestamp=1525543515;
SELECT COUNT(id) FROM wp_wpgmza WHERE latlng IS NULL LIMIT 1;
# Time: 2018-05-05T18:05:15.880799Z
# User@Host: username[username] @ localhost []  Id:   562
# Query_time: 0.000208  Lock_time: 0.000092 Rows_sent: 1  Rows_examined: 1
SET timestamp=1525543515;
select * from wp_revslider_sliders where alias = 'front1'  AND `type` != 'template';
# Time: 2018-05-05T18:05:15.897405Z
# User@Host: username[username] @ localhost []  Id:   562
# Query_time: 0.000235  Lock_time: 0.000064 Rows_sent: 5  Rows_examined: 10
SET timestamp=1525543515;
select * from wp_revslider_slides where slider_id = '1' order by slide_order;
# Time: 2018-05-05T18:05:16.189428Z
# User@Host: username[username] @ localhost []  Id:   566
# Query_time: 0.015136  Lock_time: 0.000094 Rows_sent: 829  Rows_examined: 3864
SET timestamp=1525543516;
SELECT option_name, option_value FROM wp_options WHERE autoload = 'yes';
# Time: 2018-05-05T18:05:16.201909Z
# User@Host: username[username] @ localhost []  Id:   562
# Query_time: 0.000078  Lock_time: 0.000039 Rows_sent: 0  Rows_examined: 0
SET timestamp=1525543516;
select * from wp_revslider_static_slides where slider_id = '1';
# Time: 2018-05-05T18:05:16.224672Z
# User@Host: username[username] @ localhost []  Id:   562
# Query_time: 0.000200  Lock_time: 0.000048 Rows_sent: 5  Rows_examined: 10
SET timestamp=1525543516;
select * from wp_revslider_slides where slider_id = '1' order by slide_order;
# Time: 2018-05-05T18:05:16.466599Z
# User@Host: username[username] @ localhost []  Id:   566
# Query_time: 0.000164  Lock_time: 0.000022 Rows_sent: 177  Rows_examined: 177
SET timestamp=1525543516;
SELECT * FROM wp_woocommerce_attribute_taxonomies;
# Time: 2018-05-05T18:05:16.543131Z
# User@Host: username[username] @ localhost []  Id:   562
# Query_time: 0.000114  Lock_time: 0.000060 Rows_sent: 0  Rows_examined: 0
SET timestamp=1525543516;
select * from wp_revslider_static_slides where slider_id = '1';
# Time: 2018-05-05T18:05:16.543676Z
# User@Host: username[username] @ localhost []  Id:   562
# Query_time: 0.000084  Lock_time: 0.000042 Rows_sent: 0  Rows_examined: 0
SET timestamp=1525543516;
select * from wp_revslider_layer_animations;
# Time: 2018-05-05T18:05:16.543881Z
# User@Host: username[username] @ localhost []  Id:   562
# Query_time: 0.000068  Lock_time: 0.000032 Rows_sent: 0  Rows_examined: 0
SET timestamp=1525543516;
select * from wp_revslider_layer_animations;
# Time: 2018-05-05T18:05:16.590546Z
# User@Host: username[username] @ localhost []  Id:   562
# Query_time: 0.000045  Lock_time: 0.000021 Rows_sent: 0  Rows_examined: 0
SET timestamp=1525543516;
select * from wp_revslider_layer_animations;
# Time: 2018-05-05T18:05:16.590727Z
# User@Host: username[username] @ localhost []  Id:   562
# Query_time: 0.000058  Lock_time: 0.000023 Rows_sent: 0  Rows_examined: 0
SET timestamp=1525543516;
select * from wp_revslider_layer_animations;
# Time: 2018-05-05T18:05:16.644940Z
# User@Host: username[username] @ localhost []  Id:   563
# Query_time: 0.000099  Lock_time: 0.000039 Rows_sent: 1  Rows_examined: 1
SET timestamp=1525543516;
select * from wp_revslider_sliders where alias = 'front1'  AND `type` != 'template';
# Time: 2018-05-05T18:05:16.645032Z
# User@Host: username[username] @ localhost []  Id:   562
# Query_time: 0.000039  Lock_time: 0.000019 Rows_sent: 0  Rows_examined: 0
SET timestamp=1525543516;
select * from wp_revslider_layer_animations;
# Time: 2018-05-05T18:05:16.646460Z
# User@Host: username[username] @ localhost []  Id:   562
# Query_time: 0.000058  Lock_time: 0.000029 Rows_sent: 0  Rows_examined: 0
SET timestamp=1525543516;
select * from wp_revslider_layer_animations;
# Time: 2018-05-05T18:05:16.662890Z
# User@Host: username[username] @ localhost []  Id:   563
# Query_time: 0.000190  Lock_time: 0.000039 Rows_sent: 5  Rows_examined: 10
SET timestamp=1525543516;
select * from wp_revslider_slides where slider_id = '1' order by slide_order;
# Time: 2018-05-05T18:05:16.733622Z
# User@Host: username[username] @ localhost []  Id:   562
# Query_time: 0.002070  Lock_time: 0.000070 Rows_sent: 0  Rows_examined: 0
SET timestamp=1525543516;
select * from wp_revslider_layer_animations;
# Time: 2018-05-05T18:05:16.734768Z
# User@Host: username[username] @ localhost []  Id:   562
# Query_time: 0.001113  Lock_time: 0.000023 Rows_sent: 0  Rows_examined: 0
SET timestamp=1525543516;
select * from wp_revslider_layer_animations;
# Time: 2018-05-05T18:05:16.751977Z
# User@Host: username[username] @ localhost []  Id:   566
# Query_time: 0.000759  Lock_time: 0.000037 Rows_sent: 1  Rows_examined: 1
SET timestamp=1525543516;
SELECT COUNT(id) FROM wp_wpgmza WHERE latlng IS NULL LIMIT 1;
# Time: 2018-05-05T18:05:16.835900Z
# User@Host: username[username] @ localhost []  Id:   562
# Query_time: 0.000059  Lock_time: 0.000019 Rows_sent: 0  Rows_examined: 0
SET timestamp=1525543516;
select * from wp_revslider_layer_animations;
# Time: 2018-05-05T18:05:16.850232Z
# User@Host: username[username] @ localhost []  Id:   562
# Query_time: 0.003926  Lock_time: 0.000034 Rows_sent: 0  Rows_examined: 0
SET timestamp=1525543516;
select * from wp_revslider_layer_animations;
# Time: 2018-05-05T18:05:16.910679Z
# User@Host: username[username] @ localhost []  Id:   564
# Query_time: 0.006930  Lock_time: 0.000093 Rows_sent: 1  Rows_examined: 1
SET timestamp=1525543516;
select * from wp_revslider_sliders where alias = 'front1'  AND `type` != 'template';
# Time: 2018-05-05T18:05:16.910981Z
# User@Host: username[username] @ localhost []  Id:   564
# Query_time: 0.000253  Lock_time: 0.000052 Rows_sent: 5  Rows_examined: 10
SET timestamp=1525543516;
select * from wp_revslider_slides where slider_id = '1' order by slide_order;
# Time: 2018-05-05T18:05:16.978683Z
# User@Host: username[username] @ localhost []  Id:   562
# Query_time: 0.000110  Lock_time: 0.000024 Rows_sent: 1  Rows_examined: 1
SET timestamp=1525543516;
SELECT * FROM wp_revslider_navigations;
# Time: 2018-05-05T18:05:16.994848Z
# User@Host: username[username] @ localhost []  Id:   562
# Query_time: 0.000273  Lock_time: 0.000023 Rows_sent: 109  Rows_examined: 109
SET timestamp=1525543516;
select * from wp_revslider_css;
# Time: 2018-05-05T18:05:17.002689Z
# User@Host: username[username] @ localhost []  Id:   562
# Query_time: 0.000152  Lock_time: 0.000092 Rows_sent: 1  Rows_examined: 1
SET timestamp=1525543517;
SELECT * FROM wp_revslider_navigations;
# Time: 2018-05-05T18:05:17.038500Z
# User@Host: username[username] @ localhost []  Id:   565
# Query_time: 0.000208  Lock_time: 0.000103 Rows_sent: 1  Rows_examined: 1
SET timestamp=1525543517;
select * from wp_revslider_sliders where alias = 'front1'  AND `type` != 'template';
# Time: 2018-05-05T18:05:17.054587Z
# User@Host: username[username] @ localhost []  Id:   565
# Query_time: 0.000294  Lock_time: 0.000098 Rows_sent: 5  Rows_examined: 10
SET timestamp=1525543517;
select * from wp_revslider_slides where slider_id = '1' order by slide_order;
# Time: 2018-05-05T18:05:17.346287Z
# User@Host: username[username] @ localhost []  Id:   563
# Query_time: 0.004701  Lock_time: 0.000037 Rows_sent: 0  Rows_examined: 0
SET timestamp=1525543517;
select * from wp_revslider_static_slides where slider_id = '1';
# Time: 2018-05-05T18:05:17.354675Z
# User@Host: username[username] @ localhost []  Id:   563
# Query_time: 0.000203  Lock_time: 0.000041 Rows_sent: 5  Rows_examined: 10
SET timestamp=1525543517;
select * from wp_revslider_slides where slider_id = '1' order by slide_order;
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2019-04-13 07:21:23

WOOF (过滤器插件)插件导致了如此大的延迟。还将服务器从VPS 4vcore升级到VPS 4专用核心,整个站点的执行改进了很多(这是CPU电源问题)。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/50191136

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档