X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id F18235283C for ; Tue, 16 Aug 2005 19:50:24 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 32212-01 for ; Tue, 16 Aug 2005 22:50:21 +0000 (GMT) Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by svr1.postgresql.org (Postfix) with ESMTP id 5716C529BC for ; Tue, 16 Aug 2005 19:50:19 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.13.1/8.13.1) with ESMTP id j7GMnxXp007517; Tue, 16 Aug 2005 18:49:59 -0400 (EDT) To: John A Meinel Cc: Alvaro Herrera , Josh Berkus , pgsql-performance@postgresql.org, "Jeffrey W. Baker" , Steve Poe , paul@oxton.com Subject: Re: PG8 Tuning In-reply-to: <43021567.1000101@arbash-meinel.com> References: <1536.217.45.209.171.1123763001.squirrel@www.gradwell.com> <1123836428.19976.26.camel@amd64-laptop-spoe> <1123779524.6664.1.camel@toonses.gghcwest.com> <200508160912.32263.josh@agliodbs.com> <20050816162531.GB32695@alvh.no-ip.org> <43021567.1000101@arbash-meinel.com> Comments: In-reply-to John A Meinel message dated "Tue, 16 Aug 2005 11:33:43 -0500" Date: Tue, 16 Aug 2005 18:49:59 -0400 Message-ID: <7516.1124232599@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.006 required=5 tests=[AWL=0.006] X-Spam-Level: X-Archive-Number: 200508/190 X-Sequence-Number: 13937 John A Meinel writes: > Alvaro Herrera wrote: >> I've been asked this a couple of times and I don't know the answer: what >> happens if you give XLog a single drive (unmirrored single spindle), and >> that drive dies? So the question really is, should you be giving two >> disks to XLog? > I can propose a simple test. Create a test database. Run postgres, > insert a bunch of stuff. Stop postgres. Delete everything in the pg_xlog > directory. Start postgres again, what does it do? That test would really be completely unrelated to the problem. If you are able to shut down the database cleanly, then you do not need pg_xlog anymore --- everything is on disk in the data area. You might have to use pg_resetxlog to get going again, but you won't lose anything by doing so. The question of importance is: if the xlog drive dies while the database is running, are you going to be able to get the postmaster to shut down cleanly? My suspicion is "no" --- if the kernel is reporting write failures on WAL, that's going to prevent writes to the data drives (good ol' WAL-before-data rule). You could imagine failure modes where the drive is toast but isn't actually reporting any errors ... but one hopes that's not a common scenario. In a scenario like this, it might be interesting to have a shutdown mode that deliberately ignores writing to WAL and just does its best to get all the dirty pages down onto the data drives. In the meantime ... use a mirrored drive for WAL. regards, tom lane