Rule of the thumb for swap?

Hi,
The general rule of thumb for assigning swap is double the RAM of the server, however, there are servers with 16GB or 32GB of RAM. Are we suppose to put aside 32GB and 64GB of swap respectively.

Thanks

My rule of thumb when installing is setting swap to 4gb unless there is some software that needs a bigger swap area.
If the server is specced enough with RAm, there shouldnt be a heavy use of the swap area anyways.

Beware that with Solaris, even with a server that doesn't use swap at all, a large swap might still be required for applications not to crash on failed memory reservation.

Best way is to really get application requirement. When I have 16GB or more of RAM, I set it to 8GB or 16GB but never more unless specified otherwise.

There is often a misunderstanding about swap size sizing with Unix. I always recommend an oversized swap area. It won't have a negative impact on performance or functionality, just no effect at all. On the other hand, an even slightly undersized swap will trigger process crashes.

1 Like