Questions about Proxmox/OpenVZ and Zimbra

philten

New Member
Feb 5, 2009
26
0
1
www.philten.com
Hello,

I installed quit a few Zimbra in Proxmox/OpenVZ CT. From this experience,
I found a configuration that have been working well for me (for about one year so far)

In short, I use a Centos 5 32bits template with 6 Gb (RAM + swap) allocated to the container,
and I manually increase the openvz beancounter "privvmpages".

I use the following rule of thumb (based on my experience only):
barrier = ((RAM + swap in Gb)+1) * 1000000
limit = ((RAM + swap in Gb)+1) * 1500000

For exemple, for 6Gb, I set barrier=7000000 and limit = 7500000

As I said, this settings seem to work but it definitively
triggers questions I would like to share here:

1) Why so much memory allocated by Java ?

The problem solved by increasing privvmpages seem to be that JAVA allocates a hudge
amount of memory which will never be used for most of it.
(reference :http://forum.proxmox.com/threads/1495-Proxmox-OpenVZ-memory-Java-VMs-and-Zimbra)

I keep an eye on the maxheld value of privvmpages, today I read 3320517
with is 13 Gb !!! (=3320517*4096)

In other words, ** 13 Gb ** where allocated by processes in the container (Java probably)
which own only 6 Gb. How is this possible ?

# cat /proc/user_beancounters
Version: 2.5
uid resource held maxheld barrier limit failcnt
103: kmemsize 52047165 54500815 9223372036854775807 9223372036854775807 0
lockedpages 0 0 786432 786432 0
privvmpages 1104091 3320517 5000000 5500000 0
physpages 340283 363624 0 9223372036854775807 0
vmguarpages 0 0 1572864 9223372036854775807 0
oomguarpages 340284 363625 1572864 9223372036854775807 0


2) Is there some drawbacks using such high values for privvmpages ?


3) I tried to guess how was calculated values listed on the bottom of page "Virtual Machine Configuration" in
the Proxmox Web Interface.

For exemple, for the VM above, I get these values:

Resource current maximum
Memory/Swap (MB): 4312 19531

(screen copy attached)

Again I am curious about this maximum of 19 Gb on 6Gb VM ?

If a Proxmox team member could let me know how these values
(current and maximum) are calculated it would be very appreciated ?


4) I noticed that if, in the Proxmox Web Interface, VM options are saved, "privvmpages"
is reset to match RAM and Swap. Of course, it then triggers problems with Zimbra on the
next VM restart.

Just a suggestion: if something could be done to avoid such reset in some futur release
it would great ? (I understand it is not that simple because I guess on some cases
the user would expects the reset to occur, I don't know ... just a suggestion).

Phil Ten
 

Attachments

  • zimbravz.JPG
    zimbravz.JPG
    76.6 KB · Views: 20
Last edited:
If a Proxmox team member could let me know how these values
(current and maximum) are calculated it would be very appreciated ?

take a look at the source of 'pvectl'

# less /usr/bin/pvectl

(see functio change_veconfig)
 
Thank you, I will check it.

Actually, it was not what I was looking for, but finally, with a few more tests,
I finally found :

Memory/Swap (MB)
currrent=privvmpages_held*4/1024
maximum=privvmpages_barrier*4/1024

Therefore the "Memory/Swap (MB)" reported in the web Interface is the memory
"allocated" and not "used". In case of a VM running Zimbra these two values
are very different.
 
Last edited:
I had nightmares to configure Zimbra on a debian 5 without a huge amount of privvmpages
until I found a way to start java with these parameters

/opt/zimbra/java/bin/java -server -XX:NewRatio=2 -XX:MaxPermSize=128m -Xmx512m -Xms512m
as found in these explanations here
http://wiki.zimbra.com/index.php?title=Performance_Tuning_Guidelines_for_Large_Deployments


  • mailboxd_java_heap_memory_percent: This variable determines the percentage of system memory that should be used for Java heap (ie, -Xms and -Xmx JVM option values are derived from this local config variable). The default value is 30% - if you have 8GB of RAM, you will end up with a 2.4GB heap size. It is important to know that the Java process size will be much bigger than the heap size you configure here - the JVM uses memory for other purposes as well, eg, see note about thread stack size above. We strongly recommend against increasing the heap size to more than 30% of system memory. However, there are many situations in which we recommend reducing the Java heap size:
    • If you have limited amount of memory (ie, < 8GB)
    • If you have more than just the mailbox service running on the server (eg, MTA/LDAP)
    • If you have a lot of memory. If you have 32GB, 30% is 9.3GB, reduce heap percent to 20. Beyond a Java heap size of 4-6GB, the system performs better if the memory is assigned to MySQL buffers instead.

  • mailboxd_java_heap_new_size_percent: New in ZCS 6.0. Percentage of Java heap that should be allocated to the young generation of Java heap. Default is 25%. This local config variable is used to determine the value of the -Xmn option of the JVM.
 
Thank you very much for your post ! The article you listed in reference clarified
many points I was investigating about for a long time.

In particular, I had the wrong idea it was not possible to control how java is started by Zimbra,
I am truly glad to learn it can be done.

Also, it pointed what I knew but forget which is that a 32 bits OS is limited to 4 Gb of RAM.
Actually, I just checked, in a Centos 5 32bit VM, top and meminfo report 8Gb of RAM
so I guess the template is PAE enabled.

I will shortly test these settings and hopefully will be able to avoid
the hudge privvmpages setting. That would be great.

Thanks again !

Phil Ten
 
Last edited:
A quick follow-up:

I tested these Java settings on a new VM based on a centos 5 64 bits template with 7Gb of RAM.

By default mailboxd_java_heap_memory_percent was set to 40, which is (surprisingly) above
the maximum recommanded value of 30.

In order to test with " -Xmx512m -Xms512m " I had to set mailboxd_java_heap_memory_percent to 8.

I left privvmpages to it's default value set by Proxmox/OpenVZ

Result: Zimbra didn't work correctly and failcnt for privvmpages increased.

Finally I used these settings which worked fine:
mailboxd_java_heap_memory_percent=20
privvmpages = (N+1) * 1000000

I was hoping to be able to keep privvmpages to it's default value, but it didn't work for me.
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!