Hacker News new | ask | show | jobs
by rstuart4133 825 days ago
We live in a world where you are charged per megabyte of RAM you allocate to your VM's. Sure, they have the occasional peak that lasts for a few seconds, but if you provision RAM for that peak it's costing you money. The cheap way out is to give it swap.

My rule of thumb is on an average load there should be no swapping, meaning that vmstat or whatever should be showing mostly 0's in the swap column. That doesn't mean it has 0 bytes in swap, in fact it probably is using some swap. It means nothing in swap is in the working set. For example, the server I'm looking at now is showing 0 swap activity, has 2GB of RAM and is using 1.3GB of swap. When a peak hits you will get some small delays of course, but it's likely no one will notice.

Doing anything else leaves money on the table.