From owner-freebsd-questions Tue Nov 27 6:29:40 2001 Delivered-To: freebsd-questions@freebsd.org Received: from luke.immure.com (luke.immure.com [207.8.42.74]) by hub.freebsd.org (Postfix) with ESMTP id A580137B41A for ; Tue, 27 Nov 2001 06:29:34 -0800 (PST) Received: (from bob@localhost) by luke.immure.com (8.11.6/8.11.6) id fARES4H06134; Tue, 27 Nov 2001 08:28:04 -0600 (CST) (envelope-from bob) Date: Tue, 27 Nov 2001 08:28:04 -0600 From: Bob Willcox To: "Brian T. Schellenberger" Cc: "Patrick O'Reilly" , Nils Holland , FreeBSD Question List Subject: Re: Softupdates Message-ID: <20011127082804.A4524@luke.immure.com> Reply-To: Bob Willcox References: <01112609195201.00903@i8k.babbleon.org> <20011126172050.A63285@luke.immure.com> <01112623573601.00696@i8k.babbleon.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <01112623573601.00696@i8k.babbleon.org>; from bts@babbleon.org on Mon, Nov 26, 2001 at 11:57:36PM -0500 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 On Mon, Nov 26, 2001 at 11:57:36PM -0500, Brian T. Schellenberger wrote: > On Monday 26 November 2001 18:20, Bob Willcox wrote: > > On Mon, Nov 26, 2001 at 09:19:52AM -0500, Brian T.Schellenberger wrote: > > > > [snip] > > > > > Also, you most definately should turn off write-caching if you turn on > > > softupdates. In fact, you should do this anyway: softupdates are really > > > rather safe, but write caching is quite dangerous, and doubly so with > > > softupdates enabled. > > > > > > To do this, set > > > > > > hw.ata.wc=0 > > > > > > in your /boot/loader.conf (assuming IDE devices). > > If you use softupdates *and* enable write caching then you will screw up your > disk with a simple sequence like > > rm -r foo/* > shutdown -p now > > because the softupdates process will just finish writing its updates before > the power is clobbered. Well, my systems don't power down on shutdown (sounds like yours maybe do). I have to push the power off button so my disk usually has quite a bit of time to flush its cache. > > At least that happens with my hardward, so softupdates is not compatible with > write-cache-enabled. > > And from what I can tell (no rigorous testing), softupdates w/o write cache > is just as fast as non-softupdates w/ write cache, but lots safer. Try some benchmarks. An IBM DTLA 45GB drive that I tested with bonnie gave me these results with and without write caching: -------Sequential Output-------- ---Sequential Input-- --Random-- IBM DTLA -Per Char- --Block--- -Rewrite-- -Per Char- --Block--- --Seeks--- WITH WC 1000 26068 34.4 26180 12.7 13990 10.3 27597 57.0 29819 12.4 344.3 1.3 W/O WC 1000 9768 13.1 9784 4.8 7547 5.5 26801 55.9 31608 13.8 172.5 0.8 This was on the exact same hardware (a 1.33 GHz Athlon system). As you can see in the second case (w/o write caching) the write performance is considerably down. Since bonnie is a simple benchmark program that writes a single file softupdates won't help. This is where I saw the performance penalty, writing large files. I suspect that without write caching enabled in the drive the system was not able to send the next block of data to the disk in time for it to not have to take an additional revolution in order to write it. > I know > that I've crashed 8 times in the last 36 hours and I'm darn glad I don't > enable write caching! (Of course that's not the norm, but sometimes I manage > that sort of thing.) I still contend that as long as you don't suddenly lose power and the drive's firmware has a reasonable write behind behavior (i.e., it will eventually write the data within a reasonable period...I can't confirm this one), then the blocks that reside in the disk's cache will be written to the disk even with a system crash (not involving power failure). BTW, all of my really critical data is kept on a separate system on SCSI disks. Also, usually none of my "production" systems crash as many as 8 times in a year. :-) Of course, it's your data. :-) If you don't feel safe doing it then by all means don't. I'm certainly not trying to talk you into it...just expressing a different point of view. Bob -- Bob Willcox Boucher's Observation: bob@vieo.com He who blows his own horn always plays the music Austin, TX several octaves higher than originally written. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message