Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 06 Jan 2011 09:42:36 +0000
From:      Matthew Seaman <m.seaman@infracaninophile.co.uk>
To:        Jeff Whitman <JWhitman@JWNetSource.com>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: Swap Space
Message-ID:  <4D258E8C.4020004@infracaninophile.co.uk>
In-Reply-To: <009b01cbad28$883d31c0$98b79540$@com>
References:  <009b01cbad28$883d31c0$98b79540$@com>

next in thread | previous in thread | raw e-mail | index | archive | help
This is an OpenPGP/MIME signed message (RFC 2440 and 3156)
--------------enig8662DB4B109285603E8F0542
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

On 05/01/2011 22:33, Jeff Whitman wrote:
> I'm finding conflicting data on this.  Some say 0, some say 1 times RAM=
,
> others say stay with 2 x RAM.

Standard advice is 2x RAM -- but that dates back to the days when
servers would have quantities of RAM measured in Megabytes rather than
Gigabytes.

2 X RAM is a lot of disk space nowadays -- so either you'll need to find
some other use for that space; eg. as a swap-backed /tmp partition,
or else provide less swap.  Also, there's a maximum of -- I think -- 8GB
swap above which the performance of swap is degraded, due to algorithmic
limits in the way memory pages are mapped onto disk pages.

You need 1 x RAM + a few kB in order to support getting a crashdump. Or
at least, you did before the days of minidumps.  Not sure what the
requirements are for getting system dumps nowadays.  Swap space used for
crashdumps should be a raw partition, not a file.

On the other hand, for good performance you should not be using any
significant amounts of swap in normal usage.  You will need some swap,
as the OS tends to use a small amount even when not under memory
pressure.  You should have swap to act as a buffer in case your machine
suddenly starts using up more memory than you expect, either because of
memory leaks, or due to demand spikes or through any number of other
possible causes.

Therefore, I think the best advice for a modern large memory system
would be:

    If RAM > 8GB, then SWAP =3D 8GB[*]
    If RAM < 8GB, then SWAP =3D 1 x RAM + delta

where delta is perhaps a Megabyte or so.  Just rounding the partition
size up to the next cylinder boundary should be enough (which happens
automatically with most partitioning schemes).

	Cheers,

	Matthew

[*] In this case, if you need crashdumps, you should dedicate another
otherwise unused partition of the correct size as your dumpdev.

--=20
Dr Matthew J Seaman MA, D.Phil.                   7 Priory Courtyard
                                                  Flat 3
PGP: http://www.infracaninophile.co.uk/pgpkey     Ramsgate
JID: matthew@infracaninophile.co.uk               Kent, CT11 9PW


--------------enig8662DB4B109285603E8F0542
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="signature.asc"

-----BEGIN PGP SIGNATURE-----
Version: GnuPG/MacGPG2 v2.0.16 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk0ljpQACgkQ8Mjk52CukIwuyQCeNYOXs+6mSeiKW0jvm/eNMb7z
4QEAnjA4wjZ4KmxMjlc98CbXxnDWNLaf
=fNQu
-----END PGP SIGNATURE-----

--------------enig8662DB4B109285603E8F0542--



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