Zimbra OCS on a OpenVZ VPS Server
I recently went and brought a VPS from burst.net Basic specs are 2x 2500Mhz CPU cores, 2.5gb guaranteed memory (no burstable).
This should be more then enough I though to run Zimbra OCS after all I have it up and running in a Test VM running on ESXi with only 1gb of memory and 1 cpu core.
What I did not release is that when a Java server process starts up, you can define how much memory it grabs and what size of memory chunks it asks for. Out of the box install of Zimbra optimise’s it self for the total amount of system memory in my case 2.5gb. So when the ZImbra application stack goes to start on my OpenVZ VPS it comes up with an fail ” Can not create Java Virtual machine, out of memory”
Out of memory wtf!
The Java stack expects to be able to grab a contiguous chunk of memory, in my case 1.5gb. Because of the underlying OpenVZ and the way it handles memory its not possible for a OpenVZ VPS instance to have a contiguous block of memory.
Hence why the JVM was crashing, Originally it was asking for 3x 512mb blocks of contiguous memory.
My VPS could not do this, you could edit the OpenVZ settings to allow bigger “chunks” of memory to be offered up. Since I have no control over this I had to tell Java to ask for more lots of smaller chunks of memory.
If your trying to get around the errors. Do the following.
Commands to type are in italics
1) Install Zimbra but do not start any of the services and or application stack after configuration.
2) Change to the zimbra user and enter the following commands.
# su – zimbra
# zmlocalconfig -e mailboxd_java_options=”-server -Djava.awt.headless=true -XX:+UseConcMarkSweepGC -XX:NewRatio=2 -XX:PermSize=128m \
-XX:MaxPermSize=128m -XX:SoftRefLRUPolicyMSPerMB=1 -Xms128m -Xmx128m”
# zmlocalconfig -e tomcat_java_heap_memory_percent=5
# zmlocalconfig -e zmmtaconfig_interval=3600
# zmlocalconfig -e zmstat_interval=300
# zmlocalconfig -e mailboxd_java_heap_memory_percent=5
# zmlocalconfig -e mailboxd_java_heap_new_size_percent=5
# zmlocalconfig -e ldap_common_threads=16
# zmlocalconfig -e ldap_common_toolthreads=8
# zmlocalconfig -e ldap_db_cachesize=50000
# zmlocalconfig -e ldap_db_idlcachesize=50000
# zmlocalconfig -e ldap_db_dncachesize=0
# zmlocalconfig -e zimbra_zmjava_options=”-Xms128m -Xmx128m”
# zmprov mcf zimbraMessageCacheSize 5000
3)
Now we need to tune some of the non Zimbra apps, Change back to the root user for this.
Edit the following files
# nano /opt/zimbra/conf/amavisd.conf.in
Edit the folowing
“$max_servers =10″ and set it to “$max_servers =2″
# nano /opt/zimbra/conf/my.cnf
Edit/add the following
“innodb_buffer_pool_size =” to “innodb_buffer_pool_size = 144245094″
“thread_cache = ” to “thread_cache = 5″
“max_connections = ” to “max_connections = 15″
I’ve now got Zimbra OCS up and running in a VPS. So far its been very stable and preforms quite fine for my work load.
References for the above :-
http://wiki.zimbra.com/index.php?title=Making_Zimbra_run_on_minimal_RAM
http://wiki.zimbra.com/wiki/CLI_zmlocalconfig_%28Local_Configuration%29
http://www.zimbra.com/docs/ne/latest/administration_guide/zmlocalconfig.html
http://docs.sun.com/source/817-2180-10/pt_chap5.html
22/11/2010 at 12:23 am
[...] Zimbra OCS on a OpenVZ VPS Server [...]
30/04/2011 at 3:01 am
[...] [...]
17/09/2011 at 11:53 pm
Given you had a MYSQL error i don’t think it was my guide. I have responded in the topic you posted.
12/07/2011 at 3:41 am
Good Submission,
Very rarely do you get as good a set of clear views on the Web-Hosting industry. Well Done!
appreciate the read! Will read again!
13/07/2011 at 8:42 am
Very good information, though, i have a problem: every single time i try to install Zimbra, at the end of the instalation it tries to start the services (i cant find a way to prevent it) and that messes up the VM, so i cant run the commands aftwerwards(keeps saying cannot create virtual machine), so i try restarting the VPS and the VM is still messed up(i guess becouse it tries to start up zimbra again), what can i do in this scenario?
17/09/2011 at 11:40 pm
Thanks for the feedback,
Please keep reading more to come on Zimbra as well.
17/09/2011 at 11:42 pm
Carlos,
Ensure Zimbra will not start.
Then start the mysql and ldap services.
You can then make the changes.
I ran into the same issues.