Results 1 to 2 of 2

Thread: Determining Assigned Resources

  1. #1
    Former Employee Power Poster
    Join Date
    Apr 2005
    Location
    Seattle, WA
    Posts
    140

    Default Determining Assigned Resources

    Determination of the memory resources allocated to your server is not as simple as running free or top. Both of these commands look at the resources of the physical server and not of your virtual private server. The resources for your VPS are determined by the values in the /proc/user_beancounters file. You can examine these values either within a SSH session or through the Virtuozzo PowerPanel under 'Resources'.

    The 3 main entries which determine your memory allocation are kmemsize, vmguarpages, and privvmpages.

    kmemsize is the amount of memory allocated to those sections of programs which must stay resident and cannot be swapped into the disk swapfile

    vmguarpages are the virtual memory guaranteed pages and define the guaranteed memory assigned to your account.

    The equation (((kmemsize/1024)+vmguarpages*4)/1024) will give the approximate amount of memory, in MB, assigned to your server as there are a few other entries which contribute a small amount to the guaranteed limit.

    The privvmpages determine the amount of memory which your account will have access to beyond the guaranteed limit, if it is available. This is the burstable limit. The equation for the burstable limit is (((kmemsize/1024)+privvmpages*4)/1024) and is in MB.

    These calculated values are lower then the limits displayed on our website as the additional entries in the /proc/user_beancounter also contribute to the memory limits, but as a smaller percent,, less than 5%.

  2. #2
    Junior Member Newbie
    Join Date
    Sep 2006
    Posts
    4

    Lightbulb Handy awk script

    I just cooked up the following awk script (beancounters.awk) to investigate these numbers:

    Code:
    $2 ~ /^kmemsize$/       { kmemsize_held = $3; kmemsize_barrier = $5 }
    $1 ~ /^vmguarpages$/    { vmguarpages_barrier = $4 }
    $1 ~ /^privvmpages$/    { privvmpages_held = $2; privvmpages_barrier = $4 }
    END     {
                    print "Approx guaranteed memory: ",
                            ( ( kmemsize_barrier / 1024 ) + ( vmguarpages_barrier * 4 ) ) / 1024, "MB";
                    print "Approx burstable memory: ",
                            ( ( kmemsize_barrier / 1024 ) + ( privvmpages_barrier * 4 ) ) / 1024, "MB";
                    print "Approx held memory: ",
                            ( ( kmemsize_held / 1024 ) + ( privvmpages_held * 4 ) ) /1024, "MB";
            }
    Running it as "gawk beancounters.awk < /proc/user_beancounters" returns the following information on my VPS:

    Code:
    Approx guaranteed memory:  248.672 MB
    Approx burstable memory:  504.531 MB
    Approx held memory:  318.358 MB
    I guess I need to get my account upgraded. Hopefully this comes in useful for someone else.

Bookmarks

Posting Permissions

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