From owner-freebsd-questions Mon Nov 26 22:11:59 2001 Delivered-To: freebsd-questions@freebsd.org Received: from guru.mired.org (okc-65-31-203-60.mmcable.com [65.31.203.60]) by hub.freebsd.org (Postfix) with SMTP id 6F52437B417 for ; Mon, 26 Nov 2001 22:11:54 -0800 (PST) Received: (qmail 73204 invoked by uid 100); 27 Nov 2001 06:11:53 -0000 From: Mike Meyer MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <15363.11945.410356.244254@guru.mired.org> Date: Tue, 27 Nov 2001 00:11:53 -0600 To: "Anthony Atkielski" Cc: questions@freebsd.org Subject: Re: Calculating swap file size In-Reply-To: <11745395@toto.iv> X-Mailer: VM 6.90 under 21.1 (patch 14) "Cuyahoga Valley" XEmacs Lucid X-face: "5Mnwy%?j>IIV\)A=):rjWL~NB2aH[}Yq8Z=u~vJ`"(,&SiLvbbz2W`;h9L,Yg`+vb1>RG% *h+%X^n0EZd>TM8_IB;a8F?(Fb"lw'IgCoyM.[Lg#r\ Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Anthony Atkielski types: > Since memory isn't very expensive these days, I'm thinking of adding more RAM to > my FreeBSD machine; it has 256 MB, but I was thinking of going to 1 GB, which is > the capacity of this machine. Currently, I have a 800 MB swap partition (or is > it a slice?--I know it's not a filesystem) defined. It's a partition. Slices are MS-DOS things. Partitions are BSD things. > Is this enough for 1 GB of RAM? How much ram you have isn't the critical question. The critical question is how much virtual space you need. If you need 800MB of virtual and have 1Gig of real, you need 0 swap. > Is there any kind of strong correlation between RAM size and swap file > size that I have to be concerned about? There are two: 1) you need at least RAM size + 64K to get a dump. 2) The VM algorithms aren't quite as efficient if you have less than 2x ram size. > Does FreeBSD resort to swap only when RAM is exhausted, or does it > have to use the swap file all the time (as in a one-to-one VM > mapping scheme)? Neither. It doesn't do a ono-to-one VM scheme, but the system is opportunistic about putting things on swap and tagging the page as "free" if it can. > If the swap file is of less than optimal size, what happens? Things are less than optimal. :-) > I looked at the swapinfo command and it shows 0% of the swap file used (the > system is not heavily loaded by any measure). In your situation, there are three reasonable alternatives: 1) Remove the swap entirely. While there's been some work recently to deal with being out of virtual better, but I'm not sure I trust it. After all, the flip side of RAM being cheap is that disk is also cheap. 2) Leave swap as it is. You can then use paging activity as a warning that you need RAM - or paging space - as system usage picks up. 3) Grow swap to 1Gig + 64K. That way you can get crash dumps. Oh yeah - this has to be on a *single* swap partition. http://www.mired.org/home/mwm/ Q: How do you make the gods laugh? A: Tell them your plans. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message