Howdy, Stranger!

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


How does VPS use swap RAM?
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 does VPS use swap RAM?

BartokBartok Member
edited September 2013 in General

In various VPSes I have, there are two methods for using swap memory (when checking by free command).

  1. Using swap memory only when my dedicated RAM is fully used, and out of memory.

  2. Swap memory is always used alongside with the dedicated RAM.

What is the difference of these two methods? and why providers prefer one to another. The first one is more logical to me, but in some VPSes, I see the second method.

Comments

  • jarjar Patron Provider, Top Host, Veteran
    edited September 2013

    Linux will sometimes put more rarely accessed pages into swap even when memory is free. This is fine and normal. It isn't so much about the host as it is the guest, although in openvz you share a kernel with the host so I guess I could say that is someone less true in that case.

    It's really not a bad thing unless you're noticing a lot of swap, in which case you could adjust your swappiness.

  • The reason why some providers may opt of the 2nd one is to be able to possibly oversell resources, as they are able to overcommit their memory resources.

  • @Bartok said:
    In various VPSes I have, there are two methods for using swap RAM (when checking by free command).

    1. Using swap RAM only when my dedicated RAM is fully used, and out of memory.

    2. Swap RAM is always used alongside with the dedicated RAM.

    What is the difference of these two methods? and why providers prefer one to another. The first one is more logical to me, but in some VPSes, I see the second method.

    Swap is by definition on disk, while RAM is random access memory. So your term "Swap RAM" makes no sense.

    Please provide the evidence for your observations and maybe someone can help sort it out.

  • jarjar Patron Provider, Top Host, Veteran

    Unless he's referring to what the ovz kernel does, but I'm guessing not.

  • MaouniqueMaounique Host Rep, Veteran

    @vexxhost said:
    The reason why some providers may opt of the 2nd one is to be able to possibly oversell resources, as they are able to overcommit their memory resources.

    That will not work for OVZ where most overcomiting takes place. Instead, forcing more pages go to the fake swap which is usually in memory too will increase load to extremes. If the kernel starts to dump part of the swap ram on the disk due to insufficient resources, then it is game over, the node will become unusable.

Sign In or Register to comment.