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

Re: [K12OSN] swap size



On Mon, Apr 29, 2002 at 02:26:57PM -0700, Donald J Christensen wrote:

> I do question the assertion made here that too much swap can degrade
> performance.  Maybe I am overestimating the intelligence of the
> VM system in Linux (which I have not studied), but why would too
> much VM cause a slowdown?  Does the VM system dump unused pages
> to swap sooner if there is more swap?

It's not the presence of too much swap, but the /use/ of too much swap,
that degrades performance.  If you have too high of a swap:physical memory
ratio, then by the time you're approaching full use of your swap you've
far outstripped your VM system's ability to keep up.  No matter how good
the kernel is (and Linux 2.2 and above is, for the most part, pretty
decent), it can't overcome the fact that there's a significant difference
between the throughput to physical memory and the throughput to swap.

To use real numbers, say I have a computer with 64MB of physical memory
and I expect to be running some memory-intensive applications (desktop
stuff, of course).  Past a certain point, adding more swap to compensate
isn't going to help: you can make sure there's always enough memory to
keep your application from being terminated by the kernel, but eventually
anything that's using that much memory is still going to become unusably
slow because it's constantly swapping pages in and out, an operation
that's limited by the speed of your drive I/O.

Steve Langasek
postmodern programmer

> Kirk Rheinlander wrote:
> >OK, so this "rule of thumb" was specified by Windoze some 30+ years ago, 
> >or some 15+ year before Windoze existed. Interesting view of 
> >history....I'm sure that Bell Labs would get a kick out of this 
> >interpretation. Revisionist history at its' finest!
> >
> >With Win2k at least, you use most of swap space, even if physical RAM is 
> >not even close to being allocated. Swap space on 'Nix's are exactly what 
> >John indicated they were, and the swap=mem is just a rule of thumb, and 
> >the subject of more than a few performance tuning scenarios.
> >
> >Kirk
> >
> >At 12:17 PM 4/29/2002, you wrote:
> >
> >>> I'd love to know where that rule of thumb came from. It's been
> >>> around for 20 years or more. In my opinion, it's completely wrong.
> >>
> >>It comes from interpretation of swap space for Windoze servers. 
> >>Basically NT
> >>or 2k suggest swap space to the same size as your available RAM in 
> >>order to
> >>be able to do disk dumps in case of system crashes.
> >>
> >>Regards
> >>Anthon Walter
> 
> -- 
> Don Christensen       Senior Software Development Engineer
> djc cisco com         Cisco Systems, Santa Cruz, CA
>   "It was a new day yesterday, but it's an old day now."
> 
> 
> 
> _______________________________________________
> K12OSN mailing list
> K12OSN redhat com
> https://listman.redhat.com/mailman/listinfo/k12osn
> For more info see <http://www.k12os.org>





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