Zimbra in a small box
Tinola was off the air for a couple of days due to a double fault. By which I mean I lost the primary and backup systems in the same powercut. Arguably they should have been in different datacentres. Nonetheless its unusual to get that unlucky, and now I'm considering how to move forward on the hosting front.
The new server is smaller than the old one, and after restoring from backup, getting Zimbra up and running required some manual tweaks. So this what I found out myself and from various other blogs and web pages on how to make Zimbra run on a low memory system.
The low memory system has 2 GB and gets light usage. There are other things running on the system, so we need to cut Zimbra down. This is for zimbra 7.x
1) Turn off unneeded services.
In the admin console->Server Settings->Services.
There are a bunch that can be turned off. If you don't care about anti spam or antivirus (particularly AV) then there are a lot of memory savings to be had there.
2) Reduce the number of amavis threads.
On lightly used servers they're sitting idle and eating RAM.
In /opt/zimbra/conf/amavisd.conf.in (and amavisd.conf) edit and change $max_servers = 2 from the default of 10.
$max_servers = 2; # number of pre-forked children (2..15 is common)
Tip found here: http://sun3.org/archives/68
3) Reduce the amount of memory mysql uses.
As zimbra.
zmlocalconfig -e mysql_memory_percent=15
The default can be much larger than that
Also reduce the number of connections in /opt/zumbra/conf/my.cnf
thread_cache_size = 30
max_connections = 30
There are plenty of google hits for tuning mysql out there.
4) Reduce the memory given to mailboxd
If there are only a couple of active mailboxes reduce the ram footprint for mailboxd.
zmlocalconfig -e mailboxd_java_heap_size=768
in bin/zmmailboxdctl the -Xmx and -Xmn sizes are computed from this.
Together that makes zimbra fit into 2 gig and share well with other programs.
Todays winner of the least obvious error message award is;
# service zimbra start
Host localhost
Unable to determine enabled services from ldap.
Enabled services read from cache. Service list may be inaccurate.
Starting ldap...Done.
Failed.
ldap_url and ldap_master_url cannot be the same on an ldap replica
That actually means you ran one of the zmlocalconfig commands as root. It should be run as zimbra
To fix;
# chown zimbra:zimbra /opt/zimbra/conf/localconfig.xml
HTH