MySQL my.ini Performance and Optimization Tips

The major advantage of identifying the performance-driving factor for a database is that it allows you to avoid over-provisioning and reduce costs by right-sizing your servers. It also gives you insights into whether moving data storage or adding server capacity will improve performance and, if so, how much it will be.

The tuning database for MySQL query performance optimization doesn’t come with pale challenges. However, once tuned properly, the database gives worthwhile performance results with great functionalities. It lowers unwanted task load and optimizes the MySQL database for faster data retrieval.

I am sharing some of the parameters that have worked for me:

Database Server
my.ini setting

Other settings:

INNODB specific options


Additional memory pool, which is used by InnoDB to store metadata information. If InnoDB requires more memory it will start to allocate it from the OS. As this is fast enough on most recent operating systems, you normally do not need to change this value. SHOW INNODB STATUS will display the current amount used. Please increase this value slowly to see, if it takes affect for your performance problem.


If set to 1, InnoDB will flush (fsync) the transaction logs to the disk at each commit, which offers full ACID behavior. If you are willing to compromise this safety, and you are running small transactions, you may set this to 0 or 2 to reduce disk I/O to the logs. Set this value to 0 if you want to restore a database.


The size of the buffer InnoDB uses for buffering log data. As soon as it is full, InnoDB will have to flush it to disk. As it is flushed once per second anyway, it does not make sense to have it very large (even with long transactions). Make sense to increase if you do a database restore.


InnoDB, unlike MyISAM, uses a buffer pool to cache both indexes and row data. The bigger you set this the less disk I/O is needed to access data in tables. On a dedicated database server you may set this parameter up to 80% of the machine physical memory size. Do not set it too large, though, because competition of the physical memory may cause paging in the operating system. Note that on 32bit systems, you might be limited to 2-3.5G of user-level memory per process, so do not set it too high.