Guspaz wrote:
Linux will swap infrequently used stuff out of RAM (configurable by the "swappiness" variable). That frees up RAM for active stuff and cache, improving performance by giving it to things that can actually use it.
The more RAM you have (and are using), the more inactive stuff that can be swapped out without performance penalties. If you don't keep your swap at some reasonable ratio (and 1:1 is probably a good idea at least up until 512-1024 or so), you're giving up that benefit.
This is more true on a dedicated system than a VPS since on a VPS the hit to actually move stuff between swap and memory is much higher due to the contention for the disk resource. A 1:1 (or 2:1 for smaller systems) swap rule can make more sense in a dedicated environment.
While it's true that if you actually have a workload such that you truly have a very small percentage of total allocation as a working set, you can have a lot swapped out, in my experience that's an uncommon workload, especially for a server, where most tasks are there to do something, as opposed to a desktop where you may have large GUI applications minimized or something.
In a VPS environment in general, even a small amount of swapping will be causing significant degredation, and I doubt that most Linodes would behave well at all if they had a swap level anywhere near their memory size (although obviously it does depend on workload). I definitely don't think there's any reason to allocate swap space up at 1:1, at least in this environment.
-- David