MYSQL high CPU usage

My observations for what it's worth -

Leave swapiness=1, don't set it to zero, see here:


This is one of the more important sections, look carefully at what this is saying:

[--] Total buffers: 169.0M global + 65.1M per thread (151 max threads)
[--] P_S Max memory usage: 72B
[--] Galera GCache Max memory usage: 0B
[!!] Maximum reached memory usage: 7.0G (195.02% of installed RAM)
[!!] Maximum possible memory usage: 9.8G (270.84% of installed RAM)
[!!] Overall possible memory usage with other process exceeded memory
[OK] Slow queries: 0% (0/19M)
[OK] Highest usage of available connections: 71% (108/151)

For each connection / thread, you consume 65.1M and your system is configured so it will accept 151 threads
WIth your (global) of 169.0M, you will consume at 151 threads
169.1M + 65.1M x 151, or 9.8G of memory, you only have around 1.8G free. You also had 108 threads running at one time. So the database is going to swap, it has to because you're using

169.1M + 65.1M x 108, or 7.0G

If I were running that server, I would turn max connections down to something closer to 25. Anytime you get above this value, it's going to start to swap.

Quite frankly, @Zhenyapan looks like they were giving you the best advice (again, from my perspective)
 
This is an automated message notifying you that the 5 minute load average on your system is 11.12. This has exceeded the 10 threshold.
 
Back
Top