UnixGuru

×
×

How do I create an additional swap file for my VPS?

Back

The quick answer is that you CANNOT do this.

You may find articles on the web that will have instructions like the following:-

 

How to make a 2GB swap file on your VPS.

# dd if=/dev/zero of=/swap.file bs=1024 count=2M

# chmod 0600 /swap.file

# swapon /swap.file

 

There is a reason that you cannot do this, the swapon command/process has been disabled on our VPS nodes.

 

Q. Why would you do this?

A. Because if customers had their VPSs swapping on a shared disk subsystem, then I/O would be extremely poor and the VPSs would be next to useless.

If you need more memory; buy more memory.

 

Q. But my VPS already uses swap, so what's the problem.

A. Our VPSs use VSWAP.

VSWAP is not on disk, but in memory, so there is no paging to disk.

The paging to VSWAP, however, is slowed down by a large factor to simulate the swapping to disk.

So as you start to run out of memory, this shows you, so you know it's time to upgrade the memory.

Was this article helpful?
Dislike0 Like0

Views: 472