Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 7 Oct 2001 21:55:02 -0500
From:      Mike Meyer <mwm@mired.org>
To:        swear@blarg.net (Gary W. Swearingen)
Cc:        questions@freebsd.org
Subject:   Re: ideal swap partition space...
Message-ID:  <15297.5510.364245.686083@guru.mired.org>
In-Reply-To: <21548426@toto.iv>

next in thread | previous in thread | raw e-mail | index | archive | help
Gary W. Swearingen <swear@blarg.net> types:
> "default" <default013subscriptions@hotmail.com> writes:
> > I'm curious about setting up the amount of space for the swap partition...
> > is there any ideal amount for FreeBSD?
> Yes. None.

Only under some conditions. If you want to get core dumps after a
panic, then the dump device needs to be at least 64K bigger than
memory. You might as well use that device for swap, as you can't use
it for anything else while the system is running.

If you can't afford enough real RAM to hold everything, you'll have to
swap. According to the tuning man page, "The kernel's VM paging
algorithms are tuned to perform best when there is at least 2x swap
versus main memory."

If you have two drives, putting memory size + 64KB of swap on each
drive gives you enough to take dumps, takes advantage of the tuning of
the VM system, and lets the system interleave swap - and is the
minimum that will do all of that.  Assuming you have enough RAM that
you're not going to run out of virtual with that configuration.

> Forget the two-times thing; it's needlessly simple, leaving out any
> consideration of what software you want to run or how big your hard
> disks are.  It does have the benefit of requiring only a second of
> thought as opposed to having to make estimates and predictions.

The two-times rule dates from the days when all memory was backed by
swap, and was the minimum amount required to get a core dump after a
panic. I have no idea how much that has to do with the VM paging
algorithms liking two times the main memory.

But your main point here is correct - actually thinking about what
you're going to be doing is more work, but gets better results, than
blindly following rules of thumb.

	<mike
--
Mike Meyer <mwm@mired.org>			http://www.mired.org/home/mwm/
Q: How do you make the gods laugh?		A: Tell them your plans.

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?15297.5510.364245.686083>