简体   繁体   中英

Webserver php and mysql lag

please i would like your help. I have a website (e-shop) 3.500 products -> 52MB Mysql DB (MariaDB)

UPDATE: I update server to 4 cores / 4.200 bogomps each 16GB RAM I am all alone in the webserver ( access log) and the php getting way way too long to be execute :/ 4cores 16GB and it takes 5-10 secs for a refresh

UPDATE 2: Well I format and clean install again nginx php mysql mariadb installed wordperss again and website is ultra fast ( way too fast) nothing that previously. Although I found 2 php error on products list (edit.php) in woocommerce which was resulting on not showing the products -while in front end everything was working perfect

**Conclution probably some wrong php configuration from before or dont know. Anyway clean install ubuntu and fixed **

When I am the only one on site ( late night) and i press to reload products list ( wordpress/woocommerce admin dashboard) it takes 5-10 secs all 4 cpu goes 100% - i had added an action to create column for a custom field i create)

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)

Its wordpress Woocommerce (with Advanced Woo Search plugin, woof product filter etc).

Although before i assign domain (around 2 weeks period) while we testing and adding some more products it was ok. on launch the site get overloaded (CPU 100%, RAM 30% most of the time mysql/php use it) many times ( user might needs to wait 30-60 secs to see the page) of course there are times that loading is fast. there aren't yet too many users ( advertise the site).

I had forgotten to create the nginx.conf file when add the dns domain pointing to the server for that domain so it was running on default (i create the file and restart the nginx) I have read somewhere similar problem experienced and was fixed by rebooting the server not just nginx. I will reboot on night but would like any tip because it might not be that.

Is there a guide/ way to start investigate that cause all that lag? (php ? mysql -> some queries are in sleep mode)

Thanks in advance

服务器CPU停止

mysql进程列表

part of slow query log file (its size is increasing fast)

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

WOOF (filter plugin) plugin was causing this big delays. Also upgraded the server from VPS 4vcore to VPS 4 dedicated core and the execution for the whole site improved alot (it was CPU power issue)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM