Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have an openvz node with only one container (Cpanel server). Yesterday I had many memories issues:

Unable to fork: Cannot allocate memory

Can someone help me to optimize my node setting ? I have a 4Gb node and I can use all node resources for the container.

This is my resources output:

cat /proc/user_beancounters 
Version: 2.5
       uid  resource                     held              maxheld              barrier                limit              failcnt
      100:  kmemsize                 20674962             43480374            419090432            460999475                    0
            lockedpages                     0                    7                20463                20463                    0
            privvmpages                230416              1045032               900000              1000000               363565
            shmpages                    11328                17450                30695                30695                    0
            dummy                           0                    0                    0                    0                    0
            numproc                       106                  161                10230                10230                    0
            physpages                  129958               885303                    0  9223372036854775807                    0
            vmguarpages                     0                    0               491520  9223372036854775807                    0
            oomguarpages               153680               906996               917504  9223372036854775807                    0
            numtcpsock                     56                  191                10230                10230                    0
            numflock                        7                   21                 1000                 1100                    0
            numpty                          1                    1                  512                  512                    0
            numsiginfo                      0                   31                 1024                 1024                    0
            tcpsndbuf                 1171104              4738832             97794730            139696810                    0
            tcprcvbuf                  917504              4212568             97794730            139696810                    0
            othersockbuf               139120              1841832             48897365             90799445                    0
            dgramrcvbuf                     0               147352             48897365             48897365                    0
            numothersock                   72                  110                10230                10230                    0
            dcachesize                      0                    0             91533669             94279680                    0
            numfile                      7101                 7630               163680               163680                    0
            dummy                           0                    0                    0                    0                    0
            dummy                           0                    0                    0                    0                    0
            dummy                           0                    0                    0                    0                    0
            numiptent                     421                  421                  400                  500                    0

It appears "privvmpages" parameter failed:

This is my node settting:

VERSION="2"

ONBOOT="yes"


NUMPROC="10230:10230"
AVNUMPROC="5115:5115"
NUMTCPSOCK="10230:10230"
NUMOTHERSOCK="10230:10230"
VMGUARPAGES="491520:9223372036854775807"

# Secondary parameters
KMEMSIZE="419090432:460999475"
TCPSNDBUF="97794730:139696810"
TCPRCVBUF="97794730:139696810"
OTHERSOCKBUF="48897365:90799445"
DGRAMRCVBUF="48897365:48897365"
OOMGUARPAGES="917504:9223372036854775807"
PRIVVMPAGES="900000:1000000"

# Auxiliary parameters
LOCKEDPAGES="20463:20463"
SHMPAGES="30695:30695"
PHYSPAGES="0:9223372036854775807"
NUMFILE="163680:163680"
NUMFLOCK="1000:1100"
NUMPTY="512:512"
NUMSIGINFO="1024:1024"
DCACHESIZE="91533669:94279680"
NUMIPTENT="400:500"
DISKSPACE="203811210:224192332"
DISKINODES="5000000:6000000"
CPUUNITS="139987"
VE_ROOT="/vz/root/$VEID"
VE_PRIVATE="/vz/private/$VEID"
ORIGIN_SAMPLE="1vs"

DISK_QUOTA="yes"
OSTEMPLATE="centos-5-x86_64"
IP_ADDRESS="xxx.xxx.xxx.xxx"
NAMESERVER="208.67.222.222 208.67.220.220"
HOSTNAME="xxx.xxxxxx.xxx"
QUOTAUGIDLIMIT="800"
DISKSPACE="204857600:215302400"
QUOTATIME="1200"
share|improve this question
    
What kernel version do you have? You may be able to run the new vswap style config - currenly only available on RHEL kernels. I haven't got a chance to try it out but it looks like it makes things way simpler. –  Aleksandr Levchuk Aug 30 '11 at 23:31

1 Answer 1

Multiply by 2 both fields in PRIVVMPAGES.

That is, replace

PRIVVMPAGES="900000:1000000"

with

PRIVVMPAGES="1800000:2000000"

or (no tested, but should work) with:

PRIVVMPAGES="6.8G:7.6G"

and restart the container.

share|improve this answer
    
thanks I'll try it. –  Roberto Sep 1 '11 at 0:19

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.