3 Minute MySQL (tuning)
While reading planetmysql.org I ran across this Tune a MySQL server in 5 minutes.. I think that entry is really missing a lot in terms of actual tuning for the real world. Also I thought max_user_connections is number of connections per hour. Since I only have 3 minutes I can’t look it up! You probably don’t want to set this with apache.
So here in three minutes are the four variables you really need and some generic guidlines for setting them. This assumes that MySQL is running on it’s own server and has one apache server connecting to it.
It took me 5 mintues to write this entry so you should be able to implement it in 3 (ok maybe five or six). For a MySQL server serving only MyISAM tables this style of configuration will be good enough.
March 7th, 2006 at 2:41 pm
OK…. I’ll do you one better…. Tuning a mysql server in 1.672s.
Since I’m part of a team that manages +7,000 linux servers and since most of which have completely virgin my.cnf files, I wrote this little script.
http://www.day32.com/tuning-primer.sh
It evaluates the following:
slow query count
long_query_time
query_cache_size
% query cache actually used
max_connections
thread_cache
key_buffer_size
ratio of sort_merge operations to sorts (sort_buffer_size)
number of full joins
ratio of disk tmp tables vrs in memory tmp tables (tmp_table_size)
table_cache
ratio of table locks immediate to table locks waited
ratio of table scans (read_buffer_size)
To use the script add your user name and password to a [client] group in your ~/.my.cnf file
May 18th, 2006 at 2:45 am
HI Eric,
Can you please send me the tuning-primer.sh script. I am not able to see this at http://www.day32.com/tuning-primer.sh.
Thanks
June 5th, 2006 at 2:43 pm
Joy,
The URL has changed recently, http://www.day32.com/MySQL/tuning-primer.sh
July 13th, 2007 at 4:19 pm
[...] Eric Bergen » 3 Minute MySQL (tuning) (tags: mysql tuning performance tips 3-minutes) [...]
January 28th, 2008 at 10:50 am
The script http://www.day32.com/MySQL/tuning-primer.sh is just amazing !
thanks a lot !
Alex Devry
March 18th, 2008 at 5:17 pm
[...] Eric Bergen » 3 Minute MySQL (tuning) (tags: MySQL Optimization Tuning Guide performance script) [...]
June 16th, 2008 at 5:06 am
[...] background take a look at [ http://www.ibm.com/developerworks/library/l-tune-lamp-3.html ] and [ http://ebergen.net/wordpress/2006/03/06/3-minute-mysql-tuning/ [...]
September 7th, 2008 at 6:59 am
[...] Eric Bergen » 3 Minute MySQL (tuning) (tags: mysql script tuning performance) [...]