PDA

View Full Version : MySQL 5 my.cnf


mrnightowl
02-09-2008, 05:04 PM
Just looking for any suggestions for a test database server I'm putting up. The server has 1GIG memory 2.4ghz proc 80GIG SATA. Will be purely a database server. Right now my.cnf is empty besides skip locking and a couple others of that sort. I've just put it up so tuning-primer.sh is kind of pointless but just wanted to know if anyone had any suggestions for other variables with these specs. Thanks eh'

Here I'll add my old my.cnf haven't completely read through the changes for mysql 5 yet but this what I used on 4

[mysqld]
datadir=/var/lib/mysql
skip-locking
safe-show-database
query_cache_limit=1M
query_cache_size=32M
query_cache_type=1
max_user_connections=30
max_connections=500
interactive_timeout=10
wait_timeout=20
connect_timeout=20
thread_cache_size=128
key_buffer=32M
join_buffer=1M
max_connect_errors=20
max_allowed_packet=16M
table_cache=1024
record_buffer=1M
sort_buffer_size=1M
read_buffer_size=1M
read_rnd_buffer_size=1M
thread_concurrency=2
myisam_sort_buffer_size=64M
server-id=1

[mysql.server]
user=mysql
basedir=/var/lib

[safe_mysqld]
err-log=/var/log/mysqld.log
pid-file=/var/lib/mysql/mysql.pid
open_files_limit=8192

[mysqldump]
quick
max_allowed_packet=16M

[mysql]
no-auto-rehash

StupidRalph
02-10-2008, 09:37 AM
Perhaps this will help you on your way...
http://www.mysqlperformanceblog.com/files/presentations/OSDBCON2006-MySQL-Performance-Optimization.pdf

jeffatrackaid
03-20-2009, 08:29 PM
This type of tuning is highly application specific. For example, you ideally want your thread and table caches to be large enough to handle peak loads but not so large you are wasting resources. The same is true with the query cache (though it does not get allocated until it is used). Watch temporary table creation stats and look into adding slow query logging. Slow query logs can really help you find and fix bad queries.

http://dev.mysql.com/doc/refman/5.1/en/slow-query-log.html