Use this script to optimize my.cnf:
http://www.day32.com/MySQL/tuning-primer.sh
Code:
wget http://www.day32.com/MySQL/tuning-primer.sh
This script will require bc:
Code:
apt-get install bc
To run script use:
Code:
sh tuning-primer.sh
Script will just show you tips about optimization, nothing will be changed. It's not my script.
Read carefully what is written in the section "memory usage".
My tips without script (in [mysqld] section):
Code:
key_buffer = 256M
max_connections = 30
table_cache = 512
query_cache_limit = 20M
query_cache_size = 32M
max_sort_length = 20
low_priority_updates=1
256M is 1024M (your linode RAM) * 25%, so if you have another RAM - change first value.
After any changes you will need to restart MySQL:
Code:
/etc/init.d/mysql restart
After optimization my.cnf, write in the command line: 'top', then 'c' and show the result (to clarify which process eats memory).