Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 24 Apr 1999 11:17:12 +0930
From:      Greg Lehey <grog@lemis.com>
To:        rdkeys@unity.ncsu.edu
Cc:        questions@freebsd.org
Subject:   Re: Harddrives & Filesystems
Message-ID:  <19990424111712.F97757@freebie.lemis.com>
In-Reply-To: <199904231408.KAA10359@cc03du.unity.ncsu.edu>; from rdkeys@unity.ncsu.edu on Fri, Apr 23, 1999 at 10:08:37AM -0400
References:  <19990423104344.H91260@freebie.lemis.com> <199904231408.KAA10359@cc03du.unity.ncsu.edu>

next in thread | previous in thread | raw e-mail | index | archive | help
On Friday, 23 April 1999 at 10:08:37 -0400, rdkeys@unity.ncsu.edu wrote:
>>> Usually 1-2x is sufficient for swap, so use 128mb for swap.
>>
>> I'd recommend about 256 MB for swap.  In view of the small first disk,
>> I'd put about 64 MB on the first disk and 192 MB on the second disk.
>> The ratio of main memory to swap is not so important, but you should
>> have at least one swap partition slightly larger than main memory so
>> that you can take crash dumps.
>
> Everyone has their pet ideas about this, but I am very curious why
> folks need so much swap?

Because it gets used:

 $ pstat -s
 Device      1048576-blocks     Used    Avail Capacity  Type
 /dev/wd0s1b             49       49        0    99%    Interleaved
 /dev/sd0b              399      221      178    55%    Interleaved
 Total                  449      270      178    60%

FreeBSD's VM system is very efficient, but one of the tradeoffs is
that is uses much more swap than other systems.  Given the cost of
disk, I think this is a valid tradeoff.

> A couple of my early machines only need mem+64bytes for crash dumps.

I have a PDP-11 with 9 MB swap, which never gets used.  But that's an
old machine.

> Some early machines run with no swap, or a swap file or a swap
> floppy for dumps.

So does PicoBSD.

> I am very interested, for the sake of discussion, just what actually
> is needed for swap, and what actually is expected to be needed for
> swap, depending upon machine configuration, load, etc.  Any insights
> are appreciated.

There are a few reasons why this is difficult:

1.  It depends on what you're doing.  I have one application (during
    the build of "The Complete FreeBSD") which can use up to 100 MB of
    virtual memory.  Before I added the second swap partition, I was
    continually running out of swap.

2.  It's very difficult to predict how much space a specific process
    will require.  The interdependencies in the VM system are the most
    complex part of the system, and there's no good documentation.
    Even the VM architects get surprises from time to time.

3.  It will change.  Expect FreeBSD to become even more swap-hungry.

>>> Use about 64mb for root.
>>
>> That's generous, but not too much.
>
> I have had a couple of FBSD systems run out of root space when
> the file systems got larger than a total of around 1 gig.  Upping
> the root size from 32 to 64mb, for example, cured that.  Anyone
> know exactly why that would happen?

No.  I suspect that this is more a coincidence than anything else.

>>> Use about 32mb for var.
>>
>> If you *must* use a separate /var file system, calculate the size you
>> will need.  If you don't know how to do that, you don't need /var.
>
> OK, for discussion, detail what you expect to have to do to calculate
> var space.

It depends on what you want to do.  That's why I said "If you don't
know how to do that, you don't need /var."  I don't use a /var file
system myself, and I was rather surprised when I ran a du on it and
found I was using 1 GB of storage for it (most of it panic dumps).
Consider that a single panic dump (which you should have enabled) will
take about 10 MB more than the size of your memory, and it goes to
/var/crash.

>>> If you add a third drive, and add lots of sofware, you might want
>>> to put it on /usr/local or /usr/src.
>>>
>>> With the above scheme, drives are flopping all over on their head
>>> actuators.
>>
>> I'm not sure I understand this statement.  Anyway, in this
>> configuration you'll find that you'll need some symlinks from /usr to
>> /home, particularly /usr/local.  I'd make /var a symlink to /home/var.
>
> That was not worded very well... on some machines I have run into
> situations where speed was important, moving highly active file systems
> to separate drives tended to reduce head chatter, audibly, and made
> the machines faster, by levelling out the loading.  Although modern
> drives are huge, these days, so space is not all that critical, I still
> prefer to have at least 2 drives in any machine to reduce the head
> chatter and even out loading.  It also is good juju to keep my things
> separated out from the machine things should it crash.

Correct.  Probably the basic key to disk performance improvement is
"more spindles".  Take a look at http://www.lemis.com/vinum/intro.html
for an illustration of the difference this makes.

Greg
--
See complete headers for address, home page and phone numbers
finger grog@lemis.com for PGP public key


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?19990424111712.F97757>