Received: from localhost (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id 9575D6328DD for ; Tue, 10 Nov 2009 20:32:10 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.208.211]) (amavisd-maia, port 10024) with ESMTP id 20137-05 for ; Wed, 11 Nov 2009 00:31:43 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from moutng.kundenserver.de (moutng.kundenserver.de [212.227.17.10]) by mail.postgresql.org (Postfix) with ESMTP id 3ECC96328B3 for ; Tue, 10 Nov 2009 20:31:58 -0400 (AST) Received: from [192.168.1.3] (pool-96-244-14-10.bltmmd.fios.verizon.net [96.244.14.10]) by mrelayeu.kundenserver.de (node=mrbap1) with ESMTP (Nemesis) id 0McxrW-1MpwHB1K8A-00HcBW; Wed, 11 Nov 2009 01:31:56 +0100 Message-ID: <4AFA05F4.5050203@2ndquadrant.com> Date: Tue, 10 Nov 2009 19:31:48 -0500 From: Greg Smith User-Agent: Thunderbird 2.0.0.23 (X11/20090817) MIME-Version: 1.0 To: pgsql-performance@postgresql.org Subject: Database tuning at Duke Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Provags-ID: V01U2FsdGVkX184Nc2SsJv4FkSXFp3wcAclDhZ1Sml+/Nok5pT UDGBVZV65PzhgtBy6Ic/q2MZy+ksp3xK9OqknULtGzRe26RtnX 2C/QigMZ87nfXuQ8IEpVbttMo5kQY/y X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-2.413 tagged_above=-10 required=5 tests=AWL=0.186, BAYES_00=-2.599 X-Spam-Level: X-Archive-Number: 200911/116 X-Sequence-Number: 36284 There's two papers published recently at Duke that I just found, both of which use PostgreSQL as part of their research: Automated SQL Tuning through Trial and (Sometimes) Error: http://www.cs.duke.edu/~shivnath/papers/dbtest09z.pdf Tuning Database Configuration Parameters with iTuned: http://www.cs.duke.edu/~shivnath/papers/ituned.pdf The second has a number of interesting graphs showing how changing two postgresql.conf parameters at a time interact with one another. There's also a set of graphs comparing the default postgresql.conf performance with what you get using the guidelines suggested by an earlier version of http://wiki.postgresql.org/wiki/Tuning_Your_PostgreSQL_Server and some of the documents on that section of the wiki. Check out page 10, the "M" column represents that manual tuning against the leftmost "D" which is the stock postgresql.conf settings. I was a bit confused at first about the environment because of how the paper is organized, here's the bit that clarifies it: "The database size with indexes is around 4GB. The physical memory (RAM) given to the database is 1GB to create a realistic scenario where the database is 4x the amount of RAM." That RAM limit was constrained with a Solaris zone. They multiplied the 1GB x 20% to get a standard "rule-based" setting of shared_buffers of 200MB (based on the guidelines on the wiki at the time--that suggestion is now 25%). Note that much of the improvement shown in their better tuned versions there results from increases to shared_buffers (peaking at 40%=400MB) and work_mem beyond the recommendations given in the tuning guide. That is unsurprising as those are aimed more to be reasonable starting values rather than suggested as truly optimal. work_mem is particular is dangerous to suggest raising really high without knowing what types of queries are going to be run. There's been plenty of commentary on this list suggesting optimal shared_buffers is closer to 50% of RAM than 25% for some workloads, so their results showing peak performance at 40% fit right in the middle of community lore. I'm now in contact with the authors and asked them to let me know whey publish the entire post-optimization postgresql.conf, I'll let the list know when that's available. I'm quite curious to see what the final settings that gave the best results looked like. -- Greg Smith greg@2ndQuadrant.com Baltimore, MD