Re: Connection pooling - Mailing list pgsql-general

From Gilles DAROLD
Subject Re: Connection pooling
Date
Msg-id 3A7050FA.C860FF9D@darold.net
Whole thread Raw
In response to Connection pooling  (Guillaume Lémery <glemery@comclick.com>)
Responses Re: Connection pooling  (Dan Lyke <danlyke@flutterby.com>)
Re: Connection pooling  ("Brett W. McCoy" <bmccoy@chapelperilous.net>)
Re: Connection pooling  (Frank Joerdens <frank@joerdens.de>)
List pgsql-general
Hi,

With Apache/mod_perl it is very simple to enable DB connection
persistance.

in your perl script :

use vars qw($dbh);

$dbh ||= DBI::connect($datasrc, $dbuser, $dbpwd);

That create a persistance connection to your DB and you do not have to
care
about a pool of connection. Double pipe do all for you :-)

But if you really want a pool just create an array of this kind of global
var at startup
and switch to any indices as you want.

Don't forget to use Apache::DBI on top of DBI.pm. See mod_perl
documentation
for a complete setting.

Hope this help.

Regards,


Guillaume Lémery wrote:

> Hi,
>
> my database has to handle quickly several number of queries per second
> from numerous clients.
> Because of the waste of time for connection/disconnection, Im' looking
> for a connection pooling tool.
>
> Where can I find a such tool or can somebody send me one ?
>
> Many thanks in advance,
>
> Guillaume.


pgsql-general by date:

Previous
From: "Dmitry Chernikov"
Date:
Subject: Problem with PL/pgSQL in 7.03
Next
From: Peter T Mount
Date:
Subject: Re: Connection pooling