From owner-freebsd-questions@FreeBSD.ORG Mon Mar 17 22:12:29 2008 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 677321065670 for ; Mon, 17 Mar 2008 22:12:29 +0000 (UTC) (envelope-from chris@vindaloo.com) Received: from corellia.vindaloo.com (corellia.vindaloo.com [64.51.148.100]) by mx1.freebsd.org (Postfix) with ESMTP id 2E3618FC18 for ; Mon, 17 Mar 2008 22:12:29 +0000 (UTC) (envelope-from chris@vindaloo.com) Received: from hadar.vindaloo.com (hadar.vindaloo.com [172.24.145.72]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by corellia.vindaloo.com (Postfix) with ESMTP id 6EBD25D6B; Mon, 17 Mar 2008 18:12:26 -0400 (EDT) Message-Id: <64A3D312-9171-4689-9786-7BE0060B1406@vindaloo.com> From: Christopher Sean Hilton To: Daniel Bye In-Reply-To: <20080317201442.GA26672@torus.slightlystrange.org> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v919.2) Date: Mon, 17 Mar 2008 18:12:25 -0400 References: <47DE312E.2030209@esiee.fr> <20080317201730.G88797@wojtek.tensor.gdynia.pl> <200803171934.06136.lists-fbsd@shadypond.com> <20080317201442.GA26672@torus.slightlystrange.org> X-Mailer: Apple Mail (2.919.2) Cc: freebsd-questions@freebsd.org Subject: Re: Does softupdate help squid ? X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Mar 2008 22:12:29 -0000 On Mar 17, 2008, at 4:14 PM, Daniel Bye wrote: > On Mon, Mar 17, 2008 at 07:34:04PM +0000, Pollywog wrote: >> On Monday 17 March 2008 19:17:58 Wojciech Puchar wrote: >>>> i would say it's absolutely needed. >>> >>> anyway - any reason to not use soft updates on every filesystem? >> >> What exactly is a soft update? > > It's a bit like a hard update, but it won't hurt your disks as much > if your system crashes... ;-P > > On a more serious note, it's a technique for ensuring the integrity of > disks after a system crash or power failure. Like journalling, they > don't guarantee data won't be lost, but instead that the disks will be > in a consistent state at recovery. > Soft updates is a means of re-ordering the writes to a filesystem such that the complete filesystem, both data and meta data, remains reasonably consistent during the writing process. This consistency is necessary insurance in case of a system crash or power failure during the writing process. Soft updates seeks to re-order the writes in such a way that the filesystem can be safely recovered by an automatic fsck process when the system is restarted. At the same time soft updates works to maintain high system performance . Previous to soft updates you could either mount the filesystem synchronously or asynchronously. With Synchronous mounts the filesystem meta data writes were handled before data writes. This caused excessive and expensive seeking from the disk mechanism as it moved from one part of the disk to update the meta-data to the other part of the disk to write the application data. With an asynchronous mount the kernel was free to perform the writes in the order most beneficial for performance but if the system crashed in the middle of a write one could expect a very difficult situation for fsck to fix. My squid is on OpenBSD. My cache partition is spread across two spindles of a drive provided by the ccd driver mounted either asynchronously or with soft updates. Either way is fine because if my squid machine were to crash so hard that the cache partition was toast it wouldn't take but 10 minutes rebuild the filesystem from scratch and use squid -z to reinitialize it. For me there's really no data on there worthy of softupdates. -- Chris