# Is vSwap allocated in RAM or Disk?



## vanarp (Sep 10, 2013)

I see vSwap has replaced Burst RAM in OpenVZ products with most providers.

So this vSwap is allocated in Physical Memory or Disk Storage by the VPS providers?


----------



## Francisco (Sep 10, 2013)

Memory unless the node *really* needs to swap.

Francisco


----------



## VPSCorey (Sep 10, 2013)

Memory unless the host is using SSD'd for swap and overselling the crap out of it.. /fixed :huh:


----------



## vanarp (Sep 10, 2013)

Thanks for the quick responses.

That means moderate to heavy swapping of VPS should _ideally _not cause any performance problems, correct?

It also makes me wonder how providers like Crissic are able to offer more vSwap than RAM when technically both should be part of Physical RAM of the node.


----------



## Francisco (Sep 10, 2013)

vswap is designed to 'feel' like swap.

The more you use, the more of a slow down you feel.

It shouldn't be serious though.

Francisco


----------



## VPSCorey (Sep 10, 2013)

vSwap is supposed to be artifically slowed down, but still you do not want to be in it as it's meant to be temporary.

I've seen virtuozzo plans where you had 1gb of ram 8 gb of burst.  However if you sit in burst your process is subject to termination, not sure about OpenVZ though it's technically the same.


----------



## vanarp (Sep 10, 2013)

I thought vSwap is guaranteed unlike Burst memory. Is it not like that?


----------



## jcaleb (Sep 10, 2013)

I noticed my buyvm box is now using swap not burst


----------



## concerto49 (Sep 10, 2013)

vanarp said:


> I thought vSwap is guaranteed unlike Burst memory. Is it not like that?


It means you do get that much swap. No guarantee on if it's in memory or on disk. They can allocate large vswap, but it will overflow to disk if memory is used up.


----------



## SeriesN (Sep 10, 2013)

vanarp said:


> I thought vSwap is guaranteed unlike Burst memory. Is it not like that?


Just like in real environment, Vswap is there to give your application and server a bit extra room to prevent cushing and blah blahs. If you are at the point of constantly swapping out/using swap on a regular basis, time for an upgrade or tuneup, just like you would do with a physical server.

As for burstram, industry has defined burst from what it was intended to be. Per OpenVZ term, burs is really what you are allocated and should be allowed to use 24/7 but due to the term "burst" providers promoted it the wrong way making it sound like "burst". Well that is another discussion


----------



## johnlth93 (Sep 10, 2013)

I though that vswap was on drives. Seem like i was wrong, I'm not good with linux


----------



## Magiobiwan (Sep 10, 2013)

SWAP is on drives. vSWAP is in the node's RAM unless* *the node *REALLY* needs to swap.


----------



## vanarp (Sep 11, 2013)

Thanks all for the replies. It makes it much clear to me.

Quick question. Is there a way I can know whether my OpenVZ VPS's Swap is writing to RAM or Disks?


----------



## Francisco (Sep 11, 2013)

vanarp said:


> Thanks all for the replies. It makes it much clear to me.
> 
> Quick question. Is there a way I can know whether my OpenVZ VPS's Swap is writing to RAM or Disks?


Is the node lagging to unholy hell? If it is, it's likely swapping. If it isn't? It could still be swapping but possibly to SSD based swap.

Alas, RAID0 SSD swap is becoming popular.

Francisco


----------



## SeriesN (Sep 11, 2013)

Francisco said:


> Is the node lagging to unholy hell? If it is, it's likely swapping. If it isn't? It could still be swapping but possibly to SSD based swap.
> 
> 
> Alas, RAID0 SSD swap is becoming popular.
> ...


Sata on raid 0 does pretty good for swap and is cheaper than ssd.


----------



## vanarp (Sep 11, 2013)

Swap on RAID0? It can be fatal for the VPS (assuming swap is in use) should it fail, right?


----------



## SeriesN (Sep 11, 2013)

vanarp said:


> Swap on RAID0? It can be fatal for the VPS (assuming swap is in use) should it fail, right?


No. Swap is "emergency memory" for your server and all the sane people I know, do not store anything on swap, or to be exact, they don't even use swap.

Swap on Raid 0 = faster process handling and less lag on the node if it is swapping. if the drive fails, you are losing nothing.


----------



## HalfEatenPie (Sep 11, 2013)

Just re-iterating what SeriesN said, I wouldn't use/assume vSwap or even Swap as "guaranteed" (as you previously described).  It's just bad practice to use up swap all the time.  (I know it isn't really answering your question but I feel it important to reiterate it).


----------

