mdog has asked for the wisdom of the Perl Monks concerning the following question:

Brethern --

This is not specifically a perl question (please forgive me) but I know a lot of folks out there are in the web development field and figure some have probably already been down this path.

That said, what do folks do for connection pooling?

I'm just starting to play with SQL Relay, which looks very promising but I was wondering if there were any other products/strategies that folks us to address this issue.

Thanks in advance,
mdog

Replies are listed 'Best First'.
Re: Database Connection Pooling: Take 2
by perrin (Chancellor) on Mar 11, 2003 at 01:11 UTC
    Please read this. It's a good answer to a FAQ on the mod_perl list.
      Very interesting. I always accepted it as Conventional Wisdom that connection pooling was the 'right' thing to do, because making connections is 'expensive'. I have to confess to some cargo cult belief here because I've always just accepted this without understanding it. Is it your opinion then that the overhead of connection pooling is as expensive or more expensive than making new connections?

        Making new connections is expensive, but connection pooling is not the only alternative. The Apache::DBI module keeps connections open so that you don't need to re-connect. It is not "pooling" because the connections are not shared -- each process opens a connection and keeps it open.

        This will change with the thread support in mod_perl 2 and a future release of DBI which will include direct support for connection pooling. In the meantime, what Apache::DBI does is fine for most sites.

        The reason I've used connection pooling is when the total number of clients is potentially very large (5-10 thousand or more). Maintaining a very large number of connections on the database server generates quite a bit of overhead. If these connections aren't active all the time then pooling them can make sense.

        Michael

Re: Database Connection Pooling: Take 2
by adrianh (Chancellor) on Mar 11, 2003 at 05:34 UTC
Re: Database Connection Pooling: Take 2
by mdog (Pilgrim) on Mar 11, 2003 at 00:42 UTC
    ...folks us to address this issue...

    Sorry, I meant "use".

A reply falls below the community's threshold of quality. You may see it by logging in.