Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


OpenVZ memory limits not working
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.

OpenVZ memory limits not working

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.

  • @rethinkvps said:
    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.).

  • jarjar Patron Provider, Top Host, Veteran
    edited February 2015

    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.

    root@server [/]# cat /proc/user_beancounters
    Version: 2.5
           uid  resource                     held              maxheld              barrier                limit              failcnt
          101:  kmemsize                 10366766             13160448             14372700             14790164                    0
                lockedpages                     0                    8                 2048                 2048                    0
                privvmpages                 50784                69632                65536                69632                22460
                shmpages                      641                 1425                21504                21504                    2
                dummy                           0                    0  9223372036854775807  9223372036854775807                    0
                numproc                        47                   69                  240                  240                    0
                physpages                  461235              1048576                    0              1048576                    0
                vmguarpages                     0                    0                33792  9223372036854775807                    0
                oomguarpages                19583                31676                26112  9223372036854775807                    0
                numtcpsock                     23                   38                  360                  360                    0
                numflock                        4                   13                  188                  206                    0
                numpty                          2                    3                  100                  100                    0
                numsiginfo                      0                   24                  256                  256                    0
                tcpsndbuf                  137472               427544              1720320              2703360                    0
                tcprcvbuf                  144880              1322472              1720320              2703360                    0
                othersockbuf               133320               152592              1126080              2097152                    0
                dgramrcvbuf                     0                 5648               262144               262144                    0
                numothersock                   77                   86                  360                  360                    0
                dcachesize                3623237              3624960              3409920              3624960                    0
                numfile                       831                 1050                 9312                 9312                    0
                dummy                           0                    0  9223372036854775807  9223372036854775807                    0
                dummy                           0                    0  9223372036854775807  9223372036854775807                    0
                dummy                           0                    0  9223372036854775807  9223372036854775807                    0
                numiptent                      82                   82                 1000                 1000                    0
    
  • Setting privvmpages manually works, but then what are --swap and --ram for?

  • jarjar Patron Provider, Top Host, Veteran
    edited February 2015

    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

  • vdnetvdnet Member
    edited February 2015

    Jar said: 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.

    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.

Sign In or Register to comment.