Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 27 Apr 1999 09:40:29 +0930
From:      Greg Lehey <grog@lemis.com>
To:        rdkeys@unity.ncsu.edu
Cc:        questions@freebsd.org
Subject:   Re: Harddrives & Filesystems
Message-ID:  <19990427094029.H46511@freebie.lemis.com>
In-Reply-To: <199904261458.KAA16451@cc03du.unity.ncsu.edu>; from rdkeys@unity.ncsu.edu on Mon, Apr 26, 1999 at 10:58:28AM -0400
References:  <19990424111712.F97757@freebie.lemis.com> <199904261458.KAA16451@cc03du.unity.ncsu.edu>

next in thread | previous in thread | raw e-mail | index | archive | help
On Monday, 26 April 1999 at 10:58:28 -0400, rdkeys@unity.ncsu.edu wrote:
>>> 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.

For what you're doing, definitely.

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

I think you have just demonstrated that the 2x rule of thumb is pretty
meaningless.

> that would suggest I use 500mb or more as the swap.  Is that
> reasonable, or would more be suggested?

I'd guess that 500 MB would be reasonable.  You need to know where to
find more swap if you need it, though.

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

If you change the usage of the machine, you've got to start again from
scratch with your calculations.  The only way to find out is to try
it.  But it's easier to have 50% swap usage than 100% swap usage and
occasional crashes.

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

Up to a point.  FreeBSD starts swapping things out when it has nothing
better to do, so it will use more swap than other systems.  It also
means that if a process needs memory in a hurry, FreeBSD can just
steal pages from other processes, since they're already swapped out.
Other systems have to swap first, which reduces performance.

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

Maybe.  But why run the risk?

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

Yes.

> That could affect the actual amount of space needed for crash dumps.

Definitely.  Some systems take signature dumps and current memory
dumps and other obscenities.  That saves space.  Of course, you'd save
even more space by not taking a dump at all.

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?19990427094029.H46511>