Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WERad-0003YY-Ud for pgsql-bugs@arkaria.postgresql.org; Fri, 14 Feb 2014 22:50:36 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1WERad-0007Ue-AW for pgsql-bugs@arkaria.postgresql.org; Fri, 14 Feb 2014 22:50:35 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WERab-0007UV-CC for pgsql-bugs@postgresql.org; Fri, 14 Feb 2014 22:50:33 +0000 Received: from moutng.kundenserver.de ([212.227.126.171]) by magus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WERaY-0003mi-Fw for pgsql-bugs@postgresql.org; Fri, 14 Feb 2014 22:50:33 +0000 Received: from anarazel.de (p54AF4590.dip0.t-ipconnect.de [84.175.69.144]) by mrelayeu.kundenserver.de (node=mreue105) with ESMTP (Nemesis) id 0MCZBy-1W58BF3JnG-009RR2; Fri, 14 Feb 2014 23:50:27 +0100 Received: by anarazel.de (Postfix, from userid 1000) id D75C91002C0; Fri, 14 Feb 2014 23:50:26 +0100 (CET) Date: Fri, 14 Feb 2014 23:50:26 +0100 From: Andres Freund To: Clemens Eisserer Cc: pgsql-bugs@postgresql.org Subject: Re: BUG #9161: wal_writer_delay is limited to 10s Message-ID: <20140214225026.GB11943@awork2.anarazel.de> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Provags-ID: V02:K0:eHArXsXxRFuZULbm2O07PzCcGkQyl2FkbQkeYurQJ5D xzzDtQWVurZnOS8cvuJRE6JArga/WXSbX894QaaeTxx+8HDik2 ARvBL2mdQNQDHYiPkbXs/ZgI6dMy1Zi0ppCl2XTlnp+A9Wsbtp RIn16llA9CjBWKzxu7e+7cGEoaE7uh9pbqc2+R/SF5tCE5iVAh UdjlzPxJdPK6KMTH+1TeV6Tq6hRdb9klHIgWr6lNDBW7b1QHLf 1jFlDbBVRDEq2ObBbmRfNJwgAmUESKBE7HoCntCTznSBwPLVxY mKbeAWQUJnzIVmcDu7mbHZy1/Q/4V2n93d8QLdYPBv3fee6o8P UqWjTKJceiqUzIXvSa4RCsul+EpgA6tTYyelQTeyx X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org On 2014-02-14 23:03:44 +0100, Clemens Eisserer wrote: > Hi Tom, > > Thanks for taking a look at my bug report. > > > But if you're generating WAL, it's going to get written anyway > > whenever a transaction commits. > > As far as I understood, this is only the case with > synchronous_commit=on, which is the reason why I turned synchrous > commit off. The WAL writer will be woken up anyway if a transaction commits (c.f. XLogSetAsyncXactLSN()). > > You could forestall that with fsync=off, > > perhaps, but if you do that then the WAL writer won't fsync either, so > > it shouldn't matter how often it wakes up. Checkpoints will force WAL > > output more often than once per hour by default, too. So I'm wondering > > exactly what combination of other settings you envision using this with, > > and what's the workload of the database server. > > Because the system should be crash-resistent, my goal would be to have > postgresql issue fsyncs only every few minutes instead of every 10s, > by running the wal writer only every now and then (I know there is > only very little data in the WAL anyway). > > For now I have a single insert transaction every 10s with > synchronous_commit=off, however because the wal writer weaks up every > 10s data are immediatly written to the SD card, dramatically reducing > its lifespan. The WAL writer shouldn't write anything if there's nothing to write. Maybe you have checkpoint_timeout set to something low and it's performing checkpoints regularly? You might also rethink the quality of the media you're using... Greetings, Andres Freund -- Andres Freund http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Training & Services -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs