[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: OT (slightly) swap limits

Patrick Ouellette wrote:
On Thu, Apr 24, 2008 at 04:45:05PM -0400, Damon L. Chesser wrote:
Being in an interview loop looking for employment, I find I am asked questions I never considered, for example: How much is enough swap?

Rephrase the question.  Ask what the intended use of the machine is,
what response times the users expect, how much real RAM is there, and
what applications/services will run off the machine.

Then tell the interviewer how each parameter you've asked about would
influence your decision on how much swap was enough.

How much is enough? As much as the system needs to run and not kill processes due to lack of memory (real + swap).

I've run machines with 1Gig or more RAM with NO SWAP.  I've also run
machines with 4Gig of RAM and 16Gig of swap (BIG datasets).


I tend to agree with you, however, I am being sucked dry of my Linux knowledge (the purpose of the interview, find the point of breakdown to determine the extent of the knowledge/skill). And much to my surprise I just found this:

"At a bare minimum, you need an appropriately-sized root partition, and
a swap partition equal to twice the amount of RAM"

page 59, from a questionable source:  Installation Guide of RHEL5.

and on page 62, they further detail it:

"Swap should equal 2x physical RAM for up to 2 GB of physical RAM, and then an additional
1x physical RAM for any amount above 2 GB, but never less than 32 MB.
So, if:
M = Amount of RAM in GB, and S = Amount of swap in GB, then
If M < 2
S = M *2
S = M + 2
Using this formula, a system with 2 GB of physical RAM would have 4 GB of swap, while one with 3 GB of physical RAM would have 5 GB of swap. Creating a large swap space partition
can be especially helpful if you plan to upgrade your RAM at a later time.
For systems with really large amounts of RAM (more than 32 GB) you can likely get away
with a smaller swap partition (around 1x, or less, of physical RAM)."

That is RHEL's take on the issue. Still looking for other sources. Interesting, I think.

Damon L. Chesser

Reply to: