相关负责人您好,
更新了1.7.6之后,经常网站打不开,出现502 Bad Gateway错误。我的腾讯云服务器虽然最低配,但也就带了3个网站,还都没流量,因此不应该出问题的。就查询了下,发现近7天CPU总是100%,mysqld基本都在50%以上,查看mysql慢日志发现:
蜘蛛访问统计这个插件在不断地:
以前没这个问题,网站几年都没更新过了,服务器更是基本都没去过,最近的变动就是更新了eyou CMS1.7.6和更新了宝塔面板版本。刚刚尝试禁用了这个蜘蛛访问统计插件,似乎CPU负载就下去了。因此,感觉是不是这个插件在新版本有兼容性问题?个人能力有限,只能提供一些发现了。
慢日志如下:
# administrator command: Prepare; # User@Host: www_50yu_com[www_50yu_com] @ localhost [127.0.0.1] Id: 15821 # Query_time: 5.529606 Lock_time: 0.000000 Rows_sent: 0 Rows_examined: 0 SET timestamp=1759117209; # administrator command: Prepare; # User@Host: www_50yu_com[www_50yu_com] @ localhost [127.0.0.1] Id: 15825 # Query_time: 5.529710 Lock_time: 0.000000 Rows_sent: 0 Rows_examined: 0 SET timestamp=1759117209; # administrator command: Prepare; # User@Host: www_50yu_com[www_50yu_com] @ localhost [127.0.0.1] Id: 15826 # Query_time: 5.529669 Lock_time: 0.000000 Rows_sent: 0 Rows_examined: 0 SET timestamp=1759117209; # administrator command: Prepare; # User@Host: www_50yu_com[www_50yu_com] @ localhost [127.0.0.1] Id: 15827 # Query_time: 5.530276 Lock_time: 0.000000 Rows_sent: 0 Rows_examined: 0 SET timestamp=1759117209; # administrator command: Prepare; # Time: 250929 11:40:11 # User@Host: www_50yu_com[www_50yu_com] @ localhost [127.0.0.1] Id: 15812 # Query_time: 8.802646 Lock_time: 0.198760 Rows_sent: 1 Rows_examined: 4991 SET timestamp=1759117211; SELECT COUNT(*) AS tp_count FROM ey_weapp_spider_visit WHERE spider = 3 AND add_time BETWEEN 1758470400 AND 1759075199 LIMIT 1; # User@Host: www_50yu_com[www_50yu_com] @ localhost [127.0.0.1] Id: 15809 # Query_time: 8.802164 Lock_time: 0.198428 Rows_sent: 1 Rows_examined: 4991 SET timestamp=1759117211; SELECT COUNT(*) AS tp_count FROM ey_weapp_spider_visit WHERE spider = 3 AND add_time BETWEEN 1758988800 AND 1759075199 LIMIT 1; # User@Host: www_50yu_com[www_50yu_com] @ localhost [127.0.0.1] Id: 15814 # Query_time: 8.789520 Lock_time: 0.186241 Rows_sent: 1 Rows_examined: 4991 SET timestamp=1759117211; SELECT COUNT(*) AS tp_count FROM ey_weapp_spider_visit WHERE spider = 3 AND add_time BETWEEN 1758470400 AND 1759075199 LIMIT 1; # User@Host: www_50yu_com[www_50yu_com] @ localhost [127.0.0.1] Id: 15806 # Query_time: 8.803274 Lock_time: 0.198523 Rows_sent: 1 Rows_examined: 4991 SET timestamp=1759117211; SELECT COUNT(*) AS tp_count FROM ey_weapp_spider_visit WHERE spider = 3 AND add_time BETWEEN 1758988800 AND 1759075199 LIMIT 1; # User@Host: www_50yu_com[www_50yu_com] @ localhost [127.0.0.1] Id: 15810 # Query_time: 8.786404 Lock_time: 0.183534 Rows_sent: 1 Rows_examined: 4991 SET timestamp=1759117211; SELECT COUNT(*) AS tp_count FROM ey_weapp_spider_visit WHERE spider = 3 AND add_time BETWEEN 1758988800 AND 1759075199 LIMIT 1; # User@Host: www_50yu_com[www_50yu_com] @ localhost [127.0.0.1] Id: 15803 # Query_time: 8.803131 Lock_time: 0.198568 Rows_sent: 1 Rows_examined: 4991 SET timestamp=1759117211; SELECT COUNT(*) AS tp_count FROM ey_weapp_spider_visit WHERE spider = 3 AND add_time BETWEEN 1758988800 AND 1759075199 LIMIT 1; # User@Host: www_50yu_com[www_50yu_com] @ localhost [127.0.0.1] Id: 15811 # Query_time: 8.789692 Lock_time: 0.186074 Rows_sent: 1 Rows_examined: 4991 SET timestamp=1759117211; SELECT COUNT(*) AS tp_count FROM ey_weapp_spider_visit WHERE spider = 3 AND add_time BETWEEN 1758470400 AND 1759075199 LIMIT 1; # User@Host: www_50yu_com[www_50yu_com] @ localhost [127.0.0.1] Id: 15808 # Query_time: 8.786557 Lock_time: 0.183363 Rows_sent: 1 Rows_examined: 4991 SET timestamp=1759117211; SELECT COUNT(*) AS tp_count FROM ey_weapp_spider_visit WHERE spider = 3 AND add_time BETWEEN 1758988800 AND 1759075199 LIMIT 1; # User@Host: www_50yu_com[www_50yu_com] @ localhost [127.0.0.1] Id: 15805 # Query_time: 8.803449 Lock_time: 0.198340 Rows_sent: 1 Rows_examined: 4991 SET timestamp=1759117211; SELECT COUNT(*) AS tp_count FROM ey_weapp_spider_visit WHERE spider = 3 AND add_time BETWEEN 1758988800 AND 1759075199 LIMIT 1; # User@Host: www_50yu_com[www_50yu_com] @ localhost [127.0.0.1] Id: 15804 # Query_time: 8.803814 Lock_time: 0.198302 Rows_sent: 1 Rows_examined: 4991 SET timestamp=1759117211; SELECT COUNT(*) AS tp_count FROM ey_weapp_spider_visit WHERE spider = 3 AND add_time BETWEEN 1758988800 AND 1759075199 LIMIT 1; # User@Host: www_50yu_com[www_50yu_com] @ localhost [127.0.0.1] Id: 15813 # Query_time: 8.803154 Lock_time: 0.198645 Rows_sent: 1 Rows_examined: 4991 SET timestamp=1759117211; SELECT COUNT(*) AS tp_count FROM ey_weapp_spider_visit WHERE spider = 3 AND add_time BETWEEN 1758470400 AND 1759075199 LIMIT 1; /www/server/mysql/bin/mysqld, Version: 5.6.50-log (Source distribution). started with: Tcp port: 3306 Unix socket: /tmp/mysql.sock Time Id Command Argument /www/server/mysql/bin/mysqld, Version: 5.6.50-log (Source distribution). started with: Tcp port: 3306 Unix socket: /tmp/mysql.sock Time Id Command Argument # Time: 250929 11:45:47 # User@Host: www_50yu_com[www_50yu_com] @ localhost [127.0.0.1] Id: 17359 # Query_time: 5.101414 Lock_time: 0.368919 Rows_sent: 0 Rows_examined: 5003 use www_50yu_com; SET timestamp=1759117547; DELETE FROM ey_weapp_spider_visit WHERE id < 473067 OR add_time < 1756525542; # Time: 250929 11:48:03 # User@Host: www_50yu_com[www_50yu_com] @ localhost [127.0.0.1] Id: 18038 # Query_time: 6.515609 Lock_time: 0.000031 Rows_sent: 208 Rows_examined: 208 SET timestamp=1759117683; SHOW TABLE STATUS; /www/server/mysql/bin/mysqld, Version: 5.6.50-log (Source distribution). started with: Tcp port: 3306 Unix socket: /tmp/mysql.sock Time Id Command Argument # Time: 250929 11:59:45 # User@Host: www_50yu_com[www_50yu_com] @ localhost [127.0.0.1] Id: 1462 # Query_time: 7.202949 Lock_time: 0.370979 Rows_sent: 0 Rows_examined: 5002 use www_50yu_com; SET timestamp=1759118385; DELETE FROM ey_weapp_spider_visit WHERE id < 476294 OR add_time < 1756526377; # Time: 251007 14:45:37 # User@Host: www_50yu_com[www_50yu_com] @ localhost [127.0.0.1] Id: 1148256 # Query_time: 3.912183 Lock_time: 0.316937 Rows_sent: 0 Rows_examined: 5012 SET timestamp=1759819537; DELETE FROM ey_weapp_spider_visit WHERE id < 1345471 OR add_time < 1757227533; /www/server/mysql/bin/mysqld, Version: 5.6.50-log (Source distribution). started with: Tcp port: 3306 Unix socket: /tmp/mysql.sock Time Id Command Argument /www/server/mysql/bin/mysqld, Version: 5.6.50-log (Source distribution). started with: Tcp port: 3306 Unix socket: /tmp/mysql.sock Time Id Command Argument