Received: from magus.postgresql.org ([87.238.57.229]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TTJD4-0005SY-NJ for pgsql-performance@postgresql.org; Tue, 30 Oct 2012 21:18:54 +0000 Received: from mailout-us.gmx.com ([74.208.5.67]) by magus.postgresql.org with smtp (Exim 4.72) (envelope-from ) id 1TTJD1-0006Mz-MP for pgsql-performance@postgresql.org; Tue, 30 Oct 2012 21:18:54 +0000 Received: (qmail 14556 invoked by uid 0); 30 Oct 2012 20:07:45 -0000 Received: from 76.255.19.161 by rms-us016 with HTTP Cc: "Catalin Iacob" ,pgsql-performance@postgresql.org Content-Type: text/plain; charset="utf-8" Date: Tue, 30 Oct 2012 16:07:42 -0400 From: "Kevin Grittner" Message-ID: <20121030200742.306930@gmx.com> MIME-Version: 1.0 Subject: Re: How to keep queries low latency as concurrency increases To: sthomas@optionshouse.com X-Authenticated: #138763884 X-Flags: 0001 X-Mailer: GMX.com Web Mailer x-registered: 0 Content-Transfer-Encoding: 8bit X-GMX-UID: 2VbicIEW3zOlOQ09LnwhkaF+IGRvb8Dq X-Pg-Spam-Score: -1.9 (-) X-Archive-Number: 201210/388 X-Sequence-Number: 48347 Shaun Thomas wrote: > On 10/30/2012 06:55 AM, Kevin Grittner wrote: >> Is there a good transaction-based connection pooler in Python? >> You're better off with a good pool built in to the client >> application than with a good pool running as a separate process >> between the client and the database, IMO. > > Could you explain this a little more? My experience is almost > always the exact opposite, especially in large clusters that may > have dozens of servers all hitting the same database. A > centralized pool has much less duplication and can serve from a > smaller pool than having 12 servers each have 25 connections > reserved in their own private pool or something. > > I mean... a pool is basically a proxy server. I don't have 12 > individual proxy servers for 12 webservers. Sure, if you have multiple web servers and they are not routing their database requests through a common "model" layer, an external pooler would make sense. Most of the time I've dealt either with one web server or multiple servers routing requests at the transaction level to a single JVM which ran the logic of the transaction -- either of which is a good place to have a connection pool. A dozen different JVMs all making JDBC requests does kind of beg for an external layer to concentrate the requests; if it isn't something that's running the transaction layer, a connection pooler there would be good. -Kevin