Zimbra + OpenVZ

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

 

Extracted by http://lpig.wordpress.com/2010/07/11/zimbra-ocs-on-a-openvz-vps-server/

 

About fcacomputers

Just du it
This entry was posted in LINUX. Bookmark the permalink.

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s