>On Friday 19 March 2004 22:42, Samuel MacDonald wrote:

>> Is there a point where more swap doesn't help?

Yes, when RAM + swap space is greater than the system's memory
requirements based on the mix of applications it is running.

In fact Linux can run fine without any swap space, given enough RAM.
Compare two systems and loads on each that are equal, but system A has
256MB RAM and 256MB swap and system B has 512MB RAM and 0MB swap.  If
total memory requirements don't exceed 512MB, both systems will run
fine, except the performance of system A will likely be less than system
B.  However, as long as disk trashing doesn't occur on system A, the
performance of both systems will be adequate.

A system can run with swap space if it has enough RAM to avoid the
need to swap processes (or parts there of) to the disk.  This in turn
depends on the memory requirements of all processes in the system and
the memory that Linux needs to buffer disks and other devices to keep
performance reasonable.  Linux will divert most "free memory" to buffer
disks and devices, but it really only needs a small percentage of these
buffers to provide reasonable performance.  Thus Linux the buffers/cache
usage as shown by free can often be reduced drastically without much ill
effect by reducing the system's RAM (or loading more applications).

For every mix of applications running on a system, one can
experimentally see how much RAM is required and equip a system with that
amount of RAM.  Such a system will not need any swap to run perfectly
fine as long as system memory requirements never exceed the size of the
system's RAM.  This same experiment can be repeated with varying sizes
of swap space.  The easiest way to proceed is to define several small
swap partitions (.i.e eight 128MB swap partitions), enabling zero or
more of them to the desired amount.  Available RAM can be reduced to the
desired <number>MB testing amount via the mem=<number>M kernel argument.

Dave Carlson pointed out that he has never seen his 1GB RAM system swap
any processes to disk, so he probably doesn't need any swap for the
memory load his system is put under.

Adam Maloney wrote:

>Just be careful setting swap to be less than RAM, if you have an
>operating system that will dump physical memory to swap in case of a
>panic (not that BSD or Solaris ever do that! <g>)

Are there any ram dumping utilities that ignore partition boundaries and
possibly overwrite the next partition?  I would assume that such RAM
dumping utilities would fail when the amount of RAM to dump exceeds the
available swap space.  Adam, was this the point of your comment above?

I just installed Solaris 8 on a system with 512MB of RAM, but suninstall
suggested 295MB of swap.  A few years ago, Sun may have increased its
swap size to simply provide more space for its new Java based
installation program, if I recall correctly.  In this case, increasing
swap space may not have had anything to do with increasing performance
or reducing RAM requirements.

Sincerely,

Ken Fuchs <kfuchs at winternet.com>

_______________________________________________
TCLUG Mailing List - Minneapolis/St. Paul, Minnesota
http://www.mn-linux.org tclug-list at mn-linux.org
https://mailman.real-time.com/mailman/listinfo/tclug-list