web服务器php和mysql lag

cclgggtu  于 2021-06-25  发布在  Mysql
关注(0)|答案(1)|浏览(500)

我需要你的帮助。我有一个网站(e-shop)3.500产品->52mb mysql数据库(mariadb)
更新:我将服务器更新为4个内核/4.200个bogomps每个16gb内存我独自一人在web服务器(访问日志)中,php太长,无法执行:/4内核16gb,刷新需要5-10秒
更新2:嗯,我格式和清洁安装再次nginx php mysql mariadb安装wordpers再次和网站是超快(太快)没有什么,以前。虽然我在woocommerce的产品列表(edit.php)上发现了2个php错误,导致没有显示产品,但在前端,一切都很正常

结论可能是一些错误的php配置从以前或不知道。不管怎样,请安装ubuntu并修复

当我是唯一一个在现场(深夜)和我按下重新加载产品列表(wordpress/woocommerce管理 Jmeter 板)它需要5-10秒全部4 cpu去100%-我已经添加了一个行动,以创建一个自定义字段列我创建)
vps php fpm 7.0 nginx

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搜索插件、woof产品过滤器等)。
虽然在我分配域名(大约2周的时间),而我们测试和添加一些更多的产品,这是可以的。在启动站点时,会多次过载(cpu 100%,ram 30%,大多数情况下mysql/php使用它)(用户可能需要等待30-60秒才能看到页面)当然有时加载速度很快。还没有太多的用户(为网站做广告)。
我忘记了创建nginx.conf文件,当添加指向该域的服务器的dns域时,所以它在默认情况下运行(我创建文件并重新启动nginx)我读到了一些类似的问题,并通过重新启动服务器而不仅仅是nginx来修复。我会在晚上重新启动,但希望有任何提示,因为它可能不是那样。
是否有一个指南/方法来开始调查导致所有这些滞后的原因(php?mysql->某些查询处于睡眠模式)
提前谢谢


慢速查询日志文件的一部分(其大小正在快速增加)


# 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;
p1iqtdky

p1iqtdky1#

woof(过滤器插件)插件导致了如此大的延迟。同时将服务器从vps4vcore升级到vps4专用核,整个站点的执行效率提高了很多(这是cpu电源问题)

相关问题