Skip site navigation (1)Skip section navigation (2)
Date:      09 Oct 2001 09:52:52 -0700
From:      swear@blarg.net (Gary W. Swearingen)
To:        Mike Meyer <mwm@mired.org>
Cc:        swear@blarg.net (Gary W. Swearingen), questions@FreeBSD.ORG
Subject:   Re: ideal swap partition space...
Message-ID:  <x8u1x8g3h7.1x8@localhost.localdomain>
In-Reply-To: <15298.9768.941595.251630@guru.mired.org>
References:  <15297.5510.364245.686083@guru.mired.org> <7ypu7ygeso.u7y@localhost.localdomain> <15298.9768.941595.251630@guru.mired.org>

next in thread | previous in thread | raw e-mail | index | archive | help
Mike Meyer <mwm@mired.org> writes:

> Gary W. Swearingen <swear@blarg.net> types:
> > I consider that far from ideal. :-)
> 
> Patches are appreciated :-).

I was too brief.  It's my ideal to never dump core; others may disagree.

> The author was Matt Dillon. There may be someone who knows more about
> the FreeBSD VM system, but I couldn't identify them.

Oops.  So we're only discussing what he meant by "perform best".

> > If one needs to page only 0.5x RAM, are we to believe that it makes
> > a performance difference if we have 1x or >2x swap?
> 
> Yes, you should. Remember, FreeBSD doesn't just swap pages out when it
> has to, it moves them to swap if they're idle and unused. So the
> amount you "need to page" is only part to the actual amount of swap
> the system will use to optimize performance.

Two points here. 1) When it swaps out pages it will never be swapping
back in (ie, more than my 0.5xRAM) it buys nothing and probably is
slowing things down (on average); better (on average or no worse) to
have discouraged it from unhelpful paging by not having the extra swap
space (for my limited 0.5xRAM requirements only of course).  (I suspect
there's some complicating issues near the limits, but give me a break.)

2) I can observe on my own system that it almost always has swapped out
less than 1xRAM pages.  I just can't believe the VM sytem cares how much
unused swap area I have, whether its 0.5xRAM, 1xRAM, or 5xRAM.

If the VM system requires more than a small fraction of RAM size to
achieve very-near-maximum speed, then I consider it bad design, in these
days of huge cheap RAM when a user-friendly system design will use
allocate swap only as safety margin to avoid crashes from unplanned-for
things like a memory leak (and not waste disk space that will never be
used for anything whatsoever as the 2x rule would require in this case).

> While you may be just as comfortable, but your performance might well
> suffer. Again quoting the tuning man page: "Configuring too little
> swap can lead to inefficiencies in the VM page scanning code".

The words "might", "can", and "too" leave me comfortable.  It IS easy to
believe that the VM paging becomes inefficient when you get the swap
area close to full, so more swap is "best" in some sense, but not in the
sense that was being discussed, where you're asking for large areas of
unused swap area, given my scenario of limited VM size needs.

> You could ask Matt, but I suspect that if he meant someting like that,
> he would have said it.

I suspect that you write more easily than Matt.  Technical writing is
hard work for most people and it's very easy to try to be concise,
leaving things unsaid and too often ambiguous.  In man page writing
it's obviously de rigueur, giving grief to thousands.  But, hey, I 
don't mean to bite the hands that feed us; I'm very happy to have 
the benefit of a tuning man page at all.

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?x8u1x8g3h7.1x8>