Mysql uses up all the RAM

svangils

Verified User
Joined
Jan 5, 2021
Messages
9
We have a server with a large number of databases (over 1000) in the databases all contain only a small amount of data.

Now we converted the server from an old server to a new server (with the latest DirectAdmin), and now we run into the problem that the RAM memory is constantly filling up because of MySql. The old server has 4GB ram and when I run a very large query the ram runs up to about 2 gb. When I run the exact same query on the new server the full 8gb of ram runs completely full and then the swapfile.

It seems that on the old server (older direct admin) somewhere it is set to allow MySQL to use x amount of ram maximum. Can that be correct? And where do I set that?

We already tried with innodb_buffer_pool_size but that seems to have no effect

Kindly regards,
Steff
 
Hello Steff,

You might review the default /etc/my.cnf and lower values in order to make MySQL to use less RAM.

Refer to the official docs for more information: https://dev.mysql.com/doc/refman/8.3/en/memory-use.html
Some best practices from Percona team can be found here: https://www.percona.com/blog/best-practices-for-configuring-optimal-mysql-memory-usage/
Some experience here: https://dba.stackexchange.com/questions/64055/how-to-reduce-mysql-memory-used

Use the suggestions on your own risk.
 
Back
Top