Question
MySQL 100% CPU
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
×These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
×Definitely see if upgrading to a server with more cores helps.
Before you do that also try using Dynimizer. It will improve CPU efficiency for MySQL OLTP workloads. If you have a very high query/transaction rate then this will help. Will either boost throughput or reduce CPU usage, depending on where your bottle neck is. I’ve benchmarked speedups by up to 50%. Installation is a bash one-liner and because it’s software it’s a free solution and should be applied before upgrading your server. MySQL restart not even required. But you’ll need to increase swap space by 4 GB unless you have that much extra to spare or you have > 4 GB of unused RAM:
Install:
sudo bash -c ‘bash <(wget -O - https://dynimize.com/install) -default
Quickstart:
https://dynimize.com/blog/tutorials/beginner/dynimizer-quickstart-tutorial/
Good point but the install command above is missing a single quote at the end: ’
So it should be:
sudo bash -c ‘bash <(wget -O - https://dynimize.com/install) -default’
i have this problem.
server info:
Ubuntu 16.0.4
Harddisk 512 GB SSD 2.5
RAM 32GB
CPU Intel Xeon E3-1230v2
Connection 1GBit
Max. concurrent connections: 250
Max Online: 30
mysql usage: 301%
i use mysql 5.7
Apache
PHP7