I'm completely fed up...

Lantizia

Renowned Member
Jun 29, 2009
79
0
71
Hey,

I've read loads of threads on this forum and on the Zimbra forum about getting it working on OpenVZ or Virtuozzo... this is NOT going to be another one of those threads. However I am going to use Zimbra as an example of the scenario I'm trying to a) understand and b) solve.

When you make an OpenVZ container you give it memory and swap, I now know it's an absolute fraud as OpenVZ containers don't actually have swap. So my understanding is that Proxmox gives the container a limit of whatever memory + swap equals which shows in the container as simply memory, however it guarantees that what you've set as memory on the Proxmox VE control panel will be available to that container.

Now according to the Zimbra web site if you're simply evaluating the product you can get away with 1GB of memory, and that's all I'd like to do at this stage. If however I set a RAM of 1GB and swap of 1GB, then the privvmpages failcnt increases whilst installing and starting up Zimbra... and Zimbra never loads properly. If I set privvmpages and/or set the memory/swap of the container to a stupidly high number then it still has some failcnt's too!

As a test I created a tiny KVM based virtual machine with only a (purposefully tiny - to make a point) 512MB of memory, installed a minimal Debian Lenny and it automatically assigned 1.5GB of swap. Zimbra installed on it perfectly.

So I'm assigning blame to OpenVZ. Now I know this is "container virtualization" and the benefits are "overselling" the resources of your containers as it shares the hosts disk, kernel, and memory... which is why I love OpenVZ. But what you also have to consider is that what software runs inside a container shouldn't have to be modified or tweaked in anyway (the only limitation is you can't have your own kernel).

My blame is also with Proxmox VE as it gives an illusion of swap size that isn't followed through when you look at it from the point of view of the container. Now I'm told 2.6.27 includes an option for --swappages which sounds good. To me this sounds like exactly the same configuration as before, only this time a program like Java running inside the container can properly judge what it's boundaries should be for resource allocation and maybe work better?

Or perhaps there is some other reason why OpenVZ just can't cut it, and this isn't a fix after all?

I welcome any and all debate on this, but please bear in mind I do not want to see any ideas that fall along the lines of...

- Giving the container a stupid amount of memory, swap, or privvmpages (which is the same isn't it?) when it shouldn't be needed as proved by the KVM machine.
- Garbage about how you don't like Zimbra or suggestions for alternatives.
- Reconfiguring Zimbra, Java, or any other container side software to behave differently when it shouldn't have to.
- Anyone telling me to ditch OpenVZ for something else in this matter.

If there is some magic OpenVZ setting I need to use to make it deal with memory requests/restraints better, in the way a typical real physical server or a KVM server would handle it... why isn't this set as default?

Sorry if I've come across a bit strong in this post, but I've had a hell of a time with this and it has wore my patience thin. :mad:

Steven.
 
Now I'm told 2.6.27 includes an option for --swappages which sounds good. To me this sounds like exactly the same configuration as before, only this time a program like Java running inside the container can properly judge what it's boundaries should be for resource allocation and maybe work better?

Yes, I guess that is the idea - please can you test that?
 
I'm not convinced that --swappages will solve this issue, it was just something I read in another thread. So ignore I said anything about it, unless you're sure it is the one and only fix I need for this problem and can say why it is so.

I still need some input on this issue.
 
Me too. So far I've surrendered to the fact that I have to set 4092 ram + 4092 swap to install Zimbra "OS" 32 bit properly. With 3072+3072 or 4092+0 Zimbra 6.04 and 6.07 (I tested with them, don't know about other releases) fail miserably at the end of the installation phase (usual error that Java is not able to alloccate required memory or something like that).
I'm also considering a KVM virtio machine for small installations, only would prefer OpenVZ because a) supereasy resize HD limits b) you can access container filesystem directly from host, just in case... c) higher performances.
Since Zimbra relies on Java, and Java has this problem, and Java should be enough widespread, I'm really confused by the fact the fact that OpenVZ have not jet implemented an easy "workaround" for make the VPS see a strict amount of RAM.
 
I know you said you didn't want to turn this into a solution thread but I have had some annoyances with heap size and memory with zimbra and open vz. I've only been using proxmox for 10 months or so but I ran 32bit zimbra under openvz for several years prior to that.

The only problem I've run into when running zimbra virtualised is running it in an OpenVZ container that has for example 1GB or RAM allocated to it, but your entire machine actually has over 2GB in total system memory.

When the JVM searches for system limits it discovers the total system memory and sets the heap size into 'server' mode (greater than 2GB mode, allocates a larger heap) accordingly. Unfortunately this eats up most of the actual memory assigned to the container, and strangles zimbra. Manually setting the heap size in realation to the containers allocated memory solved the problem.

Other than this issue that seems related to how openvz reports system limits, I haven't had any issues with java and memory with zimbra in OpenVZ. I do run a tweaked userbeancounters setup from the original vanilla openvz container though, rather than what is set from proxmox.

Cheers.

-Mark
 
OK well I get the theory of ensuring Java doesn't calculate it's total heap size based on (what the Proxmox VE GUI sees as) swap. What I've done is make a KVM machine with 1GB RAM, debian gave it 1.8GB swap automatically... and true enough when installed Java is launched with 401MB (makes sense since the default value is 40% of the memory).

i.e. "ps aux | grep java" shows...
zimbra 28430 7.5 25.6 851464 263460 ? Sl 01:40 0:14 /opt/zimbra/java/bin/java -server --blah blah skip a few-- -Xms401m -Xmx401m --blah blah skip some more--

So I made an OpenVZ container, again with 1GB memory and 1.8 swap (however as we all know this means Java will try to take 40% of 2.8GB not 1GB)... and installed Zimbra but chose not to start it after installation/configuration was over.

Then ran these delightful commands...

su - zimbra -c "zmlocalconfig -e mailboxd_java_heap_memory_percent=14"
su - zimbra -c "zmlocalconfig -e mailboxd_java_heap_new_size_percent=9"
su - zimbra -c "zmcontrol start"

Now that brought the 40% value down to 14% and 25% to 9% (not sure if this second value is needed or not - but it can't hurt to decrease it)... which again gives about 401MB of Java heap space. But Java fails to load and the failcnt keeps going up.

Anyone successfully managed to get Zimbra to run without reconfiguring Proxmox VE / OpenVZ at all and didn't have stupidly high memory + swap?

This _shouldn't_ be a matter of reconfiguring Zimbra/Java anyway, it _should_ be a matter of OpenVZ handling memory management in a sensible way... but since there doesn't seem to be any sensible way until the alleged 2.6.32 KVM/OpenVZ kernel is compiled with --swappages support... then we have little options.

Steven
 
Last edited:
In short what I am asking is... has anyone managed to install Zimbra inside an unaltered OpenVZ container (i.e. no tweaking of values) that didn't have a silly amount of memory...

If yes... What exactly did you alter in Zimbra?
 
Why

are those command working for you ?

su - zimbra -c "zmlocalconfig -e mailboxd_java_heap_memory_percent=14"
su - zimbra -c "zmlocalconfig -e mailboxd_java_heap_new_size_percent=9"

Also, zimbra is nice to calculate java option but they should ask if we want to override there default value at install time ?

I'm running zimbra on 2 OpenVz server and they work fine But I had to change the memory settings in Zimbra.

Hopefully OpenVz will change they way they present memory to containers but in the mean time changing the % value in Zimbra is a good way to make that all happend, No ?

Guillaume.
 
I'm running zimbra on 2 OpenVz server and they work fine But I had to change the memory settings in Zimbra.

What did you change in Zimbra? Specific details if you can as everything I have tried has not worked.
 
ok,

first of all I was asking if the % change has worked for you since I had to give lot of ram to zimbra container.

I'm running Ubuntu server as a container on top of Centos with OpenVz.

Zimbra version = 5.0.16_GA_2921.UBUNTU8

It has been a very long time since I have installed this the first time, so I'm connecting right now to the Hardware Server

Here is the value that I have changes for the container

KMEMSIZE="21377049:31377049"
PRIVVMPAGES="1073741824:1610612736"
NUMPROC="500:500"
NUMTCPSOCK="500:500"
TCPSNDBUF="2720320:3703360"
TCPRCVBUF="2720320:3703360"
NUMOTHERSOCK="460:460"


The rest is the default container. I know that MySql also use a lot of memory on Zimbra and I did not get good result when I try to lower Mysql default value ...

I try this but not sure if it worked http://wiki.zimbra.com/index.php?title=Making_Zimbra_run_on_minimal_RAM

I think I ended up giving almost 100 % of the server resources to that container since I only run Zimbra on that hardware node it''s ok for us.

If you need more info let me know, or if you find way to use less ressource for zimbra let us know.

What are you seeing ? Zimbra wont start ? DO you have error messages ?

Good luck !

Guillaume
 
Hi,

Can you tell us how you did this

"Manually setting the heap size in realation to the containers allocated memory solved the problem."

Thanks
 
Hi bougui,

Thanks for your information, was hoping when you said "I had to change the memory settings in Zimbra." you meant that it was solely the memory settings of Zimbra inside the container only. If I leave the container with defaults (on say 1GB memory and 1.8GB swap as documented above) and use my commands then the failcnt still goes up and when starting Zimbra for the first time the Java virtual machine fails to start.

I don't want to modify Zimbra, this is a problem for OpenVZ really. While we wait for the new OpenVZ/KCM kernel however I don't mind modifying Zimbra if it's just a few tricks so it doesn't use up too much memory.

What I don't want to do is modify both OpenVZ AND Zimbra... that's just overkill and by all the examples I've seen so far requires a stupid memory limit for Zimbra.

Steven
 
So we need to wait for the 2.6.32 OpenVZ kernel - I hope we can compile one next month.

Hey dietmar,

Any news on this kernel? it's been over a month now - no pressure hehe!

I'd just love to give Zimbra a try properly without worrying about all of this on an OpenVZ machine
 

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!