Do i need swap memory on my CentOS vps?

MisdartedPenguin asked:

Do i need a swap memory for my centos vps?

Will it increase performance and if so how do i go about setting it up?

I’ve found this link ( but it shows three methods of setting up swap memory. I’m not sure which one i need.

Image (not enough rep to embed):

My answer:

If you have leased a virtual machine using Parallels Virtuozzo/OpenVZ containers, then you cannot have swap space. This technology does not permit containers to have their own swap space since all containers use a shared kernel. Therefore only the host can have swap space.

Ironically, the newest version of OpenVZ has a fake swap feature called VSwap which, instead of actually giving your container real swap space, gives it fake swap space that, if your container uses it, slows down your container to simulate the speed penalty of using swap. And of course you also get the additional slowdown if the host machine starts swapping because it’s oversubscribed…

View the full question and answer on Server Fault.

Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.