Memory Allocation Parameters / user_beancounters in Virtuozzo 2.6.2

Discussion in 'General Discussion' started by icontact, Aug 29, 2005.

  1. exothermic

    exothermic Mega Poster

    Messages:
    153
    fenster,

    You have been a great help here with the various bean counters. Could you please take the time to explain the various parameters of:

    vzmemcheck
    and
    vzcheckovr -v

    and how they relate to the three main mem beancounters you have talked about above?

    Thanks
     
  2. fenster

    fenster Tera Poster

    Messages:
    429
    These two programs just calculate low memory, virtual memory, and allocated memory utilization according to formulas presented in VzLinuxSLM.pdf. Tell me if you need detailed explanation of those parameters.
     
  3. scottdavey

    scottdavey Guest

    Great thread

    Thanks everyone for your contributions. I've learned a lot from this thread.
     
  4. PlatinumN23

    PlatinumN23 Bit Poster

    Messages:
    4
    I just wanted to give everyone my list of what I got..

    For RAM:

    For Space
    I Would hope you know where to put these values.. If not.. For Ram its "vmguarpages" For Space its "diskspace"

    I also have this in a Nice Excel sheet if anyone wants it?

    Thanks,
    Robert
     
  5. fenster

    fenster Tera Poster

    Messages:
    429
    If you use CLI, you can just do

    # vzctl set 101 --vmguarpages $((256 * MEGABYTES_OF_MEMORY)) --save

    256 is exactly 1024 * 1024 / 4096

    so for example, if we want to set 128 MB guarantee, we do

    # vzctl set 101 --vmguarpages $((256 * 128)) --save

    will help if you don't want to do maths :)

    P.S. I'm changing the subject of this thread to 'Memory Allocation Parameters / user_beancounters in Virtuozzo 2.6.2". Virtuozzo 3.0 has different memory management model (SLM) which should be discussed in another thread.
     
  6. mightymike

    mightymike Guest

    Hello!

    I've read this thread very interested. But what if my provider cannot handle the configuration?

    I also have problems with the privvmpages-parameter. I start a java - VM to run jetty like this: java -Xmx5m ....top tells me I am using about 25MB virtual memory, but the VPS goes nuts and tells me I reserverd about 41000 * 4kb pages, which is close to my limit. This makes about 159MB, which I am NOT using.

    So where is the problem? Any help appreciated, thanks.

    bye
    Mike
     
  7. net64

    net64 Kilo Poster

    Messages:
    17
    doing the math

    This is a great thread thanks Fenster...

    Ok here are my parameters:

    oomguarpages current usage - 15096
    othersockbuf current usage - 13320
    kmemsize current usage - 3659797

    my oomguarpages barrier - 65536

    My total is more than my oomguarpages...can you walk me through the math?

    net64
     
  8. geek.de.nz

    geek.de.nz Guest

    OK, this seems to be the thread I've been meaning to look for all day. So, thanks for all the maths etc.

    I don't really understand though. My problem is that I cannot compile programs in my vserver ( http://www.netfabrik.de ).

    I thought this is due to the fact that I've quite a few servers running (2 Apache servers, IMAP(s), POP3(s), PHP with allocated 24MB (for CMS Drupal), ...). Anyway, my
    /proc/user_beancounters:

    Code:
    Version: 2.5
           uid  resource           held    maxheld    barrier      limit    failcnt
       2066254: kmemsize        3578401    4593389    7056211    7761832          0
                lockedpages           0          0        344        344          0
                privvmpages       81885      85004      83239      91561    4037154
                shmpages            667        683      19567      19567          0
                dummy                 0          0          0          0          0
                numproc              42         63        128        128          0
                physpages         35927      44801          0 2147483647          0
                vmguarpages           0          0      18257 2147483647          0
                oomguarpages      46602      55399      21300 2147483647          0
                numtcpsock           63         84        172        172          0
                numflock              4         14        224        246          0
                numpty                1          1         16         16          0
                numsiginfo            0          4        512        512          0
                tcpsndbuf        183748     390316    1416560    2768240          0
                tcprcvbuf        985708    1420836    1416560    2768240     242614
                othersockbuf     141720     206828     655717    1153621          0
                dgramrcvbuf           0     212932     655717     655717          0
                numothersock         93        115        172        172          0
                dcachesize       655579     706594    1002127    1032191          0
                numfile            1398       1825       2240       2240         86
                dummy                 0          0          0          0          0
                dummy                 0          0          0          0          0
                dummy                 0          0          0          0          0
                numiptent            10         10         64         64         42
    
    I occasionally get errors like:
    Code:
    Inconsistency detected by ld.so: dl-minimal.c: 84: __libc_memalign: Assertion `page != ((void *) -1)' failed!
    
    when starting servers. Is this because I use too much memory? Why can't I just use a swap file? see http://www.redhat.com/docs/manuals/linux/RHL-8.0-Manual/custom-guide/s1-swap-adding.html

    Code:
    #swapon /swapfile
    
    gives
    Code:
    swapon: /swapfile: Operation not permitted
    
    It works on my home Linux machine but not on the vserver.

    Code:
    #free
    
    tells me:
    Code:
                 total       used       free     shared    buffers     cached
    Mem:       6216412    6125116      91296          0      50828    1467644
    -/+ buffers/cache:    4606644    1609768
    Swap:      8225200    6279388    1945812
    
    Hope someone can enlighten me here. Thanks in advance.
     
  9. gper

    gper Kilo Poster

    Messages:
    11
    /proc/user_beancounters

    Hello guys,
    although i change the vmguarpages parameter,
    the vzcheckovr still reports:

    Max Alloc Limit commitment 158.31% exceeds warning level (60.00%)
    Warning: node configuration is unsafe

    Is there something i must do to force the refresh of the /proc/user_beancounters file ?
    It seems that the vzcheckovr is not being updated

    Thank you
    Gper.
     
  10. net64

    net64 Kilo Poster

    Messages:
    17
    kmemsize and plesk standard

    Hi Alex,
    As you can see my kmemsize keeps failing, my hosting company is always trying to get me to upgrade. Which may be happening soon, but is there a Plesk Standard for settings? I'm wondering if I'm set below the standard.

    Version: 2.5
    uid resource held maxheld barrier limit failcnt
    1522: kmemsize 5991586 6009311 19192791 21112070 1046277
    lockedpages 0 0 937 937 0
    privvmpages 47990 48001 524288 954459 0
    shmpages 5923 5923 86769 86769 0
    dummy 0 0 0 0 0
    numproc 52 52 512 512 0
    physpages 28664 28669 0 2147483647 0
    vmguarpages 0 0 65536 2147483647 0
    oomguarpages 28665 28670 65536 2147483647 0
    numtcpsock 20 20 256 256 0
    numflock 3 3 748 822 0
    numpty 1 1 20 20 0
    numsiginfo 0 1 1024 1024 0
    tcpsndbuf 185588 185588 4480669 6397597 0
    tcprcvbuf 327680 327680 4480669 6397597 0
    othersockbuf 19680 19680 2240334 4157262 0
    dgramrcvbuf 0 0 2240334 2240334 0
    numothersock 19 19 386 386 0
    dcachesize 524210 527155 4718593 4718593 0
    numfile 1833 1842 12288 12288 0
    dummy 0 0 0 0 0
    dummy 0 0 0 0 0
    dummy 0 0 0 0 0
    numiptent 1098 1098 1500 1500 0
     
  11. 64bithost.com

    64bithost.com Tera Poster

    Messages:
    271
    oomguarpages

    Fenster has done a great job of explaining Mem Vs Swap. But what he has not alluded to is the fact that FASTLEARNER is running oldstye UBC and should have migrated to SLM.

    By looking at his output you can see that his oomguarpages is just about maxed out 59239/59367 therefore he has an initial memory problem that needs to be corrected by converting to SLM if FASTLEARNER is using HSPC (PBA) it is just a setting you can switch to under GENERAL SETTINGS on your Virtuozzo manager -> Nodes -> General Settings

    oomguarpages 59239 59367 125000

    Best Regards

    Chris
     
  12. MisterB

    MisterB Bit Poster

    Messages:
    5
    This thread is just great. Thank you all for your explanations. I have used the wisdom shared here to create a small executable that returns the memory details of my VPS for use with Cacti.

    I'm reviving the thread because I like to see my take on this confirmed. I like to create a graph with Cacti that shows total VPS memory usage by stacking kernel use, application use and allocated memory. I have come up with the following math to do this:

    Total memory allocated: privvmpages_held
    This is the total of all memory requested on the VPS (allocated and in use, both kernel and applications, both swap and ram)

    Total memory used: oomguarpages_held
    This is the total of all memory used (not allocated) on the VPS (both kernel and applications, both swap and ram)

    Memory allocated but not used: privvmpages_held - oomguarpages_held
    This is the memory allocated but not used on the VPS (both kernel and applications, both swap and ram but I guess only swap)

    Physical memory used: physpages_held
    This is the memory used on the VPS that exists in ram (both kernel and applications)

    Swap memory used: oomguarpages_held - physpages_held
    This is the swap memory used on the VPS (both kernel and applications, but I guess only applications)

    Kernel ram memory used: kmemsize_held
    This is the memory used by the kernel (ram)

    Application ram memory used: physpages_held - kmemsize_held
    This is the ram memory used by applications.

    Am I correct in this? If not, please correct me ;-)
     
  13. DrunkenM

    DrunkenM Bit Poster

    Messages:
    2
    It solves mine too.
     
  14. NemanjaC

    NemanjaC Bit Poster

    Messages:
    2
    old topic, but this is something I need :)
    I'm have to change some settings on virtuozzo admin (plesk version 8.6)
    Problem is that I dont even have config files and folders :S
    Or I cant find them. This is second day that I'm trying to find solution for this.

    I found some stuff online, but nowhere I can find how to apply config changes.
    Current config looks like this:
    Problem I'm having is that apache locks and I cant do anything when memory usage exceed 250MB. Server has 2GB :S

    I understood everything about change of settings, but would anything be affected if I change them in user_beancounters file ?
    Or I have to create some config files somewhere ?

    any help would be most appreciated.
    I would send you postcard from Belgrade (that is kind of capital of Serbia). Not in email.

    Tnx,
    Nemanja
     
  15. 64bithost.com

    64bithost.com Tera Poster

    Messages:
    271
    You might want to check your VMpages. Your MAXHELD and HELD are to close together and the barrier is to close to the MAXHELD.

    uid resource held maxheld barrier limit failcnt
    privvmpages 133526 133562 147456 162201 99767

    Chris
     
  16. NemanjaC

    NemanjaC Bit Poster

    Messages:
    2
    tnx for info Chris, but there the problem is.
    Where to change it ?

    I would do that, but like I wrote on start of my post, I dont have any of those config files in my folder.
     
  17. 64bithost.com

    64bithost.com Tera Poster

    Messages:
    271
  18. hoanganh

    hoanganh Bit Poster

    Messages:
    6
    If this sum of curr vals is 85% of the oomguarpages barrier value, it should send a mail to the root....prolly thats the time for an upgrade of services or taking a closer look at the VPS and checking what is the reason for such a rise of those values.

    Could you suggest something on this topic? Or do you think this exercise is really not necessary.
     

Share This Page