How much swap do you allocate for your Solaris server

solarisswap

I'm still seeing system administrators using the old rule of thumb that swap should be double the memory, even in servers with 32GB of memory.

These systems have relatively expensive disks (shipping with 200GB drives) and allocating 64GB of that to swap seems a bit excessive.

I was wondering how much swap do you allocate for your Solaris servers, and why?

I saw there were other similar questions, but mostly focused on Linux. For Solaris there is another consideration deciding on your swap space because the /tmp filesystem is usually shared with swap.

Best Answer

The swap = 2 * memory is coming from the old days when during a kernel crash the kernel dumped the memory to the swap device and you were able to check what happened after you rebooted your system. Nowadays for example linux is skipping this at all, and I don't run my system with enabled dump file setup. So, this double the size of the memory to get the swap is not valid anymore, because there is not unusual that you have 16/32/64GB of ram and then you obviously wasting disk space following this old story when the disk was much much bigger then the RAM. So long story short, if you don't want to dump and analyze kernel crashes in production there is no logical reason to keep this principle and just give your system couple of G swap, usually i give 2/4 G, because i want to avoid huge IO load caused by swapping.