Optimize Zarafa and MySQL / MariaDB

Is your Zarafa installation up and running? Great job! If you haven’t thought about changing the default settings yet, then you’ve come to the right place.

Zarafas documentation gives you a good idea of how much system memory should be allocated to MySQL and Zarafa.

About 50% of the memory will be occupied by Zarafas and MySQL. About 20% should stay free. The size of the remaining 30% will determine how many users you’re able to serve. Please enter the amount of your system’s memory and change the recommended ratios so that at least 20% stays free.

I’ve had good experiences with the recommended settings. A prepared MySQL configuration with the fixed values can be found in pietmas repository.

All the following values are given in MB, which you might need to convert:

  • 0,25 MB (*1024) => 256 KB (*1024) => 262.144 Byte
  • 0,125 MB (*1024) => 128 KB (*1024) => 262.144 Byte
  • 0,0315 MB (*1024) => 32 KB (*1024) => 32.768 Byte
Zarafa Memory Calculator

System

Recommended Your value Ratio Working
Memory total 2048 MB

MB
Memory used 1525,864 MB 454,569 MB 89% =total instance
+ (total connection
* max_connections)
+ total zarafa
Memory free 522,136 MB 57,431 MB 11%
Zarafa users 9 1 =threads

MySQL – /etc/mysql/my.cnf

Parameter Default value Recommended Ratio Working
innodb_buffer_pool_size 128,000 MB 128,000 MB % =memory * ratio
innodb_log_buffer_size 8,000 MB 32,000 MB
key_buffer_size 128,000 MB 16,000 MB
query_cache_size 1,000 MB 32,000 MB
tmp_table_size 32,000 MB 32,000 MB
max_connections 100 3,00 % =floor(((memory
– total instance)
/ ratio) / total
connection; 0)
Total (each instance) 297,000 MB 240,000 MB
binlog_cache_size 0,031 MB 0,031 MB
join_buffer_size 0,125 MB 0,125 MB
max_allowed_packet 4,000 MB 16,000 MB
read_buffer_size 0,125 MB 1,000 MB
read_rnd_buffer_size 0,250 MB 0,250 MB
sort_buffer_size 2,000 MB 1,000 MB
thread_stack 0,281 MB 0,250 MB
Total (each connection) 6,812 MB 18,656 MB
innodb_log_file_size 48,000 MB 32,000 MB % =innodb_buffer
_pool_size * ratio
Total (filesystem) 48,000 MB 32,000 MB

Zarafa – /etc/mysql/server.cfg

Parameter Default value Recommended Ratio Working
cache_cell_size 256,000 MB 128,000 MB % =memory * ratio
cache_object_size 5,000 MB 0,100 MB
cache_indexedobject_size 16,000 MB 0,500 MB
cache_quota_size 1,000 MB 1,000 MB
cache_acl_size 1,000 MB 1,000 MB
cache_store_size 1,000 MB 1,000 MB
cache_user_size 1,000 MB 1,000 MB
cache_userdetails_size 25,000 MB 25,000 MB
cache_server_size 1,000 MB 1,000 MB
threads 8 1 =floor((max_conn
ections – 1)
/ 2; 0)
Total 307,000 MB 158,600 MB

Update
Beginning from zarafa 7.2.4 all values are calculated during first installation. Updaters can run the installed script

/usr/share/doc/zarafa/zarafa-pietma/install-optimization.sh

Links

Leave a comment

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.