Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 26 Apr 1999 10:58:28 -0400 (EDT)
From:      rdkeys@unity.ncsu.edu
To:        grog@lemis.com (Greg Lehey)
Cc:        questions@freebsd.org
Subject:   Re: Harddrives & Filesystems
Message-ID:  <199904261458.KAA16451@cc03du.unity.ncsu.edu>
In-Reply-To: <19990424111712.F97757@freebie.lemis.com> from "Greg Lehey" at Apr 24, 99 11:17:12 am

next in thread | previous in thread | raw e-mail | index | archive | help
> > 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.

Interesting.  I can only get it up to 25% usage throwing all my usual
things at it, such as X, webserving, and compiling userland stuff (not
the system) on different logins.  This is on a 50mb swap.

All my FBSD machines to date have been 16M ram things so my use of a
50mb swap was being more than generous, and it seems it is.

This does beg the question of what might be reasonable on a bigger
machine that I am getting for webserving, locally.  It will be a 
pentium III with 256mb ram and a 9 gig drive.  Based upon the 2X
swap sizing, that would suggest I use 500mb or more as the swap.
Is that reasonable, or would more be suggested?  If I am loading
out to a 25% swap usage on a machine with 3x ram for swap, then
it would suggest the 500mb swap would be reasonable, probably loading
out to 50% or so.

I have heard that the more memory you have, the less swapping is
actually done.  Is this also what occurs with FreeBSD?

> > 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.

Everything wants more swap..... but you are right, with the disk size
leaps these days, larger swaps are not intolerable.
 
> >>> 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.

I still would like to try to find out why, if anyone might know.
My workaround was to allow about 10% of the total filesystem size
as root, for drives larger than 500mb.  Technically, root only is
supposed to be 15mb in 4.4BSD, but apparently, more space is needed
in the recent developments.  This contrasts with the 4.2 based
sunos boxes I run that have an 8mb root and are happy.

> >>> 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.

OK, considering the case of my 16meg ram toys, having room for a 16M
crash dump, and space for spooing and the like, makes a 32mb var fair
to reasonable.  Considering the case of the 256mb webserver I am putting
up, then, var would need to be mem+10M+residual spooling, which would
imply maybe 300-500mb for var would be sufficient.  One question,
since I have yet to have a crash dump in the 5 years I have been playing
with FBSD (yeah, I know I don't really tax the machines), does a full
crash dump actually mirror then entire memory out to disk or does it
only dump the used memory out to disk?  That could affect the actual
amount of space needed for crash dumps.

> >>> If you add a third drive, and add lots of sofware, you might want
> >>> to put it on /usr/local or /usr/src.
 
> 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.

I will check that out.  Of late, I have been running 4 drives on 
my sun boxes for speed, and it seems to help.   I always try to put
2 drives on the ide pc FBSD boxes, and that seem to also help.

> Greg

Thanks Greg, good discussion...

Bob Keys



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?199904261458.KAA16451>