Search This Blog

Tuesday, December 17, 2013

Linux performance tuning tips for MySQL

Linux performance tuning tips for MySQL:

Because most MySQL production systems probably run on Linux, I’ve decided to place the most important Linux tuning tips that will help improve MySQL performance. There is nothing new here, most of them are well known, however, I’ve decided to collect those Linux configuration tips into 1 blog post.
  • ext4 (or xfs), mount with noatime
  • Scheduler – use deadline or noop
  • Swappiness and NUMA:
  • Set numa interleave all
If using Percona Server we can place it into mysqld_safe script, as Percona Server supports NUMA control.
Jeremy Cole blog contains excellent overview of NUMA as well as additional NUMA tools
(and do not forget about innodb_flush_method=O_DIRECT)
Make sure there is no powersave mode enabled:
Check /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
and make sure it is not ondemand
Check /proc/cpuinfo and compare cpu MHz number to what is listed under the “model name”
Disable the “ondemand” if it is running
Example: “ondemand” is running on all the servers
and we have this:
In this case we will need to disable “ondemand”.
These simple Linux tuning tips will increase MySQL performance and make it more stable (and avoid swapping). I’m am also interested in hearing about your experience with different Linux configurations and MySQL. Please share those in the comments.

No comments:

Post a Comment