Useful MySQL/MariaDB Performance Tuning and Optimization Tips
Things you need to know: MySQL/MariaDB configuration file is located in /etc/my.cnf . Every time you modify this file you will need to restart the MySQL service so the new changes can take effect. For writing this article MySQL version 5.6 has been used as template. 1. Enable InnoDB file-per-table First it is important to explain that InnoDB is a storage engine. MySQL and MariaDB use InnoDB as default storage engine. In the past MySQL used to keep database tables and indexes in a system tablespace. This approach was meant for servers which sole purpose is database processing and their storage disk is not used for any other purposes. The InnoDB provides more flexible approach and each database information is kept in a .ibd data file. Each .ibd file represents a tablespace of its own. That way database operations such as “ TRUNCATE ” can be completed faster and you may also reclaim unused space when dropping or truncating a datab...