Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 8 Mar 2002 12:54:14 +0100 (CET)
From:      Mauritz Sundell <mauritz.sundell@telia.com>
To:        <questions@freebsd.org>
Cc:        <dillon@freebsd.org>
Subject:   swap-usage
Message-ID:  <20020308115843.O29414-100000@morgan.upsys.se>

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

After I have read about The FreeBSD VM System in the FreeBSD
Handbook I started to wonder if the swap-area(s) are used for
more things than I thought.

The questions below is not only applicable on FreeBSD but
the questions popped up in my head while reading whis article.

For me the swap-area is used only then the system have used
all available physical memory and need more and as soon as
the memory need decreases the swap is unused again. Further
I do not think that where are many applications that
allocates more memory if there are more memory available.

So why should I have swap partions on each physical disk?
Why should I have 2x the swap-space as main memory?

A person that have a system with 64MB RAM and 128MB swap
wants to speed up and buy another 64MB RAM, installing the
RAM the swapping should decrease and the swap-area could
even by decreased. Ok, now the person feel that the system
goes smoother and tend to have more applications running
at the same time when before. But if he felt the system
was slow before update he probably dont want more swapping
to be done than before so why should the swap be increased
by an other 128MB? Why should the usage of memory suddenly
increase from 192MB to 384MB because of an upgrade with
64MB?
The only time I want to increase swap-area is if I need more
(cheap and slow) memory.

Is there any unusal events that demands much swap to work?

If one wants crashdump at panics it can be assigned at
crashdevice without swapping (but it is no cost to swap on
an anayway allocated crasharea since it is not used in
normal run)

So if I deside not to have any swap-areas what do I miss
besides a good place for crash-dumps?

I know that thumb-rules as twice as much swap as ram is very
common for other OS as well but I have never been told why.

In http://docs.freebsd.org/handbook/en/4.3R/internals-vm.html
<dillon@freebsd.org> writes:

"Second, configure sufficient swap. You should have a swap
partition configured on each physical disk, up to four, even
on your ``work'' disks. You should have at least 2x the swap
space as you have main memory, and possibly even more if you
do not have a lot of memory. You should also size your swap
partition based on the maximum memory configuration you ever
intend to put on the machine so you do not have to
repartition your disks later on. If you want to be able to
accommodate a crash dump, your first swap partition must be
at least as large as main memory and /var/crash must have
sufficient free space to hold the dump"


--
Mauritz Sundell, mauritz.sundell@telia.com



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?20020308115843.O29414-100000>