Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 23 Jun 2001 13:46:12 -0500
From:      Mike Meyer <mwm@mired.org>
To:        Bill Moran <wmoran@iowna.com>
Cc:        questions@freebsd.org
Subject:   Re: 2G RAM: how much swap space?
Message-ID:  <15156.58356.584788.836909@guru.mired.org>
In-Reply-To: <83951112@toto.iv>

next in thread | previous in thread | raw e-mail | index | archive | help
Bill Moran <wmoran@iowna.com> types:
> One thing to remember on this:
> If you ever have to debug a problematic kernel, you will need at least
> as much swap as you have RAM in order to do a crash dump.
> Considering how cheap HDD space is, I'd stick with the 2X rule, but I
> wouldn't drop below 1X if I were me. If you do so, you're basically in
> the dark if your kernel starts having trouble.

According to the dumpon man page, 1X isn't enough. You need at 1X +
64K *on the dump device* to get a valid dump. Also, the tuning man
page notes that FreeBSD's VM system is tuned to perform best with at
least 2X swap.

> > > What is the recommended partitioning scheme with regard to swap space
> > > for a web server (2 1-GHz PIII; *2G RAM*; 2 9G SCSI drives). Principle
> > > apps that the server will be running are Apache/mod_perl & MySQL.
> > >
> > > The defaults given by the FreeBSD install are 4099M swap on each
> > > drive, and this seems excessive considering half the disk space would
> > > be used for swap.

It looks like the installer doesn't deal well with multiple
disks. It's trying to follow the 2X rule on each drive.

First thing - split the swap evenly between the two drives. FreeBSD
will use both drives if it has to swap, improving performance.

If you don't think you're ever going to swap, the tuning page
recommends never configuring less than 256Meg. In that case, 128meg on
each drive is called for.

To make sure you're going to be able to take core dumps, you'll need 2
Gig + 64K on one of the drives. You should put 2 Gig (might as well
give it the 64K as well) on the other drive to let system stripe if
you have to swap. On the other hand, you're going to need 2 Gig of
free disk for savecore to write to, so that doesn't seem likely given
your current configuration.

I like swap, but I've been burned a couple of times due to running
out. If you really never expect to page things out, go with the 256
meg minimum as above, then set up something to monitor paging
activity, and if you ever start paging things out, prepare to spend
money on more hardware.

	<mike
--
Mike Meyer <mwm@mired.org>			http://www.mired.org/home/mwm/
Independent WWW/Perforce/FreeBSD/Unix consultant, email for more information.

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




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