Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id 2B0FFB5DBC1 for ; Fri, 5 Aug 2011 14:10:06 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.29]) (amavisd-maia, port 10024) with ESMTP id 11152-03 for ; Fri, 5 Aug 2011 17:09:59 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from smtp.peak6.com (smtp.optionshouse.com [38.98.137.6]) by mail.postgresql.org (Postfix) with ESMTP id 159D1B5D8C5 for ; Fri, 5 Aug 2011 14:09:58 -0300 (ADT) X-AuditID: 0a64cb1e-b7c2bae0000029bf-d1-4e3c23e59d20 Message-ID: <4E3C23E5.1010409@peak6.com> Date: Fri, 5 Aug 2011 12:09:57 -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> <4E3BFC66.4040501@peak6.com> <4E3BBED6020000250003FB6D@gw.wicourts.gov> In-Reply-To: <4E3BBED6020000250003FB6D@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+NgFrrHIsWRmVeSWpSXmKPExsXCxcQrpvtU2cbPoL/H2uLR+eUsFtdnnmO2 aGg7xuzA7HFh3zR2j1cTNrN4zJp1mCmAOaqB0SYxLy+/JLEkVSEltTjZVinA1dHbTCG4JDEv JbEoRcElszg5JzEzN7VISSEzxVbJSEmhICcxOTU3Na/EVimxoCA1L0XJjksBA9gAlWXmKaTm JeenZOal2yp5BvvrWliYWuoaKtnFI0BCG0vG86mPmQp2c1c8Od3O2sA4gbOLkZNDQsBEoufN UlYIW0ziwr31bCA2r4CGRN+i9UwgNouAisTnG+uZQWw2ATWJhbtvMoLYQgKyEvtXnQPr5RcQ ltj3oQmsRlQgQGLBpLeMEHMEJU7OfMICYosIGEjcWLECrJ5ZwFPi1UKI+cICthIX/09lgZg5 iVlizTQjEJtTwFxixdpnUPW2EhfmXGeBsOUltr+dwwxRLydxp+E50M0cQPcrSNz76zSBUWgW ks2zkHTPQtK9gJF5FaN4cVlickamaUFxbkmBoV5BamK2mV5easkmRlAsp5yW28E4faniIUYB DkYlHt5JijZ+QqyJZcWVuYcYJTiYlUR4L7+29hPiTUmsrEotyo8vKs1JLT7EqA0MsonMUtzJ +cA0k1cSb2xgoCTO6zObw09IIB2YBrJTUwtSi2CqmTg4pRoYNYzzebQYc3wmuPIlHHnOeuEv 46Vi5lf5tmYTbIU99j4KL82pDZOyfO0ZGRg47aWc5a+kbbZlfzfts+tpeeMqHdv7KTad3aX5 BKvgxhn5KYLl7+yDfCL5Krb6FcpYsYixznmQfIZr1v4fj65+Xn7j6e6935Z2Pi5oW21a/UqV f+Nk7fV8c+yUWIozEg21mIuKEwGHnA058QIAAA== 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/97 X-Sequence-Number: 44544 On 08/05/2011 09:58 AM, Kevin Grittner wrote: > What I'm saying is that if processes are blocked waiting for disk > they are not going to be using CPU, and there is room for that many > additional processes to be useful, as the CPUs and other drives > would otherwise be sitting idle. Haha. The way you say that made me think back on the scenario with 4 cpus and 1 disk. Naturally that kind of system is IO starved, and will probably sit at IO-wait at 10% or more on any kind of notable activity level. I was like... "Well, so long as everything is waiting anyway, why not just increase it to 100?" Now, typically you want to avoid context switching. Certain caveats need to be made for anything with less than two, or even four cpus because of various system and Postgres monitoring/maintenance threads. My own benchmarks illustrate (to me, anyway) that generally, performance peaks when PG threads equal CPU threads *however they're supplied*. Never minding fudge factor for idling connections waiting on IO, which you said yourself can be problematic the more of them there are. :) I'd say just put it at 2x, maybe 3x, and call it good. Realistically you won't really notice further tweaking, and a really active system would converge to cpu count through a pooler and be cached to the gills anyway. -- 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