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

Any opinions, news, research, analyses, prices or other information ("information") contained on this Blog, constitutes marketing communication and it has not been prepared in accordance with legal requirements designed to promote the independence of investment research. Further, the information contained within this Blog does not contain (and should not be construed as containing) investment advice or an investment recommendation, or an offer of, or solicitation for, a transaction in any financial instrument. LMAX Group has not verified the accuracy or basis-in-fact of any claim or statement made by any third parties as comments for every Blog entry.

LMAX Group will not accept liability for any loss or damage, including without limitation to, any loss of profit, which may arise directly or indirectly from use of or reliance on such information. No representation or warranty is given as to the accuracy or completeness of the above information. While the produced information was obtained from sources deemed to be reliable, LMAX Group does not provide any guarantees about the reliability of such sources. Consequently any person acting on it does so entirely at his or her own risk. It is not a place to slander, use unacceptable language or to promote LMAX Group or any other FX and CFD provider and any such postings, excessive or unjust comments and attacks will not be allowed and will be removed from the site immediately.