OpenVZ Forum


Home » General » Support » Calculating kmemsize (How do you calculate kmemsize?)
Re: Calculating kmemsize [message #37338 is a reply to message #37320] Thu, 03 September 2009 13:34 Go to previous message
dragos2 is currently offline  dragos2
Messages: 15
Registered: August 2009
Junior Member
damswf wrote on Wed, 02 September 2009 21:17
I agree, I just installed a web serveur in an openvz container, and i frequently have this problem. Either I can't do ps anymore, or i don't have a shell when I ssh, etc... instead I got "fork: Cannot allocate memory".

This is a pain for me since I wanted openvz to be more protected against hardware problems, and I have this headache instead.

Every time I grow up the kmemsize barrier limit, I see the maxheld increasing until behing greater to the barrier limit then I got some failcnt and errors.

This server is not at all under load now, but once it will be, it will be because of a lot of customers hitting the site (I cannot reproduce the same thing myself to test), and I cannot take the risk to have databases crashing nor losing data because of being unable to allocate kernel memory on a 8GB 64bits system (vc have 4GB).

And I have no clue what the values should be! I have kmemsize >= 40kB * avnumproc + dcache size but still the problem.

This is a serious issue for production servers.

So what do I do? I explain to my boss I just virtualized our servers and we have more problems although I explained him a few times ago that it will work better?



You can try other virtualization types like Citrix FreeXenServer
or even the opensource Xen(I don't have experience using Vmware
ESX).

But using OpenVZ as a webserver in full load I think the main things to consider are:

1) number of processes and files opened
openvz parameter for processes number 66535 is a huge number
also the number of open file descriptors should be at least
twice the threads your webserver spawns

2) tcp/ip buffers size, number of sockets. Pay attention to these both on HN and as new container parameters. Be sure
to reuse them fast

3) cpu power if you make use of cgi, fcgi etc.

The upper values should be configured both on HN and in
containers too.

If you set them only on one side, like only in HN or only
in container you won't gain anything.

This was from my little experience.

I hope it helps.
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Allocate more RAM to a VPS
Next Topic: [solved] Containers not respoding to their ips
Goto Forum:
  


Current Time: Mon Sep 01 12:05:19 GMT 2025

Total time taken to generate the page: 0.11811 seconds