Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id 71B92B5DC3D for ; Fri, 5 Aug 2011 11:21:34 -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 07243-10 for ; Fri, 5 Aug 2011 14:21:28 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from smtp2.peak6.com (smtp2.peak6.com [38.98.137.9]) by mail.postgresql.org (Postfix) with ESMTP id F15A9B5DC3B for ; Fri, 5 Aug 2011 11:21:27 -0300 (ADT) X-AuditID: 0a02cb1e-b7cbdae000007cad-5f-4e3bfc67b9e7 Message-ID: <4E3BFC66.4040501@peak6.com> Date: Fri, 5 Aug 2011 09:21:26 -0500 From: Shaun Thomas Reply-To: Organization: Peak6 User-Agent: Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20110624 Thunderbird/5.0 MIME-Version: 1.0 To: Kevin Grittner CC: , Claire Chang Subject: Re: Postgres 8.4 memory related parameters References: <1312489633.71838.YahooMailClassic@web31912.mail.mud.yahoo.com> <4E3ABCFB020000250003FAF4@gw.wicourts.gov> <4E3B08D3.606@peak6.com> <4E3ACA8C020000250003FB05@gw.wicourts.gov> <4E3B13E8.7050002@peak6.com> <4E3ACEB4020000250003FB10@gw.wicourts.gov> <4E3B15EB.1020603@peak6.com> <4E3BB14A020000250003FB41@gw.wicourts.gov> In-Reply-To: <4E3BB14A020000250003FB41@gw.wicourts.gov> Content-Type: text/plain; charset="ISO-8859-1"; format=flowed content-transfer-encoding: 7bit X-Originating-IP: [10.10.221.50] X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrPIsWRmVeSWpSXmKPExsXCxcQrppv+x9rPYH+fgsWj88tZLK7PPMds 0dB2jNmB2ePCvmnsHq8mbGbxmDXrMFMAc1QDo01iXl5+SWJJqkJKanGyrVKAq6O3mUJwSWJe SmJRioJLZnFyTmJmbmqRkkJmiq2SkZJCQU5icmpual6JrVJiQUFqXoqSHZcCBrABKsvMU0jN S85PycxLt1XyDPbXtbAwtdQ1VLKLR4CENpaMnRd/shb84Km4dX4CSwNjH1cXIyeHhICJxJrW eWwQtpjEhXvrwWxeAQ2JA6++M4PYLAIqEjtX9DKC2GwCahILd98Es4UEZCX2rzrHCmLzCwhL 7PvQBFYvKhAgsWDSW0aIOYISJ2c+YQGxRQQMJG6sWAFWzyzgKfFq4XomEFtYwFbi4v+pQDVc QDNPMUk0P2gEa+AUMJc4+e8nVIOtxIU511kgbHmJ7W/nMEMcISdxp+E50NEcQA8oSNz76zSB UWgWktWzkHTPQtK9gJF5FaN4cVlickamWUFxbkmBoV5BamK2mV5easkmRnA0n5bbwbjiguIh RgEORiUeXqELVn5CrIllxZW5hxglOJiVRHgvv7b2E+JNSaysSi3Kjy8qzUktPsSoDQyzicxS 3Mn5wESTVxJvbGCgJM7rM5vDT0ggHZgIslNTC1KLYKqZODilGhg5TotX6s00sjK2TfrOF3iI Z8Jx16qYw5PSFeIzm3/8Y7B1XbTunNUR38svzl8ImGn7J/XB2i75NyerNeU2W027ae2jdfli 3P6eD/oVe257lClMEVigXBNXme72+fqV8pTjB7/eX2vLzPDBfGvty8V1H/vT9Novn+qW633A H3CfXyxBWNRCZLESS3FGoqEWc1FxIgA4E2Nq8gIAAA== X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-2.704 tagged_above=-10 required=5 tests=BAYES_00=-1.9, RP_MATCHES_RCVD=-0.804 X-Spam-Level: X-Archive-Number: 201108/93 X-Sequence-Number: 44540 On 08/05/2011 09:00 AM, Kevin Grittner wrote: > optimal pool size = ((2 * actual core count) + effective spindle > count) How does that work? If your database fits in memory, your optimal TPS is only constrained by CPU. Any fetches from disk reduce your throughput from IO Waits. How do you account for SSDs/PCIe cards which act as an effective spindle multiplier? I've seen Java apps that, through the use of several systems using Java Hibernate pool sharing, are not compatible with connection poolers such as PGBouncer. As such, they had 50x CPU count and still managed 12,000TPS because everything in use was cached. Throw a disk seek or two in there, and it drops down to 2000 or less. Throw in a PCIe card, and pure streams of "disk" reads remain at 12,000TPS. It just seems a little counter-intuitive. I totally agree that it's not optimal to have connections higher than effective threads, but *adding* spindles? I'd be more inclined to believe this: optimal pool size = 3*cores - cores/spindles Then, as your spindles increase, you're subtracting less and less until you reach optimal 3x. One disk, but on a 4-cpu system? 12 - 4 = 8. So you'd have the classic 2x cores. On a RAID 1+0 with 4 disk pairs (still 4 cpu)? 12 - 1 = 11. On a giant SAN with couple dozen disks or a PCIe card that tests an order of magnitude faster than a 6-disk RAID? 12 - [small fraction] = 12 It still fits your 3x rule, but seems to actually account for the fact disks suck. :p -- Shaun Thomas OptionsHouse | 141 W. Jackson Blvd. | Suite 800 | Chicago IL, 60604 312-676-8870 sthomas@peak6.com ______________________________________________ See http://www.peak6.com/email_disclaimer.php for terms and conditions related to this email