From owner-freebsd-questions Sat Jun 23 11:46:16 2001 Delivered-To: freebsd-questions@freebsd.org Received: from guru.mired.org (okc-27-141-144.mmcable.com [24.27.141.144]) by hub.freebsd.org (Postfix) with SMTP id B659D37B408 for ; Sat, 23 Jun 2001 11:46:13 -0700 (PDT) (envelope-from mwm@mired.org) Received: (qmail 56938 invoked by uid 100); 23 Jun 2001 18:46:12 -0000 From: Mike Meyer MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <15156.58356.584788.836909@guru.mired.org> Date: Sat, 23 Jun 2001 13:46:12 -0500 To: Bill Moran Cc: questions@freebsd.org Subject: Re: 2G RAM: how much swap space? In-Reply-To: <83951112@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 Bill Moran types: > One thing to remember on this: > If you ever have to debug a problematic kernel, you will need at least > as much swap as you have RAM in order to do a crash dump. > Considering how cheap HDD space is, I'd stick with the 2X rule, but I > wouldn't drop below 1X if I were me. If you do so, you're basically in > the dark if your kernel starts having trouble. According to the dumpon man page, 1X isn't enough. You need at 1X + 64K *on the dump device* to get a valid dump. Also, the tuning man page notes that FreeBSD's VM system is tuned to perform best with at least 2X swap. > > > What is the recommended partitioning scheme with regard to swap space > > > for a web server (2 1-GHz PIII; *2G RAM*; 2 9G SCSI drives). Principle > > > apps that the server will be running are Apache/mod_perl & MySQL. > > > > > > The defaults given by the FreeBSD install are 4099M swap on each > > > drive, and this seems excessive considering half the disk space would > > > be used for swap. It looks like the installer doesn't deal well with multiple disks. It's trying to follow the 2X rule on each drive. First thing - split the swap evenly between the two drives. FreeBSD will use both drives if it has to swap, improving performance. If you don't think you're ever going to swap, the tuning page recommends never configuring less than 256Meg. In that case, 128meg on each drive is called for. To make sure you're going to be able to take core dumps, you'll need 2 Gig + 64K on one of the drives. You should put 2 Gig (might as well give it the 64K as well) on the other drive to let system stripe if you have to swap. On the other hand, you're going to need 2 Gig of free disk for savecore to write to, so that doesn't seem likely given your current configuration. I like swap, but I've been burned a couple of times due to running out. If you really never expect to page things out, go with the 256 meg minimum as above, then set up something to monitor paging activity, and if you ever start paging things out, prepare to spend money on more hardware. http://www.mired.org/home/mwm/ Independent WWW/Perforce/FreeBSD/Unix consultant, email for more information. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message