开发者

Why would restarting MySQL make my site faster?

开发者 https://www.devze.com 2022-12-26 19:22 出处:网络
my site started dragging lately, the queries taking exceptionally longer than I would expect with properly tuned indexes. I just restarted the mysql server after 31 days uptime and every query is now

my site started dragging lately, the queries taking exceptionally longer than I would expect with properly tuned indexes. I just restarted the mysql server after 31 days uptime and every query is now substantially faster and the whole site renders 3-4 times faster.

Would there be anything that jumps out at you as to why this may have been? Improper settings on my.cnf perhap开发者_JS百科s? Any ideas as to what I can start looking at to try and pinpoint why?

thanks

updated note: I have a 16GB dedicated db box and mysql runs at about 71% of memory after a week or so.


Try to execute show processlist;, maybe there are some long lasting threads that were not killed for some reason.

Similarly execute SHOW SESSION STATUS LIKE 'Created%'; to check if mysql hasn't created to many temporary tables.

Server restart automatically closes all open temp tables and kills threads, so the application might run quicker.


Do you have temporary table(s) that might not be getting cleared/collected?


I would suggest using MySQL Enterprise for analysis purposes. It comes with a 30 day trial. We just used it. We got alerts such as :

CRITICAL Alert - Table Scans Excessive

The target server does not appear to be using indexes efficiently.

CRITICAL Alert - Connection Usage Excessive

CRITICAL Alert - CPU Usage Excessive

WARNING Alert - MyISAM Key Cache Has Sub-Optimal Hit Rate

Just something to explore!

0

精彩评论

暂无评论...
验证码 换一张
取 消