I am running MySQL 5.0.75 on Ubuntu on a dual core machine with 8 gigs of ram. I am running a Drupal 5 and Drupal 6 site of the database.
I am sure my MySQL config is not optimal but I am wondering if there is any low hanging fruit I can address. Here is the heart of the current setup.
New current setup (original one at the bottom). This is a dedicated machine, btw:
key_buffer = 2G
innodb_buffer_pool_size = 6G
innodb_additional_mem_pool_size = 16M
max_allowed_packet = 16M
sort_buffer_size = 128M
myisam_sort_buffer_size = 128M
read_buffer_size = 128M
join_buffer_size = 128M
read_rnd_buffer_size = 512M
thread_stack = 192K
thread_cache_size = 10
thread_concurrency = 8
innodb_thread_concurrency = 8
table_cache = 2048
query_cache_limit = 2M
query_cache_size = 128M
Old:
key_buffer = 16M
max_allowed_packet = 16M
thread_stack = 128K
thread_cache_size = 8
query_cache_limit = 1M
query_cache_size = 16M
expire_logs_days = 10
max_binlog_size = 100M
skip-federated
default-storage-engine = InnoDB
default-character-set = utf8
default-collation = utf8_general_ci
It looks like you are using InnoDB as your primary database engine type, but you configuration has no InnoDB configuration tuning options, which means you are using the defaults. These defaults, out of the box are sized for an 8Mb machine!
I recommend these settings as a basis and work from there
You didn't say if the php site was sharing the same machine as your db server, so you will have to be careful that MySQL doesn't consume so much physical ram that it causes the machine to swap.
I'd also recommend that you add these settings to low slow queries and queries with a poor query plan.
You're using InnoDB so your
innodb_buffer_pool
should be as big as you can make it (key_buffer
is the equivalent for MyISAM). 6GB should be an okay value on a 8GB machine.If you're doing lots of complex queries,
sort_buffer
andtmp_table_size
may also be worth increasing.