I am facing a memory overflow issue in one of my OpenVZ containers. While doing a vzctl enter 172
it gave an unable to allocate memory
error. The container is supposed to be configured for 3.5GB of memory.
The container configuration is as follows:
file: /etc/vz/conf/172.conf
ONBOOT="yes"
NAMESERVER="4.2.2.1"
CPUUNITS="1000"
CPUS="2"
CPULIMIT="80"
PRIVVMPAGES="914432:914432"
DISKSPACE="153600000:153600000"
QUOTATIME="0"
KMEMSIZE="86236200:88740984"
LOCKEDPAGES="256:256"
SHMPAGES="21504:21504"
NUMPROC="2000:2000"
PHYSPAGES="0:9223372036854775807"
VMGUARPAGES="524288:2147483647"
OOMGUARPAGES="26112:9223372036854775807"
NUMTCPSOCK="360:360"
NUMFLOCK="380:420"
NUMPTY="16:16"
NUMSIGINFO="256:256"
TCPSNDBUF="10321920:16220160"
TCPRCVBUF="1720320:2703360"
OTHERSOCKBUF="4504320:16777216"
DGRAMRCVBUF="262144:262144"
NUMOTHERSOCK="5000:5000"
DCACHESIZE="3409920:3624960"
NUMFILE="18624:18624"
AVNUMPROC="180:180"
NUMIPTENT="128:128"
DISKINODES="200000:220000"
VE_ROOT="/srv/vz/root/$VEID"
VE_PRIVATE="/srv/vz/private/$VEID"
OSTEMPLATE="ubuntu-10.04-minimal_10.04_amd64"
ORIGIN_SAMPLE="vps.2048"
HOSTNAME="host.xyz.com"
IP_ADDRESS="xx.xx.xx.xx"
Output for cat /proc/user_beancounters
Version: 2.5
uid resource held maxheld barrier limit failcnt
172: kmemsize 27229970 38669893 86236200 88740984 0
lockedpages 0 0 256 256 0
privvmpages 342879 396207 914432 914432 0
shmpages 3987 11152 21504 21504 0
dummy 0 0 0 0 0
numproc 96 109 2000 2000 0
physpages 211758 242535 0 9223372036854775807 0
vmguarpages 0 0 524288 2147483647 0
oomguarpages 211758 242535 26112 9223372036854775807 0
numtcpsock 30 47 360 360 0
numflock 122 125 380 420 0
numpty 1 1 16 16 0
numsiginfo 0 3 256 256 0
tcpsndbuf 692360 3389144 10321920 16220160 0
tcprcvbuf 210744 283744 1720320 2703360 0
othersockbuf 240448 564608 4504320 16777216 0
dgramrcvbuf 0 8224 262144 262144 0
numothersock 167 180 5000 5000 0
dcachesize 1052759 1122245 3409920 3624960 0
numfile 3700 3939 18624 18624 0
dummy 0 0 0 0 0
dummy 0 0 0 0 0
dummy 0 0 0 0 0
numiptent 10 10 128 128 0
Any help in finding the issue in the configuration would be extremely helpful.
Thanks
How much memory is on the host, is there actually 3.5GB of RAM spare ? Does it run with less than that (512MB for example) ?
cat /proc/user_beancounters
will show you which resources are being exhausted if it's been running in the past. Look for fail counts on the right.To give you an idea of tweaking resources if you haven't done so, one parameter I used to fix poor resource allocation with was:
vzctl set 101 --kmemsize $((11055923*2)):$((11377049*2)) --save
More on this on the OpenVZ Wiki
Are you seeing failcounts as @Jonathan Ross mentioned? Have you restarted the container?
You need to run the consistency check:
If it finds resource problems this tool can also fix them for you:
http://wiki.openvz.org/UBC_consistency_check