Friday, August 21, 2015

Best practices for tuning MySQL to run on Flash.

Written for PCIe SSD, however the suggestions should work for all SSDs.

http://cariapa.net/mysql_wp/mysql_best_practices.pdf

http://cariapa.net/mysql_wp/my.cnf

Stuff to remember in my.cnf:
max_connections = 30000
I was using the my.cnf file for a benchmark so needed to up max_connections to a massive number. Chances are you won't need do.

innodb_buffer_pool_size = 5G
Deliberately made this a tiny number because we wanted to avoid memory and go to SSD. You might want to up it a little.

open-files-limit = 8192
My benchmark opened and closed a lot of tables, which were created as separate files (innodb_file_per_table) Which is why I needed to up this number and tweak ulimits in limit.conf.

innodb_log_block_size=4096
4K was the block size of the SSD I was using. Match the log block size to this and you'll get great performance. Unfortunately it seems to be unique only to Percona.