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

Re: regarding swap space



on Sun, Apr 29, 2001 at 10:18:04PM -0600, Dwayne C. Litzenberger (dlitz@dlitz.net) wrote:
> On Mon, Apr 30, 2001 at 01:39:19PM +1000, Renai LeMay wrote:
> > I currently have two drives in my machine, one primary master with Debian 
> > unstable and a swap partition, and one unused primary slave.
> > 
> > What I'm looking to do, is create a swap partition on the slave drive, and 
> > use that instead of the one on my primary master. I don't need the space from 
> > the primary master, but using that swap is slowing down my system.
> > 
> 
> If you're not going to do anything else with the slave drive, you should use a
> swap *disk*, rather than a swap partition.  It'll be a little faster, though I
> don't know how much faster.
> 
> Basically, instead of using /dev/hdb1 or something, replace it with /dev/hdb .

I'm going to question this strongly.

First, swapping on IDE/ATA is going to be slow no matter what, as it's
CPU-mediated.  SCSI will be an improvement.

Second, if swap performance is significantly different, to the point of
impacting system performance, the problem isn't swap, it's too much
paging as a result of insufficient RAM.  Both disk and memory are cheap.
Buy some.

Third, I've never heard of either the suggestion for a swap disk, nor
that it's faster than a swap partition.  There *is* a tradition that
says swap partitions are faster than swapfiles, and the explanation is
logical:  files are subject to fragmentation and heavy swapping or long
read/write operations may require many head movements.  A partition
localizes swap operations on the disk.  If anyone has any evidence of
the speed claim, please present it.

Fourth, as Dwayne's noted, too much swap can hurt.  Memory addressing
itself consumes resources and can put overhead on the system.

My suggestion:  put a swap partition on the slave disk of 1-3x your
physical memory.  If system performance is slow, you're paging
heavily, and you've less than 128 MB memory, consider a memory upgrade.
If system performance is still slow, consider SCSI rather than ATA disk,
particularly if you're doing multiple simultaneous disk accesses.  My
understanding is that the CPU-mediation of IDE/ATA disk access means
that even if you're splitting swap and heavy data access between
spindles, your system is going to be contested while simultaneously
doing I/O and swap paging.

Cheers.

-- 
Karsten M. Self <kmself@ix.netcom.com>    http://kmself.home.netcom.com/
 What part of "Gestalt" don't you understand?       There is no K5 cabal
  http://gestalt-system.sourceforge.net/         http://www.kuro5hin.org

Attachment: pgp05Emnx8ndD.pgp
Description: PGP signature


Reply to: