

To apply the changes, restart the database server. Add the following line in the MySQL configuration file and restart the service. It is recommended to set this value on the server to 64M per GB of memory. The size of the maximum memory table capacity should be the same as the temporary table capacity to avoid disk writes. Max_heap_table_size is the variable used in MySQL to configure maximum memory table capacity. Restart the mysql service Advertisement $ systemctl restart mysql $ systemctl restart mariadb Set up the maximum memory table capacity. It is recommended to set this value on the server 64M per GB of memory. In MySQL/MariaDB, you can add the following variables in the configuration file to set up Temporary table size. If the size of the table exceeds the limit specified, it will be converted to a MyISAM table on disk. Tmp_table_size is the maximum space used for the built-in-memory table. It is recommended to set the packet value to the size of the largest packet. Setting up the max_allowed_packet too low can cause the query to be too slow. Max_allowed_packet defines the maximum size of the packets that can be sent. Restart the MySQL/MariaDB service and monitor the log $ systemctl restart mysql $ systemctl restart mariadb $ tail -f /var/lib/mysql/mysql-slow-query.log Set the maximum packet allowed by MySQLĭata is split into the packets in MySQL. The third variable defines the time to complete a MySQL query The second variable defines the log file directory Where the first variable enables the slow query log Slow-query-log-file= /var/lib/mysql/mysql-slow-query.log The slow query log can be enabled by adding the following lines in the MySQL/MariaDB configuration file. Logging queries that take a very long time to execute makes it easier to troubleshoot the database problems. $ mysql -u root -p mysql> set global max_connections=200 In this example, I have set the value to 200. The max_connections can be dynamically changed using the SQL query. For small websites, the connections can be specified to 100-200 and larger ones may need 500-800 and more. Too many connections result in high memory consumption as well as high CPU load. MySQL/MariaDB uses an instruction max_connections which specifies how many concurrent connections are currently allowed in the server. Set the maximum number of MySQL connections As the partition volume is made up of fast storage volumes, the performance will be faster. Even if your system will fail, you will have your database safe. The volumes are specifically for fast storage volumes such as SSD, NVMe.

When it comes to the point of optimization and assurance, it is always the best idea to store the database data in a separate volume. Store MySQL data in the separate partitions
#Mariadb 10 wordpress slow how to
In this article, I will explain how to speed up and optimize your MySQL and MariaDB database server. MySQL and MariaDB are the most widely used relational database management systems (RDMS) when it comes to website hosting and CMS systems such as Joomla, WordPress, Drupal, and Typo 3.
