Optimize MySQL my.cnf

Published on January 1, 2011, by in linux, sysadmin.




If you are using MySQL, it can help to optimize MySQL according to how much ram you have on your server.


Make these changes by editing: /etc/mysql/my.cnf

Ubuntu and most all distros include example config file settings based on your available ram. These examples are generally located in:

/usr/share/doc/mysql-server-5.1/examples/ ->
my-small.cnf.gz
my-medium.cnf.gz
my-large.cnf.gz
my-huge.cnf.gz

my-small.cnf is good for systems with extremely small memory (under 64MB!).

my-medium.cnf is good for systems up to 128MB of memory.

my-large.cnf is good for systems with 512MB of memory.

my-huge.cnf is good for systems with 1-2GB of memory or more, with most dedicated for mysql.


If desired, there are some performance analysis tools you can run, such as mysqltuner.pl and tuning-primer.sh.

In general it is probably good to keep mysql’s total memory footprint under 60% of total system memory. A good way to check this is to use this handy tool: http://www.omh.cc/mycnf.




Sweet!

No related posts.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Notify me of followup comments via e-mail. You can also subscribe without commenting.

Home linux Optimize MySQL my.cnf
© Copyleft scottlinux.com CC BY-SA 3.0