Mysql optimisation.

Report bugs and workarounds
Post Reply
Michaelv
Posts: 16
Joined: 29 Apr 2014 14:01

Mysql optimisation.

Post by Michaelv »

Hi All,

This is not a bug but a suggestion. Its not exactly a how to either :)

I noticed that mysql has caching turned on, but is query_cache_size=0 which effectively turns it off.
(This seems to be the default Centos distribution settings).

I would suggest starting off with (in my.cnf), assuming that you have enough memory. (16Mbyte for various cache should not cause memory issues)
query_cache_size=16777216
tmp_table_size=16777216
max_heap_table_size=16777216
thread_cache_size=32
query_cache_limit=1048576
table_open_cache=128

You may or may not need to increase this, depending on your actual mail load.
I would suggest using these tools to figure out your requirements.

MysqlTuner.pl
https://raw.githubusercontent.com/major ... qltuner.pl

And mysql tuning primer.
https://launchpad.net/mysql-tuning-primer

Regards,

Michael
buzzzo
Posts: 94
Joined: 03 Feb 2014 09:09

Re: Mysql optimisation.

Post by buzzzo »

And most important.. Switch to innodb engine.
User avatar
shawniverson
Posts: 3649
Joined: 13 Jan 2014 23:30
Location: Indianapolis, Indiana USA
Contact:

Re: Mysql optimisation.

Post by shawniverson »

User avatar
pdwalker
Posts: 1553
Joined: 18 Mar 2015 09:16

Re: Mysql optimisation.

Post by pdwalker »

Also recommended:

Code: Select all

[mysqld]
innodb_file_per_table=1
This creates a separate file for each innodb table, which allows you to optimize and shink them separately.
Post Reply