How to properly set memory limits [message #629] |
Thu, 29 December 2005 15:36 |
rsaylor
Messages: 43 Registered: December 2005
|
Member |
|
|
I am trying to set a VPS to use 128 MB RAM but not sure if this is the correct setting. My overall goal is to get WHM/cPanel to work. However, anytime I do something in shell like compile apache or goto secure more on WHM the system just looses it and WHM/cPanel does not work, get just a blank page.
vzctl set ID --vmguarpages=32768 --save
If my calculations are correct each integer equals 4 KB so the value above should equal 128 MB. Does anybody know if this is the proper way to set memory limits and usage? I have read the pdf docs pretty well but kinda confused on this area for memory.
|
|
|
Re: How to properly set memory limits [message #630 is a reply to message #629] |
Thu, 29 December 2005 17:51 |
dev
Messages: 1693 Registered: September 2005 Location: Moscow
|
Senior Member |
|
|
check the last column in output of `cat /proc/user_beancounters`
this column contains number of resource rejects. if it is more than zero than you have a too much strong limit for this resource, so you can increase it via `vzctl set ...`
[Updated on: Sat, 07 January 2006 13:20] by Moderator Report message to a moderator
|
|
|
Re: How to properly set memory limits [message #631 is a reply to message #630] |
Thu, 29 December 2005 18:01 |
rsaylor
Messages: 43 Registered: December 2005
|
Member |
|
|
21652824: kmemsize 1842939 2463286 2457600 2621440 52
lockedpages 0 8 32 32 0
privvmpages 42222 53573 49152 53575 1209
shmpages 91 1371 8192 8192 0
dummy 0 0 0 0 0
numproc 50 65 65 65 219
physpages 20670 35551 0 2147483647 0
vmguarpages 0 0 444416384 444416384 0
oomguarpages 20670 35551 6144 2147483647 0
numtcpsock 23 38 80 80 0
numflock 1 7 100 110 0
numpty 0 3 16 16 0
numsiginfo 0 32 256 256 0
tcpsndbuf 0 69068 319488 524288 0
tcprcvbuf 0 320700 319488 524288 1
othersockbuf 11140 53036 132096 336896 0
dgramrcvbuf 0 128280 132096 132096 850
numothersock 11 37 80 80 0
dcachesize 163590 249690 524288 548864 0
numfile 712 948 1280 1280 0
dummy 0 0 0 0 0
dummy 0 0 0 0 0
dummy 0 0 0 0 0
numiptent 0 0 128 128 0
So it looks like I just need to increase kmemsize, privvmpages, numproc, tcprcvbuf and dgramrcvbuf
[Updated on: Sat, 07 January 2006 13:20] by Moderator Report message to a moderator
|
|
|
|
|
Re: How to properly set memory limits [message #719 is a reply to message #633] |
Sat, 07 January 2006 13:30 |
|
What you've done is a bit incorrect. See, there is a barrier and a limit for each resource -- for some resources like kmemsize barrier is not equal to limit, so you should scale them up accordingly.
In your particular case, you should have used something like this (I have taken all the parameter's values from /proc/user_beancounters output you have have provided and doubled all the values):
vzctl set NNN \
--kmemsize 4915200:5242880 \
--privvmpages 98304:107150 \
--numproc 130 \
--tcprcvbuf 638976:1048576 \
--dgramrcvbuf 264192 \
--save
And the next very important thing to do is to validate the resulting configuration, to make sure it is consistent:
$ /usr/sbin/vzcfgvalidate /etc/sysconfig/vz-scripts/NNN.conf
Validation completed: success
If configuration is not valid, you'll get the suggestions of how to fix it.
Kir Kolyshkin
[Updated on: Sat, 07 January 2006 13:31] Report message to a moderator
|
|
|
Re: How to properly set memory limits [message #743 is a reply to message #629] |
Sun, 08 January 2006 18:15 |
rsaylor
Messages: 43 Registered: December 2005
|
Member |
|
|
Ok, I have altered my mem config a little. With this test below I do not get any conflicts anymore.
vzctl set 134148 --kmemsize 4915200:5242880 --privvmpages 98304:107150 --vmguarpages 98304:2147483647 --numproc 130 --tcprcvbuf 638976:1048576 --dgramrcvbuf 264192 --save
WHERE 134148 is the VPSID
|
|
|