Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


How do you check the memory allocation is correct?
New on LowEndTalk? Please Register and read our Community Rules.

All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.

How do you check the memory allocation is correct?

rchurchrchurch Member
edited December 2011 in Help

In OpenVZ if the provider says you have 1GB Guaranteed and 1.5 GB burst RAM, what should you expect to see if you run free or cat /proc/meminfo?

At the very least how do you tell that your guaranteed memory is genuine?

Comments

  • FranciscoFrancisco Top Host, Host Rep, Veteran

    you should see 1.5GB

    Francisco

  • rchurchrchurch Member
    edited December 2011

    Is there no way of checking the guaranteed memory? So if a provider offers a memory spec where guaranteed = burst eg. 1GB guaranteed and 1GB burst, it is essentially meaningless as there burst does not make any difference of the guaranteed?

    On the other hand if the promise 1Gb guaranteed and 1.5Gb burst they could be giving you 512Mb guaranteed and bursting up to 1.5GB and you wouldn't be able to tell the difference, unless you know how to run some programs which can check that.

    What of vswap? Is it similar?

  • SpeedBusSpeedBus Member, Host Rep

    Check SolusVM ? You should see 1 GB Guarenteed (which is also oversold) and 1.5 GB Burst (Which is oversold 2x).

  • @rchurch, I believe there are some info encoded in /proc/user_beancounters, including but not limited to the guaranteed memory settings.

  • You should see 1.5 GB when you run free -m and in your control panel (if SolusVM), you should also see 1.5GB of RAM available. :)

  • cat /proc/user_beancounters

    Look for vmguarpages. Take the number in the Barrier column and divide by 256 to get MB of guaranteed RAM. Typically the oomguarpages (which basically shows app memory usage) is set the same as vmguarpages.

    Then look for privvmpages. Take the number in the Barrier column and divide by 256 to get MB of 'burst' RAM.

    See http://wiki.openvz.org/Proc/user_beancounters for more info.

    I have a little script here to make viewing oomguarpages & privvmpages values a little easier.

    Thanked by 1rchurch
  • bretonbreton Member
    edited December 2011

    @rchurch said:

    At the very least how do you tell that your guaranteed memory is genuine?

    Open htop in one window.
    Open terminal in another window.

    wget http://ompldr.org/vYnNxbw -O test_mem.c && gcc test_mem.c -o test_mem
    

    Use it as

    ./test_mem [requested memory]

    For example, on my inceptionhosting 512 MB RAM/512 MB swap VPS it takes less than 1 second to allocate 400 MB (when swap is not used), but ~6 second to allocate 800 MB (when swap is used).
    Also, there is vzfree utility, but I've never used it.

    GCC and libc-dev are required to compile it.

    Compiled for 32-bit OS:

    wget http://ompldr.org/vYnNyMA -O test_mem && chmod u+x test_mem

    libc is required (you probably have it installed already).

  • bretonbreton Member
    edited December 2011

    Okay, version 2.
    Compiled for 32-bits linux:

    wget http://ompldr.org/vYnN0Mg/test_mem -O test_mem; chmod +x test_mem;

    Source:
    http://ompldr.org/vYnN0Nw/test_mem.c
    Compile it with

    gcc -lrt test_mem.c -o test_mem

    Some tests:

    # on inceptionhosting VPS, 400 MB is allocated. 450 MB RAM is free before execution
    % ./test_mem 400000000                               
    Execution time: 0.566906
    
    % ./test_mem 400000000
    Execution time: 0.718195
    
    # now allocate 800 MB to get into swap
    % ./test_mem 800000000
    Execution time: 5.870889
    
    % ./test_mem 800000000
    Execution time: 5.386210
    
    # now same tests on pyramidserver vps
    Execution time: 0.243245
    Execution time: 0.245258
    
    # I ran 800 MB test on pyramidserver 4 times, shows some inconsistent results. 
    Execution time: 10.076255
    Execution time: 6.064769
    Execution time: 4.581145
    Execution time: 8.792944
    
    

    Offtopic: I dunno, maybe inceptionhosting uses less fast ram than pyramidserver does, or maybe some settings are made differently. Or maybe it's just Xen "feature" - to be slower here than KVM.

    Thanked by 1rchurch
  • yomeroyomero Member
    edited December 2011

    Edited... spam time.

  • I have checked the oomguarpages, vmguarpages an privvmpages and they look correct. They match the provider's specifications.

    But I take it that the memory allocation can include the swap space on the hardware node, those figures may be using swap without causing crashes other than slow performance? ie processes may or not be terminated but the server will continue to run?

  • OpenVZ won't kill any processes until the node runs out of ram and swap.

  • @breton said: # I ran 800 MB test on pyramidserver 4 times, shows some inconsistent results.

    as usual, disk problem. :D

  • @breton ompldr.org is not responding? Do you have another link?

  • An OVZ provider could give you 512MB dedicated and 1.5GB burst and tell you that you have 1GB dedicated and using just "free -m" you wouldn't know.

    @rchurch do you suspect a provider may be doing this or something?

  • @Naruto - pay more attention; you can use beancounters to see your actual guaranteed ram. That's the pages @rchurch was mentioning. ;m

  • I said using just "free -m".

  • AldryicAldryic Member
    edited March 2012

    If you're on a VM, you never rely on just 'free -m'. Or did you already know this, and were just stating the obvious to make us aware of your presence? ;m

  • The latter statement. I'm mobile in church with nothing better to do.

  • AldryicAldryic Member
    edited March 2012

    I'm assuming your parents still make you go with them? You have my condolances. ;m

    Thanked by 1wcypierre
  • No I go because I LOVE GOD AND JESUS CHRIST IS MY SAVIOR AND I AM NOTHING WITHOUT HIM AND YOU SHOULD GO TOO! IN THE BIBLE GOD SAYS YOU ARE EITHER FOR ME OR AGAINST ME! Send this message to 10 people by midnight or you're going to hell.

    ~JeSuS SaVeS~

  • @breton ompldr.org is working. The networking on my server was misconfigured after a move by the provider.

    I tested and the RAM is genuine. There is no swap though so it has a hard limit of 2Gb. The test for 400Mb, 800Mb, 1600Mb worked fine, but 2gb it errored out.

  • bretonbreton Member
    edited March 2012

    @rchurch said:

    @breton ompldr.org is not responding? Do you have another link?

    @rchurch said: @breton ompldr.org is working. The networking on my server was misconfigured after a move by the provider.

    A problem that solves itself? Look like a job for me, bend^Wbreton!

Sign In or Register to comment.