Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 14 Sep 2011 14:55:53 +0100
From:      Matthew Seaman <m.seaman@infracaninophile.co.uk>
To:        Jonathan Vomacka <juvix88@gmail.com>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: Recommended SWAP space for large amounts of ram (8GB)
Message-ID:  <4E70B269.4020900@infracaninophile.co.uk>
In-Reply-To: <4E709F62.60705@gmail.com>
References:  <4E709F62.60705@gmail.com>

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

On 14/09/2011 13:34, Jonathan Vomacka wrote:
> Each operating system seems to have different documentation regarding
> what a decent swap size is for systems with large amounts of RAM. My
> system only has 8GB of RAM. Some people have gone with the general idea=

> that 2X the amount of RAM is sufficient but for systems with large
> amounts of memory 1X the amount of RAM is fine. I was also told that
> anything over 2GB of SWAP space will cause performance issues on the
> system and that it is not recommended.
>=20
> Either from the FreeBSD docs, or based on personal experiences, what is=

> the recommended swap space for a 8GB system? Your opinions are greatly
> appreciated

The old rule of thumb of swap =3D 2 x RAM dates back to the days when
128MB RAM was a big deal.  Nowadays, you're likely to have that much in
your phone, and systems with 128GB RAM are not unknown.

In these days of plentiful RAM, the new rule of thumb is "if you're
swapping, then you're doing it wrong."  You don't need anything like as
much swap nowadays, at least, not as compensation for lack of RAM.  You
may need swap to back eg. tmpfs filesystems.  You don't need swap
nowadays for system dumps -- any partition with ephemeral data (or no
data at all) can be used for dumping, and given that minidump capability
exists now, you don't even need to supply the 1 x RAM + delta required
for a full dump.

That swap > 2GB resulted in performance problems was certainly true
once, but I doubt very much that it is still the case in HEAD or the
upcoming 9.0-RELEASE, nor probably in {7,8}-STABLE.  IIRC the problem
was due to avoiding integer overflow in some calculations deep inside
the VM system, which is usually not a hugely difficult problem to fix.

My recommendation: for systems with 1GB RAM or more, and that don't make
heavy use of memory filesystems and the like, then 2GB swap is ample,
and you can probably get away with as little as 1GB at need.

	Cheers,

	Matthew

--=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


--------------enigF5799931A0D46E8F1C78C2B2
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/

iEYEARECAAYFAk5wsnEACgkQ8Mjk52CukIxgBwCcCZtzerhFhjMas6QRfN0fRLL6
5y4AoIjXSIuMTrWfz4xe8Sl0gajmZmaV
=o2No
-----END PGP SIGNATURE-----

--------------enigF5799931A0D46E8F1C78C2B2--



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