swap rule 1.5 *memory= swap still valid

4

Possible Duplicate:
Why should the size of the swap partition be double of the RAM size?

Does the rule of 1.5 *memory= swap still apply in these days where systems can have32 GB of memory. Besides the fact that it is always bad for a system to start swapping.

Ski Mountain

Posted 2012-10-02T16:21:56.290

Reputation:

Question was closed 2012-10-02T20:17:56.593

3It is not always bad for a system to start swapping. It is bad to start reading from swap back. – Michael Krelin - hacker – 2012-10-02T16:26:21.057

There is probably never a reason to have more than 4GB of swap space. My university has a machine with 64GB of ram and it has 8GB of swap. – None – 2012-10-02T16:26:58.733

Are you running a server that might start an uncapped number of server threads or processes lying dormant for a long time? Is it a mail server? – Dmitri Chubarov – 2012-10-02T16:28:41.343

Answers

0

Yes, there are reasons.

  • Most notably for linux desktop PCs, you'll find that you cannot do hibernation without any swap.

  • Servers with very diverse use might profit from using more memory for file system buffers and sending some unused processes to swap for that (like, for example, mailman processes on a not very frequented mailinglist). Keyword here is swappiness (link goes to askubuntu, but it mostly applies to linux in general).

Jonas Schäfer

Posted 2012-10-02T16:21:56.290

Reputation: 1 312

So, for hibernation, we still need at least as much swap as active RAM right? – terdon – 2012-10-02T16:57:53.887

1With active meaning, the amount of ram you actually use. Not sure about buffers and caches, linux might be smart enough to free these first if swap isn't sufficient. – Jonas Schäfer – 2012-10-02T17:29:22.307

2Disk is insanely cheap compared to ram so you might as well go 1.5x and not risk any problems. If you can split the swap over multiple spindles, so much the better. Just because you have the swap doesn't mean you should use it, however: One access to disk will blow out of the water whatever nice performance you were getting from fast CPUs. – Brian White – 2012-10-02T18:15:48.570