Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 24 Sep 1997 03:10:39 -0500 (EST)
From:      "John S. Dyson" <toor@dyson.iquest.net>
To:        bsdchat@shadows.aeon.net (mika ruohotie)
Cc:        chat@FreeBSD.ORG
Subject:   Re: Linux faster thasn FreeBSD
Message-ID:  <199709240810.DAA03611@dyson.iquest.net>
In-Reply-To: <199709240622.JAA26396@shadows.aeon.net> from mika ruohotie at "Sep 24, 97 09:22:30 am"

next in thread | previous in thread | raw e-mail | index | archive | help

mika ruohotie said:
> > These days I'm down to 32M core and up to 64M swap. Good Old X11R6... :-)
> 
> hmmm...
> 
> disk space being cheapo as it is nowadays, it never hurts to have swap
> around...
> 
> my 64M system has 256M swap, and _yes_, i once, so far, did run out of
> swap!
> 
> from the past i recall some old unix thumb rule to have at least 2.5 times
> the amount of memory as swap. in machines where i use multiple disks, i
> normally swap about 128M each, no matter how huge swap i'd gain that way.
> 
> also, it's rather understandable, i think, that people who are saved from
> limux world into bsd world might be little confused how much swap an unix
> machine needs, considering limux uses it's vm-system differently...
> 
> (right?)
> 
Basically, the FreeBSD VM attitude is that mem is faster to execute
code out of rather than disk.  Also, disk is very very cheap.  If there is
memory that is being used, and other, more useful code or data could be
residing there, we should make the memory available for better use.  To make
it available, we might have to push pages out the swap.

Some OSes are designed with the attitude of saving swap space, because it
is a very precious, expensive commodity.  (In some cases it is, esp, diskless
clients.)  In many of our normal applications, it is very far from true.

It is just an issue of education.  On FreeBSD, it is not safe to get by with less
than 1X memory for swap space in the long term, period.  Beyond that, we
are talking rules of thumb, and IMO 2X is just as valid for some applications
as 6X is for others.  (This suggestion might be different from the past), but
I suggest a minimum of 128MB of swap space or 2-3X memory, whichever is greater,
for a typical X-based workstation.  One can temporarily get by with less, but
all bets are off.  The actual formula is:

	Total amount of swap space needed = total amount of swap space needed.
			:-).

It has very little actual relationship with the total amount of memory in the
system, except one is in for real trouble if the swap space is less than
the size of memory.

	Another form of the formula above:

	Total amount of swap space needed is approximately related to the size of
	all processes in the system.

So, if you add the size of all processes in the system (plus a little more),
that is the maximum amount of swap space that you might use.  The standard tools
on our system do not adequately measure the total size of a process, even
though /proc/<pid>/map comes close.


-- 
John
dyson@freebsd.org
jdyson@nc.com




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199709240810.DAA03611>