Received: from magus.postgresql.org (magus.postgresql.org [87.238.57.229]) by mail.postgresql.org (Postfix) with ESMTP id ADF1312163EC for ; Mon, 16 Jan 2012 20:30:05 -0400 (AST) Received: from [2001:1528:137::f1] (helo=mail.gransy.com) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1Rmww8-00011b-Ah for pgsql-performance@postgresql.org; Tue, 17 Jan 2012 00:30:04 +0000 Received: from antispam.gransy.com (antispam.gransy.com [77.78.104.124]) by mail.gransy.com (Postfix) with ESMTP id A28014A209D for ; Tue, 17 Jan 2012 01:29:51 +0100 (CET) Received: from mail.gransy.com ([82.208.29.194]) by antispam.gransy.com (antispam.gransy.com [77.78.104.124]) (amavisd-new, port 10024) with ESMTP id cGfMwX6iU5Pu for ; Tue, 17 Jan 2012 01:29:51 +0100 (CET) Received: from [192.168.1.237] (ip-78-45-133-255.net.upcbroadband.cz [78.45.133.255]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.gransy.com (Postfix) with ESMTPSA id 7EB284A2010 for ; Tue, 17 Jan 2012 01:29:51 +0100 (CET) Message-ID: <4F14C101.60607@fuzzy.cz> Date: Tue, 17 Jan 2012 01:29:53 +0100 From: Tomas Vondra User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:9.0) Gecko/20111222 Thunderbird/9.0.1 MIME-Version: 1.0 To: pgsql-performance@postgresql.org Subject: Re: wal_level=archive gives better performance than minimal - why? References: <4F0F6A02.3000403@fuzzy.cz> <4F14A649.5060501@2ndQuadrant.com> In-Reply-To: <4F14A649.5060501@2ndQuadrant.com> Content-Type: text/plain; charset=ISO-8859-2 Content-Transfer-Encoding: 7bit X-Host-Lookup-Failed: Reverse DNS lookup failed for 2001:1528:137::f1 (failed) X-Pg-Spam-Score: -1.1 (-) X-Archive-Number: 201201/49 X-Sequence-Number: 46062 On 16.1.2012 23:35, Greg Smith wrote: > On 01/12/2012 06:17 PM, Tomas Vondra wrote: >> I've run a series fo pgbench benchmarks with the aim to see the effect >> of moving the WAL logs to a separate drive, and one thing that really >> surprised me is that the archive log level seems to give much better >> performance than minimal log level. > > How repeatable is this? If you always run minimal first and then > archive, that might be the actual cause of the difference. In this > situation I would normally run this 12 times, with this sort of pattern: > > minimal > minimal > minimal > archive > archive > archive > minimal > minimal > minimal > archive > archive > archive > > To make sure the difference wasn't some variation on "gets slower after > each run". pgbench suffers a lot from problems in that class. AFAIK it's well repeatable - the primary goal of the benchmark was to see the benefir of moving the WAL to a separate device (with various WAL levels and device types - SSD and HDD). I plan to rerun the whole thing this week with a bit more details logged to rule out basic configuration mistakes etc. Each run is completely separate (rebuilt from scratch) and takes about 1 hour to complete. Each pgbench run consists of these steps 1) rebuild the data from scratch 2) 10-minute warmup (read-only run) 3) 20-minute read-only run 4) checkpoint 5) 20-minute read-write run and the results are very stable. Tomas