Received: from magus.postgresql.org (magus.postgresql.org [87.238.57.229]) by mail.postgresql.org (Postfix) with ESMTP id 2A5C018E38D9 for ; Thu, 12 Jan 2012 19:17:37 -0400 (AST) Received: from [2001:1528:137::f1] (helo=mail.gransy.com) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1RlTto-0000tM-Sj for pgsql-performance@postgresql.org; Thu, 12 Jan 2012 23:17:37 +0000 Received: from antispam.gransy.com (antispam.gransy.com [77.78.104.124]) by mail.gransy.com (Postfix) with ESMTP id EBCD14A2143 for ; Fri, 13 Jan 2012 00:17:22 +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 PujY9rW7UKTA for ; Fri, 13 Jan 2012 00:17:22 +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 C388C4A203C for ; Fri, 13 Jan 2012 00:17:22 +0100 (CET) Message-ID: <4F0F6A02.3000403@fuzzy.cz> Date: Fri, 13 Jan 2012 00:17:22 +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: wal_level=archive gives better performance than minimal - why? 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/39 X-Sequence-Number: 46052 Hi all, 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. On spinning drives this is not noticeable, but on SSDs it's quite clear. See for example this: http://www.fuzzy.cz/tmp/tps-rw-minimal.png http://www.fuzzy.cz/tmp/tps-rw-archive.png That minimal log level gives about 1600 tps all the time, while archive log level gives about the same performance at the start but then it continuously increases up to about 2000 tps. This seems very suspicious, because AFAIK the wal level should not really matter for pgbench and if it does I'd expect exactly the opposite behaviour (i.e. 'archive' performing worse than 'minimal'). This was run on 9.1.2 with two SSDs (Intel 320) and EXT4, but I do see exactly the same behaviour with a single SSD drive. The config files are here (the only difference is the wal_level line at the very end) http://www.fuzzy.cz/tmp/postgresql-minimal.conf http://www.fuzzy.cz/tmp/postgresql-archive.conf pgbench results and logs are here: http://www.fuzzy.cz/tmp/pgbench.minimal.log.gz http://www.fuzzy.cz/tmp/pgbench.archive.log.gz http://www.fuzzy.cz/tmp/results.minimal.log http://www.fuzzy.cz/tmp/results.archive.log I do plan to rerun the whole benchmark, but is there any reasonable explanation or something that might cause such behaviour? kind regards Tomas