Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id 51F7164FCD2 for ; Fri, 12 Sep 2008 06:12:01 -0300 (ADT) Received: from postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 67687-05 for ; Fri, 12 Sep 2008 06:11:50 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from westnet.com (westnet.com [216.187.52.2]) by postgresql.org (Postfix) with ESMTP id 1EAB064FCBD for ; Fri, 12 Sep 2008 06:11:49 -0300 (ADT) Received: from westnet.com (localhost [127.0.0.1]) by westnet.com (8.14.0/8.14.0) with ESMTP id m8C9Bkb7013013; Fri, 12 Sep 2008 05:11:46 -0400 (EDT) Received: from localhost (gsmith@localhost) by westnet.com (8.14.0/8.13.2/Submit) with ESMTP id m8C9Bjol013009; Fri, 12 Sep 2008 05:11:46 -0400 (EDT) X-Authentication-Warning: westnet.com: gsmith owned process doing -bs Date: Fri, 12 Sep 2008 05:11:45 -0400 (EDT) From: Greg Smith X-X-Sender: gsmith@westnet.com To: Guillaume Cottenceau cc: pgsql-performance@postgresql.org Subject: Re: Choosing a filesystem In-Reply-To: <873ak5iwru.fsf@mnc.ch> Message-ID: References: <48C94770.2090505@shopzeus.com> <20080911172332.GP6714@it.is.rice.edu> <48C90F58.EE98.0025.0@wicourts.gov> <48C959BD.80307@shopzeus.com> <48C97740.9040404@emolecules.com> <873ak5iwru.fsf@mnc.ch> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests=none X-Spam-Level: X-Archive-Number: 200809/163 X-Sequence-Number: 31476 On Fri, 12 Sep 2008, Guillaume Cottenceau wrote: > Out of the blue, is it just because when postgresql fsync's after a > write, on a normal system the write has to really happen on disk and > waiting for it to be complete, whereas with BBU cache the fsync is > almost immediate because the write cache actually replaces the "really > on disk" write? That's the main thing, and nothing else you can do will accelerate that. Without a useful write cache (which usually means RAM with a BBU), you'll at best get about 100-200 write transactions per second for any one client, and something like 500/second even with lots of clients (queued up transaction fsyncs do get combined). Those numbers increase to several thousand per second the minute there's a good caching controller in the mix. You might say "but I don't write that heavily, so what?" Even if the write volume is low enough that the disk can keep up, there's still latency. A person who is writing transactions is going to be delayed a few milliseconds after each commit, which drags some types of data loading to a crawl. Also, without a cache in places mixes of fsync'd writes and reads can behave badly, with readers getting stuck behind writers much more often than in the cached situation. The final factor is that additional layers of cache usually help improve physical grouping of blocks into ordered sections to lower seek overhead. The OS is supposed to be doing that for you, but a cache closer to the drives themselves helps smooth things out when the OS dumps a large block of data out for some reason. The classic example in PostgreSQL land, particularly before 8.3, was when a checkpoint happens. -- * Greg Smith gsmith@gregsmith.com http://www.gregsmith.com Baltimore, MD