Zimbra on a VPS: Tuning
Out of the box, Zimbra is tuned for a fairly beefy machine. Zimbra will easily consume 1.5GB of ram with default settings. Some of these changes mean turning off a few Zimbra features and there are quite a few ways to do this, so you will need to evaluate memory usage given your own situation. If you simply can't live without *all* the Zimbra features or intend to support a larger (> 15) number of users, my only suggestion is to get more ram ;). But if you are willing to make some compromises, please read on.
The changes below are ones that I found to be a reasonable compromise. With a few easy changes, you can bring the memory consumption way down, so that it will hum along just fine on a server with ~512MB of ram. Of course this reduces the amount of users that your server can support, but I've found that for a small installation of around 15 users, these settings will work just fine and give you the same performance as the out-of-the-box config with gobs of RAM. The server I have been testing with has 560MB of ram, and after tuning consumes all the ram and only about 80MB of swap on average. You will find that if you don't make changes similar to the ones suggested below with ~512MB of ram, your Zimbra install will slowly creep up its consumption of swap and your Zimbra install will start to crawl. Also, > 512MB seems to be about the minimum amount of ram to get a useful/zippy server.
After tuning: Typical memory usage
Mem: 553160k total, 538580k used, 14580k free, 14616k buffers
Swap: 1023992k total, 83484k used, 940508k free, 98672k cached
Tuning Steps
• Turn off anti-virus
• Turn off spell checking service
• Reduce the # of 'amavisd' (spam/virus) daemons
• Turn off unused services
Turning off Anti-virus
Although anti-virus checking is a "nice-to-have" feature, it is one of the largest consumers of ram on your Zimbra install. IMHO, virus checking (clamav) is necessary with a large number of users, but I've found that I can easily live without this feature given it's cost to memory and the size of my installation.
Turning off spell checking service
For me, spell checking is another service that I've found to be unncessary. As an avid Firefox user, I already rely on the built-in real-time spellchecking services of Firefox. The Zimbra spellchecker is a submit-n-check style system, which relies on a PHP service to be run in the backend to handle to the submission. Turning this off will free up a bit more ram and your browser may already give you an easier interface to work with anyways.
Turning off anti-virus and spell checking in the admin interface
Reducing the # of amavisd processes
The last step that will really reduce the amount of ram consumed by your Zimbra install is to limit the number of 'amavisd' processes. This daemon stays in memory and waits for both anti-spam and anti-virus jobs. The default number of processes is 10 and each process consumes about 40MB of memory, so, by default amavisd will consume around 400MB of ram! To reduce this, make the following change in /opt/zimbra/conf/amavisd.conf.in and restart your server. There are two files, amavisd.conf and amavisd.conf.in. Make your changes to the amavisd.conf.in file as this is replicated when zimbra starts up. Note that you cannot reduce this to less than 2 as you will sorrily miss anti-spam checking and the minimum is 2:
/opt/zimbra/conf/amavisd.conf.in
$max_servers = 2; # number of pre-forked children (2..15 is common)
Turn off unused servicesLastly, turn off any services that you don't intend to use. I don't use IMAP(s) or POP(s) services, so for me, it's not worth keeping them on. This is good practice, both to free up more ram and for security. These are controlled via their own tabs in the admin area under 'servers'.
Conclusion
So, with a little compromise, you can make your low-ram VPS or server work just fine with Zimbra. The key is to find those things that you are OK with disabling and reducing the amount of 'amavisd' processes.
Comments (0) 05/01/2008 08:51am