Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 27 Nov 2001 10:26:04 +0100
From:      "Anthony Atkielski" <anthony@freebie.atkielski.com>
To:        "Mike Meyer" <mwm@mired.org>
Cc:        <questions@freebsd.org>
Subject:   Re: Calculating swap file size
Message-ID:  <003701c17725$8abc5c20$0a00000a@atkielski.com>
References:  <15363.11945.410356.244254@guru.mired.org>

next in thread | previous in thread | raw e-mail | index | archive | help
Based on what I've read here and elsewhere, I'll probably leave the swap at 800
MB for now.  I'd have to backup, recreate, and restore one of the filesystems
(probably /usr) to make more space for a bigger swap partition, and I'd prefer
not to undertake that until I'm comfortable with my backup procedures.  If I
understand you and others correctly, as long as all processes can be contained
in RAM, swap space will never be used at all--and even if they cannot be
contained in RAM, as long as RAM + swap is enough, there should be no problem
(?).

As for panic dumps, my view is that any system that crashes often enough to
justify worrying about allocating space to collect the dumps is not ready for
prime time, and has no place in a production environment.

----- Original Message -----
From: "Mike Meyer" <mwm@mired.org>
To: "Anthony Atkielski" <anthony@freebie.atkielski.com>
Cc: <questions@freebsd.org>
Sent: Tuesday, November 27, 2001 07:11
Subject: Re: Calculating swap file size


> 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?003701c17725$8abc5c20$0a00000a>