Update sections relating to swap handling

This commit is contained in:
Matthew Dillon 1999-02-06 19:03:54 +00:00
parent 2ddf2d14bc
commit 646dfc8233
Notes: svn2git 2020-12-08 03:00:23 +00:00
svn path=/head/; revision=4228
2 changed files with 35 additions and 14 deletions

View file

@ -1,4 +1,4 @@
<!-- $Id: admin.sgml,v 1.17 1999-02-05 01:48:47 msmith Exp $ -->
<!-- $Id: admin.sgml,v 1.18 1999-02-06 19:03:54 dillon Exp $ -->
<!-- The FreeBSD Documentation Project -->
<sect>
@ -404,7 +404,12 @@
<heading>How can I add more swap space?</heading>
<p>The best way is to increase the size of your swap partition, or
take advantage of this convenient excuse to add another disk.
take advantage of this convenient excuse to add another disk. The
general rule of thumb is to have around 2x the swap space as you have
main memory. However, if you have a very small amount of main memory
you may want to configure swap beyond that. It is also a good idea
to configure sufficient swap relative to anticipated future memory
upgrades so you do not have to futz with your swap configuration later.
<p>Adding swap onto a separate disk makes things faster than
simply adding swap onto the same disk. As an example, if you
@ -412,15 +417,27 @@
another disk, this is much faster than both swap and compile
on the same disk. This is true for SCSI disks specifically.
<p> IDE drives are not able to allow access to both drives on
<p>When you have several disks, configuring a swap partition on
each one is usually beneficial, even if you wind up putting swap on a
work disk. Typically, each fast disk in your system should have some
swap configured. FreeBSD supports up to 4 interleaved swap devices by
default. When configuring multiple swap partitions you generally
want to make them all about the same size, but people sometimes make
their primary swap parition larger in order to accomodate a kernel
core dump. Your primary swap partition must be at least as large as
main memory in order to be able to accomodate a kernel core.
<p>IDE drives are not able to allow access to both drives on
the same channel at the same time (FreeBSD doesn't support mode 4, so
all IDE disk I/O is ``programmed''). I would still suggest putting
your swap on a separate drive however. The drives are so cheap,
it is not worth worrying about.
<p>It is a really bad idea to locate your swap file over NFS
unless you are running in a very fast networking environment, with
a good server.
<p>Swapping over NFS is only recommended if you do not have a local
disk to swap to. Swapping over NFS is slow and inefficient in FreeBSD
releases prior to 4.x, but reasonably fast in releases greater or
equal to 4.0. Even so, it will be limited to the network bandwidth
available and puts an additional burden on the NFS server.
<p>Here is an example for 64Mb vn-swap (<tt>/usr/swap0</tt>, though
of course you can use any name that you want).

View file

@ -1,4 +1,4 @@
<!-- $Id: misc.sgml,v 1.10 1999-01-28 00:00:50 nik Exp $ -->
<!-- $Id: misc.sgml,v 1.11 1999-02-06 19:03:54 dillon Exp $ -->
<!-- The FreeBSD Documentation Project -->
<sect>
@ -9,14 +9,18 @@
FreeBSD uses far more swap space than Linux. Why?
</heading>
<p>It doesn't. You might mean ``why does my swap seem full?''. If
that is what you really meant, it's because putting stuff in swap
rather than discarding it makes it faster to recover than if the
pager had to go through the file system to pull in clean
(unmodified) blocks from an executable.
<p>FreeBSD only appears to use more swap than Linux. In actual fact,
it does not. The main difference between FreeBSD and Linux in this
regard is that FreeBSD will proactively move entirely idle, unused pages
of main memory into swap in order to make more main memory available
for active use. Linux tends to only move pages to swap as a last resort.
The perceived heavier use of swap is balanced by the more efficient use
of main memory.
<p>The actual amount of dirty pages that you can have in core at
once is not reduced; the clean pages are displaced as necessary.
<p>Note that while FreeBSD is proactive in this regard, it does not
arbitrarily decide to swap pages when the system is truely idle. Thus
you will not find your system all paged out when you get up in the
morning after leaving it idle overnight.
<sect1>
<heading>