Now I'm trying to create KVM templates with CentOS and I'm not sure should I create swap partition on guest OS or not. In future it will be lot's of small VPS with 256-1024Mb RAM and if swap partition is a good idea will be 256Mb of swap enough for making them more stable?
|
Sure. Go for it... Those sound like low-memory virtual machines. It may be helpful to have swap in place in the event memory is exhausted. If not, you can always add swap files later. |
|||
|
|
|
In particular for systems with small amounts of RAM some swap is most important. I have a setup with about 100 of small vps with 384 MB RAM on one mid-sized physical machine, most of them look like this:
So it is good to have some swap, or the vps stated above most likely would have crashed without swap. To reduce CPU load when the vps wants to use swap the first time and you know that would happen, it would be very good using preallocation (using qcow2 images). On a physical machine with many vps one can imagine that a machine would get a very high load if many of the running vps want to swap in an area that has still to be allocated. Talking of me I would rather use more RAM (about +124MB) on the vps for future installations, now that I know that some vps swap (even if only 4MB). |
|||
|
|