CentOS Swap – How Much SWAP for 16GB RAM

centosswap

How much SWAP would you give a CentOS install on a dual Quad Core XEON with 16GB of RAM that is going to be running a php website with a mysql backend – medium/heavy load?

Best Answer

Not more than a gig or two -- you want a little bit of swap available, just in case and because it helps things work a bit better, but if you ever get to the point where you're heavily swapping, the machine is going to be useless -- and in a real catastrophic situation, you're actually better off with a smaller swap space, because then you'll trigger the OOM killer sooner rather than later.