Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 13 Oct 2003 10:37:09 -0400 (EDT)
From:      Jerry McAllister <jerrymc@clunix.cl.msu.edu>
To:        pjn0211@yahoo.com (=?iso-8859-1?q?Supote=20Leelasupphakorn?=)
Cc:        freebsd-questions@freebsd.org
Subject:   Re: Problem with adding more swap !
Message-ID:  <200310131437.h9DEbGfE005590@clunix.cl.msu.edu>
In-Reply-To: <20031013143201.42529.qmail@web40608.mail.yahoo.com> from "=?iso-8859-1?q?Supote=20Leelasupphakorn?=" at Oct 13, 2003 03:32:01 PM

next in thread | previous in thread | raw e-mail | index | archive | help
> 
> Hi, 
> 
>   I've heard if there are many disks on one machine
> it's good (in respect of performance) for adding swap
> parition on multiple drive, what does this mean
> (if that's true) ?

Well, if you can spread it across multiple controllers, it can
speed things up.  But, generally I think that swap is used in
a serial manner, eg the first chunk gets used up before the 
next one is started, etc.  So, that would mean that you would
want to put only a little on the boot drive (you need some there
for special occasions) and most of the rest on another drive
and another controller if you can.   Compared to the CPU, disk
access is rather slow, so anything you can do to spread out
the work across more than one disk tends to speed things up.

But, if you are the only one using the machine and that is 
mostly for one activity at a time you probably won't notice
any difference.

////jerry

> 
>   My box has six IDE drives two on primary, two on 
> secondary and two connected via IDE controller.
> 
> TIA,
> pjn
> 
> 
>  --- Jerry McAllister <jerrymc@clunix.cl.msu.edu> wrote: > > 
> > > Hi, all
> > > 
> > >    The documents on freebsd's website suggest that,
> > > as a system grows, it's recommended for adding more
> > > swap paritition to system. My questions are: Does
> > > it mean adding another swap to disk or to slice ?
> > > 
> > > 
> > > The disk structure: 
> > > 
> > >         ad0s1 --> ad0s1a   /      (boot from here)
> > >               --> ad0s1b   swap
> > >               --> ad0s1e   /var
> > >               --> ad0s1f   /tmp
> > >               --> ad0s1g   /usr
> > > 
> > >         ad0s2 --> ad0s2e   /usr1  (data)
> > > 
> > > Do I need to add another swap partition as "ad0s2b" ?
> > 
> > Hmmm.   I am not quite sure why you would have made two
> > separate
> > slices on the one disk for FreeBSD instead of having another
> > partition on slice-1, but...
> > 
> > Anyway, what do you mean 'as a system grows'?   Unless you
> > have some
> > very memory hungry applications or large numbers of processes
> > that 
> > hang around but don't really need a lot of processor time,
> > generally 
> > you figure swap size needs by memory size.   You want at least
> > more
> > than your physical memory and 2X to 2-1/2X physical memory is
> > the
> > typical rule of thumb.   If you already meet that, don't worry
> > about,
> > unless you have some other indication that you are running out
> > of
> > combined memory/swap (page) space.   NOTE that the virtual
> > memory
> > system uses swap space for its paging.  Typically, not much
> > actual
> > swapping really happens, though it can if there are a lot of
> > processes
> > not doing anything.
> > 
> > You can make a file pretty much anywhere there is room and set
> > things
> > up to swap to it, but that should be considered only a
> > temporary solution.   
> > The better thing is to make either a larger s1b or make an s2b
> > partition 
> > for swap (or add a disk - ad1s1b, + whatever) as you say.
> > 
> > In either case (enlarging s1b or making an s2b), unless you
> > have space
> > left in one of those slices that you did not already use up in
> > the
> > existing partitions,  it means redoing the filesystems already
> > on the 
> > slice.  That means backing up everything on the slice,
> > repartitioning, 
> > newfsing and restoring everything.  So, given this, it would
> > probably 
> > be a good time to rethink your whole disk layout and go from
> > there.
> > Maybe it would also be a good time to go to an additional or
> > larger
> > disk as well.
> > 
> > ////jerry
> > 
> > > 
> > > TIA,
> > > pjn 
> 
> ________________________________________________________________________
> Want to chat instantly with your online friends?  Get the FREE Yahoo!
> Messenger http://mail.messenger.yahoo.co.uk
> 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200310131437.h9DEbGfE005590>