Memory Allocation Parameters / SLM in Virtuozzo 3.0

Discussion in 'General Discussion' started by fenster, Feb 26, 2006.

  1. fenster

    fenster Tera Poster

    Messages:
    429
    It's time to create new sticky thread for discussion of new memory limitation model in Virtuozzo 3.0. Note that old UBC parameters are also supported.

    Virtuozzo Service Level Management (SLM) is a system that maintains and allows administrators to configure and control the levels of service (i.e., the set of 'promises') provided to VPS owners.

    SLM is described in a separate text file called VZLinuxNewSLM in the root of Virtuozzo 3.0 distro directory.

    How to enable it:

    1. Set SLM="yes" in /etc/sysconfig/vz, restart Virtuozzo:

    # service vz restart

    (all VPSs will be restarted)

    2. Enable it for your VPS:

    # vzctl set 101 --slmmode slm --save

    (another possible variants: 'ubc' for old-style memory management, 'both' for combined memory management)

    3. Setting limits:

    # vzctl set 101 --slmmemorylimit VALUE
    # vzctl set 101 --slmmemorylimit AVGVALUE:INSTVALUE

    In the second example we limit both average and instant memory limits.

    VALUEs are in bytes. You can use different multipliers such as:

    G for Gigabytes
    M for Megabytes
    K for Kilobytes
    P for Pages (4096 bytes)

    Examples:

    # vzctl set 101 --slmmemorylimit 256M
    limits memory usage to 256 megabytes

    # vzctl set 101 --slmmemorylimit 256M:512M
    limits average memory usage to 256 megabytes, allows using up to 512M.

    Example to demonstrate memory allocation:

    Code:
    #include <stdio.h>
    #include <stdlib.h>
    #include <string.h>
    
    #define SIZE (10 * 1024 * 1024)
    
    int
    main()
    {
            int counter = 0;
            for ( ; ; ) {
                    void *p = malloc(SIZE);
                    if (!p) {
                            printf("Cannot allocate more memory\n");
                            return (0);
                    }
                    memset(p, 0, SIZE);
                    counter += SIZE;
                    printf("Allocated %d bytes\n", counter);
            }
            return (0);
    }
     
  2. Cranky

    Cranky Guru

    Messages:
    2,657
    Hi Alex,

    I think you mean "all" instead of "both".

    I may be missing something, but I can't seem to locate any explanation what "all" actually does. I know it's a UBC/SLM combined mode, but what does that actually mean and do?
     
  3. graffix

    graffix Mega Poster

    Messages:
    118
    Can we set SLM throu VZMC Console?
     
  4. Cranky

    Cranky Guru

    Messages:
    2,657
    You can configure per-VPS resources via VZMC but you can't modify the nodes global resource management mode via it (you need to edit via shell and restart VZ).
     
  5. JohnB@

    JohnB@ Mega Poster

    Messages:
    158
    Hello All:

    After following fenster's instructions in post #1 here and issuning below command for our VPS 101 I see below values --- is this indeed what I should see?? Note that "barrier" and "limits" for almost everything are set to 2147483647 !!

    vzctl set 101 --slmmemorylimit 512M:1024M --save

    Outcome is this:

    cat /proc/user_beancounters
    --->>>>

    kmemsize 7511011 7518494 2147483647 2147483647 0
    lockedpages 0 0 2147483647 2147483647 0
    privvmpages 117713 117715 2147483647 2147483647 0
    shmpages 8841 8841 2147483647 2147483647 0
    dummy 0 0 2147483647 2147483647 0
    numproc 116 116 2147483647 2147483647 0
    physpages 46032 46034 2147483647 2147483647 0
    vmguarpages 0 0 2147483647 2147483647 0
    oomguarpages 46155 46157 2147483647 2147483647 0
    numtcpsock 53 54 2147483647 2147483647 0
    numflock 13 13 2147483647 2147483647 0
    numpty 0 0 2147483647 2147483647 0
    numsiginfo 0 1 2147483647 2147483647 0
    tcpsndbuf 41144 50056 2147483647 2147483647 0
    tcprcvbuf 4968 9244 2147483647 2147483647 0
    othersockbuf 40836 40836 2147483647 2147483647 0
    dgramrcvbuf 0 4276 2147483647 2147483647 0
    numothersock 24 24 2147483647 2147483647 0
    dcachesize 2407640 2412806 2147483647 2147483647 0
    numfile 3900 3903 2147483647 2147483647 0
    dummy 0 0 0 0 0
    dummy 0 0 0 0 0
    dummy 0 0 0 0 0
    numiptent 430 430 2147483647 2147483647 0


     
  6. TarkanVeKurdu

    TarkanVeKurdu Kilo Poster

    Messages:
    54
    I have the same problem . Something is wrong .

    vzctl set 304 --slmmemorylimit 256M:1024M --save



    VEID ST %VM %KM PROC CPU SOCK FCNT MLAT IP
    304 !! 2/276092 0.9/256 1/2147483647 50/98 /4294967294 0 1318



    cat /proc/user_beancounters

    304: kmemsize 6843049 6935525 2147483647 2147483647 2414
    lockedpages 0 0 2147483647 2147483647 0
    privvmpages 153511 158875 2147483647 2147483647 0
    shmpages 8497 8497 2147483647 2147483647 0
    dummy 0 0 2147483647 2147483647 0
    numproc 59 62 2147483647 2147483647 0
    physpages 66245 66414 2147483647 2147483647 0
    vmguarpages 0 0 2147483647 2147483647 0
    oomguarpages 66245 66414 2147483647 2147483647 0
    numtcpsock 32 37 2147483647 2147483647 0
    numflock 7 9 2147483647 2147483647 0
    numpty 0 0 2147483647 2147483647 0
    numsiginfo 0 1 2147483647 2147483647 0
    tcpsndbuf 68072 126844 2147483647 2147483647 0
    tcprcvbuf 0 2920 2147483647 2147483647 0
    othersockbuf 19180 167916 2147483647 2147483647 0
    dgramrcvbuf 0 0 2147483647 2147483647 0
    numothersock 34 36 2147483647 2147483647 0
    dcachesize 2609404 2615144 2147483647 2147483647 0
    numfile 4021 4065 2147483647 2147483647 0
    dummy 0 0 0 0 0
    dummy 0 0 0 0 0
    dummy 0 0 0 0 0
    numiptent 37 37 2147483647 2147483647 0
    [

    Regards
     
  7. timdorr@

    timdorr@ Bit Poster

    Messages:
    5


    I get the same thing, just higher (since we're usinga 64 bit system). It looks normal, as they basically ignore those values with SLM. I suggest using the "all" mode and setting things back at reasonable values :)
     
  8. madsere

    madsere Tera Poster

    Messages:
    352
    What is the point of making those half-baked sticky explanations and when people ask questions because they don't make sense there is no reply????
     
  9. Cranky

    Cranky Guru

    Messages:
    2,657
    Fenster is no longer with SWsoft which is likely why you haven't received a response. Remember, email/phone is the only official support channel.

    /proc/user_beancounters is only valid for UBC. If you are only using SLM you can ignore all memory related values in /proc/user_beancounters (such as vmguarpages & oomguarpages).
     
  10. madsere

    madsere Tera Poster

    Messages:
    352
    Well then SWsoft perhaps should consider hiring someone knowledgeable to follow this forum.

    Yes I know the only official support is from SWsoft - but they either don't reply to their calls or refer to this forum - which is actually how I ended back here.

    For the money we pay in license fees their support really lacks far behind!!
     
  11. Emerson@

    Emerson@ Kilo Poster

    Messages:
    43
    Ok I see now that after converting a VE to use SLM swap shows as 0k available.
    Anyway to fix this or is this how it is supposed to be now?

    PHP:
    Mem:   1048576k total,   166524k used,   882052k free,        0k buffers
    Swap
    :        0k total,        0k used,        0k free,        0k cached
     
  12. aeterna

    aeterna Bit Poster

    Messages:
    9
    This thread is nice however I can find no documentation on SLM.

    I know fenster said to look in the root directory of my distro but I am not seeing it anywhere. Can some provide me with a link to a pdf file. Im trying to look in the KnowledgeBase and on the site for it but I can't find it anywhere.
     
  13. ZionAhead

    ZionAhead Kilo Poster

    Messages:
    58
    Where in VZMC do you set this per vps?

    Where do you set this globally per vps template as well, in vzmc?
     
  14. djkast

    djkast Kilo Poster

    Messages:
    42
    I am also looking for that VZLinuxSLM doc...

    If anyone has it please send it to me.
     
  15. SunRabbit

    SunRabbit Kilo Poster

    Messages:
    76
    VZLinuxSLM.pdg contains detailed description regarding UBC Virtuozzo resources, not SLM... search for VZLinuxNewSLM plain-text file that comes with Rel300 (not Rel300sp1) distributive...
     
  16. Ahmed

    Ahmed Kilo Poster

    Messages:
    18
    When i type command " vzctl set 103 --slmmemorylimit 256M:512M --save " Saved parameters for VPS 103

    But Not change on page " Server Information " into whm , why ?
     
  17. madsere

    madsere Tera Poster

    Messages:
    352
    You probably have to restart WHM and/or reboot the VE.
     
  18. Ahmed

    Ahmed Kilo Poster

    Messages:
    18
    After reboot Ve i see error " Failed to start Virtual Private Server '103'. Error invoking vzctl utility: Error: slmmode is slm but SLM disabled in global configuration file "

    what i do ? and this VE IS Down now
     
  19. madsere

    madsere Tera Poster

    Messages:
    352
    Sounds like you didn't enable SLM in the vz.conf (/etc/vz/vz.conf).

    ## SLM parameters
    SLM=yes
    SLMPATTERN="default"
     
  20. Ahmed

    Ahmed Kilo Poster

    Messages:
    18
    I do it

    nano /etc/sysconfig/vz

    Then i change SLM=no to yes

    then reboot all ve

    THen run command vzctl set 103 --slmmemorylimit 512M:1024M --save

    Then reboot ve 103 ,

    But after reboot ve 103 be down , i can't restore online again


    Then i dont show this command " /etc/vz/vz.conf " im not found
     

Share This Page