Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 27 Nov 2001 00:11:53 -0600
From:      Mike Meyer <mwm@mired.org>
To:        "Anthony Atkielski" <anthony@freebie.atkielski.com>
Cc:        questions@freebsd.org
Subject:   Re: Calculating swap file size
Message-ID:  <15363.11945.410356.244254@guru.mired.org>
In-Reply-To: <11745395@toto.iv>

next in thread | previous in thread | raw e-mail | index | archive | help
Anthony Atkielski <anthony@freebie.atkielski.com> types:
> Since memory isn't very expensive these days, I'm thinking of adding more RAM to
> my FreeBSD machine; it has 256 MB, but I was thinking of going to 1 GB, which is
> the capacity of this machine.  Currently, I have a 800 MB swap partition (or is
> it a slice?--I know it's not a filesystem) defined.

It's a partition. Slices are MS-DOS things. Partitions are BSD things.

> Is this enough for 1 GB of RAM?

How much ram you have isn't the critical question. The critical
question is how much virtual space you need. If you need 800MB of
virtual and have 1Gig of real, you need 0 swap.

> Is there any kind of strong correlation between RAM size and swap file
> size that I have to be concerned about?

There are two: 1) you need at least RAM size + 64K to get a dump. 2)
The VM algorithms aren't quite as efficient if you have less than 2x
ram size.

> Does FreeBSD resort to swap only when RAM is exhausted, or does it
> have to use the swap file all the time (as in a one-to-one VM
> mapping scheme)?

Neither. It doesn't do a ono-to-one VM scheme, but the system is
opportunistic about putting things on swap and tagging the page as
"free" if it can.

> If the swap file is of less than optimal size, what happens?

Things are less than optimal. :-)

> I looked at the swapinfo command and it shows 0% of the swap file used (the
> system is not heavily loaded by any measure).

In your situation, there are three reasonable alternatives:

1) Remove the swap entirely. While there's been some work recently to
   deal with being out of virtual better, but I'm not sure I trust
   it. After all, the flip side of RAM being cheap is that disk is
   also cheap.

2) Leave swap as it is. You can then use paging activity as a warning
   that you need RAM - or paging space - as system usage picks up.

3) Grow swap to 1Gig + 64K. That way you can get crash dumps. Oh yeah
   - this has to be on a *single* swap partition.

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