New on LowEndTalk? Please Register and read our Community Rules.
All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.
All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.
OpenVZ memory limits not working
linuxthefish
Member
in Help
Hi, I have created a new container in command line OpenVZ and have done "vzctl set ctid --ram 4G --swap 4G --save", yet still get out of memory errors. any ideas?
[root@server ~]# free -m
total used free shared buffers cached
Mem: 4096 4020 75 5 0 3956
-/+ buffers/cache: 63 4032
Swap: 4096 14 4081
And
[root@server tmp]# ./munch
Allocated 1 MB
Allocated 2 MB
Allocated 3 MB
Allocated 4 MB
Allocated 5 MB
Allocated 6 MB
Allocated 7 MB
Allocated 8 MB
Allocated 9 MB
Allocated 10 MB
Allocated 11 MB
Allocated 12 MB
Allocated 13 MB
Allocated 14 MB
Allocated 15 MB
Allocated 16 MB
Allocated 17 MB
Allocated 18 MB
Allocated 19 MB
Allocated 20 MB
Allocated 21 MB
Allocated 22 MB
Allocated 23 MB
Allocated 24 MB
Allocated 25 MB
Allocated 26 MB
Allocated 27 MB
Allocated 28 MB
Allocated 29 MB
Allocated 30 MB
Allocated 31 MB
Allocated 32 MB
Allocated 33 MB
Allocated 34 MB
Allocated 35 MB
Allocated 36 MB
Allocated 37 MB
Allocated 38 MB
Allocated 39 MB
Allocated 40 MB
Allocated 41 MB
Allocated 42 MB
Allocated 43 MB
Allocated 44 MB
Allocated 45 MB
Allocated 46 MB
Allocated 47 MB
Allocated 48 MB
Allocated 49 MB
Allocated 50 MB
Allocated 51 MB
Allocated 52 MB
Allocated 53 MB
Allocated 54 MB
Allocated 55 MB
Allocated 56 MB
Allocated 57 MB
Allocated 58 MB
Allocated 59 MB
Allocated 60 MB
Allocated 61 MB
Allocated 62 MB
Allocated 63 MB
Allocated 64 MB
Allocated 65 MB
Allocated 66 MB
Allocated 67 MB
Allocated 68 MB
Allocated 69 MB
Allocated 70 MB
Allocated 71 MB
Allocated 72 MB
Allocated 73 MB
Comments
Where are these memory errors, I only see the cached memory which isn't an issue.
I get out of memory errors when trying to do anything, (yum etc.).
Which UBC is generating fail counts? Should point you to the culprit.
The strange thing is I can use this method to manually create containers on my home server, and use --ram to set the limit without having to modify the bean thingys.
Setting privvmpages manually works, but then what are --swap and --ram for?
Ram should be physpages and swap swappages. The others are still relevant, no matter what the openvz project said about vswap replacing them (sometimes I think they don't know their own project). Sounds like your config of VZ has some awkward defaults.
privvmpages should be set to unlimited if you are using vswap. The problems comes from you using a ubc config then trying to set --ram/--swap. You need to use a vswap config file.
http://wiki.openvz.org/VSwap#Convert_non-VSwap_CT_to_VSwap
I think they know their own project lol. It says right on the vswap wiki page that those limits should be removed from the config file but you can still use them if you want.
If you use a UBC config file, those limits will still be in place. If you use a vswap config file, they won't be.