Results 1 to 21 of 21
  1. #1
    Join Date
    Sep 2007
    Posts
    436

    Guarantied memory on OpenVZ

    How I can see how much guaranteed memory I have ? And how I can see how much guaranteed memory I have used ?
    Additional how I can see how much bustable memory I have used or how much total memory my VPS is using.


  2. #2
    Login to your VPS using SSH and use the command " top " it will show you how much RAM are you allowed.

    However it doesn't differentiate guaranteed and busted RAM.

  3. #3
    Join Date
    Dec 2005
    Posts
    3,110
    Try this.

    To view burst RAM:
    free -m

    To view Guaranteed RAM, Used & Free

    Create a new script called Free

    nano /root/Free

    Paste the following inside:

    #!/bin/bash

    #

    # Revised 02-Feb-2007: include kernel memory (kmemsize) in 'used' calculation

    # and show percentages in output.

    #

    BEAN=`cat /proc/user_beancounters`

    GUAR=`echo "$BEAN" | grep vmguar | awk '{ print $4;}'`

    PRIV=`echo "$BEAN" | grep privvm | awk '{ print $2;}'`

    KMEM=`echo "$BEAN" | grep kmem | awk '{ print $3;}'`

    let TOTL=$GUAR/256

    let KMMB=$KMEM/1048576

    let PVMB=$PRIV/256

    let USED=$KMMB+$PVMB

    let FREE=$TOTL-$USED

    if [ "$FREE" -gt "0" ]; then

    let UPER=$USED*100/$TOTL

    let FPER=100-$UPER

    else

    let UPER="100"

    let FPER="0"

    fi

    echo "VPS Memory:"
    echo " Total: $TOTL mb Used: $USED mb (${UPER}%) Free: $FREE mb (${FPER}%)"
    Now run chmod +x Free

    Type in Free

    This will give you a nice output like:

    VPS Memory:
    Total: 768 mb Used: 412 mb (53%) Free: 356 mb (47%)

    That is your guaranteed RAM

    Script comes from http://www.labradordata.ca/home/40


  4. #4
    Thank you chris for the script, i used the script from that page to show me that VAServe/FSCKVPS had been setting my ressources incorrectly.

    edit: Also top and free -m, shows a different value to that of the beancounter file, 512 for top/free -m and 256MB in beancounter (i've read elsewhere that you had to look in beancounter for the right stats, but i've been unable to interpret the data until now), so top/free -m isn't showing the real stats.
    Last edited by Rune TM; 10-31-2009 at 12:38 PM.

  5. #5
    Join Date
    Dec 2005
    Posts
    3,110
    A modern OpenVZ system will show your burst ram with "free" or "free -m"

    If it shows anything else i.e. the RAM of the host, then your provider is running a very old version of OpenVZ.

  6. #6
    Join Date
    Sep 2007
    Posts
    436
    Do i need to reboot my VPS ?!
    it`s not working for me.

  7. #7
    Join Date
    Dec 2005
    Posts
    3,110
    SHouldnt do, what error are you getting?

  8. #8
    Quote Originally Posted by sumi View Post
    Do i need to reboot my VPS ?!
    it`s not working for me.
    Where have you stored the script? You will have to give the full path if you have stored it somewhere outside your $PATH.

  9. #9
    Join Date
    Dec 2005
    Posts
    3,110
    Might be worth sticking it in /bin infact so you can run it from anywhere

  10. #10
    Sumi, i followed the specifications in chris' link rather than what he typed, you could try that instead.

    The page notes that you have to be using the root account, else it wont work. it does specify a way to get around it.

  11. #11
    Join Date
    Sep 2007
    Posts
    436
    I did not type ./ Sorry
    and Here are the results:
    VPS Memory:
    Total: 512 mb Used: 719 mb (100%) Free: -207 mb (0%)

    and this is empty VPS
    Last edited by sumi; 10-31-2009 at 02:50 PM.

  12. #12
    Join Date
    Dec 2005
    Posts
    3,110
    Are you sure its empty?

    You are in a - value because you are using 407MB of burstable ram in addition to your guaranteed.

    Either that or the script doesn't like your server. I've been using it for years and years though without any problems.

  13. #13
    Join Date
    Sep 2007
    Posts
    436
    Yes,
    It has bean setup yesterday.
    noting on the server. just Cpanel installation.

  14. #14
    Join Date
    Dec 2004
    Location
    Butler,TN
    Posts
    2,416
    Hi!
    Do this:

    cd out of root and type this:

    cat proc_user_beancoumters

    Post here and I'll decipher.
    Bryon L Harvey
    Soil Relocation Engineer

  15. #15
    Join Date
    Sep 2007
    Posts
    436
    Here is in the attachment
    Attached Thumbnails Attached Thumbnails pic.jpg  

  16. #16
    Join Date
    Dec 2004
    Location
    Butler,TN
    Posts
    2,416
    Hi!
    Ok..you have:

    131080/131080 in Vmguarpages. This is your "guaranteed RAM"=512MB
    500000/750000 in Privvmpages. This is burst RAM=1953MB/2929Mb

    Kernel RAM allocations are 58.84MB/118.43MB..which is fine.
    Bryon L Harvey
    Soil Relocation Engineer

  17. #17
    Join Date
    Sep 2007
    Posts
    436
    Thanks.
    how i can see how much guaranteed RAM memory i use at this moment ?

  18. #18
    Join Date
    Dec 2004
    Location
    Butler,TN
    Posts
    2,416
    Hi!
    Look at the oomjuarpages number..that accounts for current RAM + SWAP used.

    In this case..35097.which is 35097 4K pages..or 140MB..approximately.

    >>>It should be pointed out nodes can be overallocated..sometimes horribly.
    In this case..you are going to have a hard time using even part of what you were "guaranteed".
    Bryon L Harvey
    Soil Relocation Engineer

  19. #19
    Join Date
    Feb 2005
    Location
    Australia
    Posts
    5,849
    Quote Originally Posted by bryonhost1 View Post
    >>>It should be pointed out nodes can be overallocated..sometimes horribly.
    In this case..you are going to have a hard time using even part of what you were "guaranteed".
    Absolutely. And whether the node is overallocated or not, your actual (the wonderfully-misnamed "guaranteed") memory usage can still be drastically constrained by the other limits, notably kmemsize and burst. Some providers are even setting guaranteed=burst - the only thing guaranteed there is that you'll never be able to use the guaranteed memory...

    sumi - that's a well set-up VPS. You're in luck.
    Chris

    "Some problems are so complex that you have to be highly intelligent and well informed just to be undecided about them." - Laurence J. Peter

  20. #20
    Join Date
    Sep 2007
    Posts
    436
    Quote Originally Posted by foobic View Post

    sumi - that's a well set-up VPS. You're in luck.
    I do not understand my VPS is good set-up or bad set-up ?

  21. #21
    Join Date
    Feb 2005
    Location
    Australia
    Posts
    5,849
    Based on the beancounters file, it's good. Of course that doesn't eliminate the possibility of other problems (overcommitment, limited i/o etc) but it's a good start.
    Chris

    "Some problems are so complex that you have to be highly intelligent and well informed just to be undecided about them." - Laurence J. Peter

Similar Threads

  1. Apache on OpenVZ VPS uses all memory
    By Abu Mami in forum Hosting Security and Technology
    Replies: 6
    Last Post: 07-12-2011, 10:41 AM
  2. How to reduce OpenVZ memory usage by >50%
    By cieslakd in forum Hosting Security and Technology
    Replies: 4
    Last Post: 10-08-2010, 06:53 AM
  3. How to limit memory for VE on openvz
    By admrootlinux in forum VPS Hosting
    Replies: 12
    Last Post: 10-31-2008, 03:18 AM
  4. OpenVZ with 256 ram assigned, Plesk errors and vps memory full
    By Hostenlinea in forum Hosting Security and Technology
    Replies: 2
    Last Post: 10-21-2008, 07:43 PM
  5. OpenVZ burstable memory
    By SysAdminMan in forum VPS Hosting
    Replies: 13
    Last Post: 12-05-2007, 10:36 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •