Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id 693D1B5D80A for ; Thu, 11 Aug 2011 23:25:35 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 89430-04 for ; Fri, 12 Aug 2011 02:25:29 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mail-vw0-f46.google.com (mail-vw0-f46.google.com [209.85.212.46]) by mail.postgresql.org (Postfix) with ESMTP id 62819B5D803 for ; Thu, 11 Aug 2011 23:25:29 -0300 (ADT) Received: by vws1 with SMTP id 1so2158289vws.19 for ; Thu, 11 Aug 2011 19:25:29 -0700 (PDT) Received: by 10.52.89.170 with SMTP id bp10mr310507vdb.493.1313115441152; Thu, 11 Aug 2011 19:17:21 -0700 (PDT) Received: from [10.1.1.8] (124-169-181-228.dyn.iinet.net.au [124.169.181.228]) by mx.google.com with ESMTPS id h20sm1128082vce.29.2011.08.11.19.17.19 (version=SSLv3 cipher=OTHER); Thu, 11 Aug 2011 19:17:20 -0700 (PDT) Message-ID: <4E448D2A.7050000@ringerc.id.au> Date: Fri, 12 Aug 2011 10:17:14 +0800 From: Craig Ringer User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:5.0) Gecko/20110624 Thunderbird/5.0 MIME-Version: 1.0 To: Waldo Nell CC: pgsql-performance@postgresql.org Subject: Re: Recommended optimisations slows down PostgreSQL 8.4 References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.9 tagged_above=-10 required=5 tests=BAYES_00=-1.9 X-Spam-Level: X-Archive-Number: 201108/140 X-Sequence-Number: 44587 On 12/08/2011 8:03 AM, Waldo Nell wrote: > I have PostgreSQL 8.4.8 on Ubuntu Linux x64. Server is a Core i7 950 with 6GB of RAM. 2GB of RAM us used by Java, some small amount by the kernel / services and the rest is available to PostgreSQL. Hard drive is a single 7200 RPM SATA 1TB Caviar Black HDD. No other applications / processes are running when I perform my tests. > > I have an application that performs about 80% reads and 20% writes for a specific billrun. It takes about 60 minutes to complete, and I can have it perform precisely the same queries repeatedly. I have consistently showed that when shared_buffers = 24MB (the default), and wal_buffers = 64kB, the system completes the process in 50 minutes. When I bump shared_buffers to 1500MB, the system slows down and takes 60 minutes to complete the same process. Changing that back to 24MB, but then changing wal_buffers to 16MB has the same impact - performance drops from 50 minutes to about 61 minutes. Changing those two parameters back to the defaults returns the time to 50 minutes. > > fsync = off for these tests - not sure if it is relevant. It certainly is if you're doing any writes as part of your testing. fsync=off is pretty much the same as saying "eat my data whenever you feel like it, I really don't care about it". It's a good option for bulk-loading data into new empty clusters and for systems that rely on replication plus a tolerance for data loss. For anything else it's a really, really bad idea. > Please explain why the system is slower with the recommended values for these two settings? The DB is about 74GB, the largest table has 180 million rows. Without any performance measurements, EXPLAIN ANALYZE results, etc it's very hard to know. You'd need to collect vmstat and iostat output among other things to be able to get any idea. -- Craig Ringer