Received: from localhost (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id 6D5B664FD2F for ; Fri, 5 Dec 2008 18:42:21 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 10957-07 for ; Fri, 5 Dec 2008 18:42:18 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from gwmta.wicourts.gov (gwmta.wicourts.gov [165.219.244.99]) by mail.postgresql.org (Postfix) with ESMTP id D6D9E64FC46 for ; Fri, 5 Dec 2008 18:42:18 -0400 (AST) Received: from Courts-MTA by gwmta.wicourts.gov with Novell_GroupWise; Fri, 05 Dec 2008 16:42:17 -0600 Message-Id: <493959DB.EE98.0025.0@wicourts.gov> X-Mailer: Novell GroupWise Internet Agent 7.0.3 Date: Fri, 05 Dec 2008 16:42:03 -0600 From: "Kevin Grittner" To: "Omar Kilani" , Subject: Re: Context switch storms References: In-Reply-To: Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Content-Disposition: inline X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200812/43 X-Sequence-Number: 32079 >>> "Omar Kilani" wrote: > During CS storm: > count(*) from pg_locks - 1000 - 1400 What do you have for max_connections? With the hardware and load you describe, I would guess you would limit context switching and see best performance with a connection pool that queues requests, keeping the actual connections to the database around 30. You only have so many resources available; having a large number of queries all contending for them is less efficient than having just enough queries active to keep them all busy. I have typically seen the plateau fall off to degradation at or before (CPU count * 2) + (spindle count). -Kevin