Plesk: Increase MySQL database performance

Plesk: Increase MySQL database performance

To increase the performance of the database in Plesk, there is a relatively simple way by setting up another cache, so to speak. All we need is enough available memory. In many cases, this should already result in slow database queries finally running faster.

To make the change the corresponding configuration file must be opened and adjusted, this is possible with vi or nano:

vi /etc/mysql/my.cnf

Then the following values must be added or adjusted under [mysqld]:

innodb_buffer_pool_size=1024M
query_cache_size=64M

After that, the database server must be restarted:

systemctl restart mysqld

If this also does not lead to any improvement, all existing databases can be additionally optimized, this is possible with the following command:

MYSQL_PWD=`cat /etc/psa/.psa.shadow` mysqlcheck -uadmin --optimize --all-databases

If the database server has been running for a few days, direct recommendations can also be retrieved using a tool. For this we install

apt-get install mysqltuner

the MySQL Tuner tool and then run it:

mysqltuner

Leave a Reply

Your email address will not be published. Required fields are marked *