Question about memory settings [message #10595] |
Fri, 23 February 2007 11:13  |
sledge_hammer
Messages: 2 Registered: February 2007
|
Junior Member |
|
|
Hello,
I am running a testserver (one external IP) at a french server.
My current settings are: 256MB RAM, 768MB SWAP.
My intentions are to install 3 VEs,
1. Webserver
2. SQL
3. Mail (Postfix)
I use these memory settings:
1st VE
vzctl set 100 --privvmpages 240M:245M --save
vzctl set 100 --vmguarpages 96M:2147483647 --save
vzctl set 100 --oomguarpages 240M:2147483647 --save
2nd VE
vzctl set 101 --privvmpages 240M:245M --save
vzctl set 101 --vmguarpages 64M:2147483647 --save
vzctl set 101 --oomguarpages 240M:2147483647 --save
finally 3rd VE
vzctl set 102 --privvmpages 240M:245M --save
vzctl set 102 --vmguarpages 64M:2147483647 --save
vzctl set 102 --oomguarpages 240M:2147483647 --save
OS for node and VEs: Debian Etch
I experienced some "can´t allocate enough memory" error messages during Apache2 installation by apt-get. I try to compile Apache2 manually incl. php5, it works fine without any errors in user_beancounters.
Lighttpd is ok as well (I prefer Lighttpd due low memory).
My question to you all is, are these memory settings above ok or do you have recommendations regarding these settings?
Hints and comments about are welcome!
TIA
Sledge_Hammer
|
|
|
Re: Question about memory settings [message #10598 is a reply to message #10595] |
Fri, 23 February 2007 13:08   |
rickb
Messages: 368 Registered: October 2006
|
Senior Member |
|
|
This error: "can´t allocate enough memory" means your VE has exhausted the privvmpages UBC. You can verify by checking the failcnt column of privvmpages in /proc/user_beancounters of the VE.
No one can tell you how much privvmpages to give the VE. It is the same question as "how much ram should I put in this physical server"? The answer is always "as much as you can afford". So, in this case, how much you can afford is how much physical ram the HN has.
For example, if your HN has 8GB of ram and 10 VEs and you anticipate each using 256MB on average, you can safely set privvmpages to 3-4GB for each VE and vmguar/oomguar to 256MB. This guarantees each VE 256MB of ram for its applications and allows each to use up to 3-4GB of ram while no other VEs need it for their 256MB. So, for anyone to intelligently answer your question, they would need to know the details about your applications and their memory requirements. If you are selling the VE space, you need to figure out how much each is guaranteed and base usage off that number.
------------------------------------------
+8GB total
+10 VEs
+256MB avg use / guarantee on each VE
10*256 = 2.5GB used for VE guars
8GB-2.5=5.5GB mem left over
The 10 VEs together will have on average, 5.5GB of burstable memory (above their 256MB) guarantee. 3-4GB privvm in my example above is less then 5.5GB by design. This means one VE can't starve the system memory at all. Adjust your numbers accordingly.
------------------------------------------
Hope this points you in the right direction!
Rick Blundell
-------------
Common Terms I post with: http://wiki.openvz.org/Category:Definitions
UBC. Learn it, love it, live it: http://wiki.openvz.org/Proc/user_beancounters
[Updated on: Fri, 23 February 2007 13:11] Report message to a moderator
|
|
|
Re: Question about memory settings [message #10600 is a reply to message #10598] |
Fri, 23 February 2007 16:15  |
sledge_hammer
Messages: 2 Registered: February 2007
|
Junior Member |
|
|
rickb wrote on Fri, 23 February 2007 08:08 |
-SNIP-
For example, if your HN has 8GB of ram and 10 VEs and you anticipate each using 256MB on average, you can safely set privvmpages to 3-4GB for each VE and vmguar/oomguar to 256MB. This guarantees each VE 256MB of ram for its applications and allows each to use up to 3-4GB of ram while no other VEs need it for their 256MB. So, for anyone to intelligently answer your question, they would need to know the details about your applications and their memory requirements. If you are selling the VE space, you need to figure out how much each is guaranteed and base usage off that number.
Rick Blundell
|
Hello Rick
many thanks for your quick reply to my question. May I should explain my intension further a bit.
My HN have 256MB only, it is a testserver.
I want run 3 VE.
The first VE should be the webserver (Lighttpd) with a small homepage/download area.
second VE the MySQL server, connected via TCP/IP to webserver and third VE, my Postfix Mailserver.
All I want to know is, the difference between running all services in chroot areas or virtualized (Xen or OVZ).
With my settings I intended 240MB burstable memory for all VEs. It isn´t very much memory, that is conscious to me!
Anyway, your reply makes sense to me.
Greetz Sledge
|
|
|