MySql my.cnf recommended settings

I see you have 64GB RAM, and its all for MySQL server, which is nice. First I would suggest increasing your cache sizes, tmp_tables, etc, you can search those on Google. If you are using InnoDB tables, I suggest you tweak those too. Below I will give some suggestions, but ultimately its up to you what to do, and the best you can do is read up and test out different configs.

To check config params, use this query, modify like part or omit it at all, this way you know for sure if your settings are there:

show variables like '%log%'; 

Skip name resolve, this will make mysql faster as it doesn't need to resolve DNS, be sure that you use IP addresses when connecting to you server afterwords:

[mysqld]
skip-name-resolve

Recommended giving 64M for both values for every 1 GB of RAM on the server. This boosts performance, change these values to your needs

tmp_table_size= 2000M
max_heap_table_size= 2000M
max_tmp_tables=300

Log slow queries, long_query_time is number of seconds for query to be long, adjust accordingly

[mysqld]
slow-query-log = 1
slow-query-log-file = /var/log/mysql-slow.log
long_query_time = 1

Some settings that you need to tweak I give below.

sort_buffer_size=10M 
read_buffer_size=10M 
table_open_cache=8000
query_cache_limit=50M
join_buffer=10M

These are generally the main settings you need to tweak, numbers here are for your reference only, you should change/tweak them accordingly. Read Mysql docs for meaning of the each of those.

IF you are running phpMyAdmin, there will be Database Status, go there and it will show you red flags. Other than that you can manually check up on some parameters like this: SHOW GLOBAL STATUS LIKE 'Opened_tables';

Once in a while check if you have fragmented tables or if they need repair. This command solves it:

mysqlcheck -u root --auto-repair --optimize --all-databases

Another userful tool is mysqltuner, install and run it too.

Hope this helps.

Tags:

Mysql