Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 10 Dec 2003 02:41:26 -0600 (CST)
From:      Mike Silbersack <silby@silby.com>
To:        nbari@unixmexico.com
Cc:        freebsd-hackers@freebsd.org
Subject:   Re: adding more ram
Message-ID:  <20031210023427.T14579@odysseus.silby.com>
In-Reply-To: <20571.148.243.211.1.1071036438.squirrel@mail.unixmexico.com>
References:  <20571.148.243.211.1.1071036438.squirrel@mail.unixmexico.com>

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

On Wed, 10 Dec 2003 nbari@unixmexico.com wrote:

> Hi all.
>
> I have a server with 1GB of RAM and a swap partition of 2GB i will upgrade
> the memory server to 2GB so my questions are:
>
> should i fix the swap partition to have now 4GB of space ?
>
> what other changes do i have to make to my system after adding more ram ?
>
> regards.

Dan's advice seems good; swapping more than a gig of data would be awful.

I'm replying because I want to answer your real question. <g> The notion
of swap = 2 x ram is an old one, and is no longer applicable.  (Some)
older VM systems used very simplistic swapping mechanisms, which required
entire processes to be swapped, thereby requiring large amounts of swap
space.  FreeBSD (and other modern OSes) page out to the swap file in
increments of 4K pages, and do so in a flexible manner.  As a result, you
should always have *some* swap space to handle overload cases, but it's
not necessary to keep any specific ram to swap ratio.

(Actually, the term "swapping" is still used inside the FreeBSD kernel,
but it only applies to paging out the last 20K or so of a process's
memory.)

Now, to contradict myself, there *is* a reason that you might wish to have
a larger swapfile.  Taking a crashdump requires that the swap file must be
of the size RAM + 64K or so.  Hence, your present swap file might be
slightly too small to take a crashdump once you upgrade to 2G ram.
Whether this is an issue for you or not depends on how often your machine
crashes and whether you wish to debug it. :)

Mike "Silby" Silbersack



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