[ale] that same darn NFS problem SOLVED

Michael D. Hirsch mhirsch at nubridges.com
Mon Feb 17 15:16:08 EST 2003


On Monday 17 February 2003 02:54 pm, Calvin Harrigan wrote:
> At 02:38 PM 2/17/2003 -0500, Michael D. Hirsch wrote:
> >On Monday 17 February 2003 02:30 pm, Chris Ricker wrote:
> > > On Mon, 17 Feb 2003, James P. Kinney III wrote:
> > > > With a 2.4.x kernel and RAM <=4G swap=2xRAM
> > >
> > > That's not necessary. There was a bug in early 2.4.x that required
> > > swap=2xRAM for decent performance, but that's long since been
> > > fixed...
> > >
> > > You need enough swap to hold your working set. That could be
> > > anything from no swap to gigabytes, depending on what you do on that
> > > system....
>
> <snip>
>
> The 2xRam argument is understandable, but questionable/confusing (at
> least in my opinion).  I have 128Megs Ram, a 256MB swap, fine.  I'm
> swapping too much, I add another 256Megs of Ram, according to the
> argument I should now increase my swap to 768MB (384MB ram total).  Why?
> Isn't the whole point of adding more memory to get away from swapping?
> Just a question I've asked several times without a good answer.

The swap is to make your machine as robust as possible.  You are basically 
trying to protect against a runaway process or a fork bomb.  The more swap 
you have, the longer your system can survive given a memory leak in a 
single process.  More swap only lets it stay alive longer, so why not?

The really interesting part of the swap file size is what happens if too 
many processes get started.  The case of a memory leak is easy to 
understand.  If doesn't really affect anything until swap is filled, then 
things start dieing.

The interesting case is lots of processes, all wanting the cpu.  Once they 
fill up RAM you get swap bound.  Now, most processes only need a part of 
themselves resident and can work fine with part of themselves in swap.  
You get swap bound when the part that must be in memory gets swapped out.  
The idea is to postpone that as long as possible.

The heuristic I am pushing is that a 2-1 swap to RAM ratio is a reasonable 
split.  That allows for one third of each process to be in RAM and 2/3 to 
be in swap.   Once that ratio gets much worse you will usually find that 
you are swap bound and pretty unhappy in any case.

So the answer is "No, you don't need to increase your swap, but doing so 
may make your system a little more robust under adverse conditions".  As 
Jim Kinney said, disk space is cheap, so why not?

Michael
_______________________________________________
Ale mailing list
Ale at ale.org
http://www.ale.org/mailman/listinfo/ale






More information about the Ale mailing list