You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Georg Botorog <ge...@huggle.de> on 2003/01/24 19:11:30 UTC
Connection pool with Apache::DBI and Oracle
Hi,
I would like to know if there is a module that implements a pool of
connections to an Oracle database.
More precisely, I am using Apache::DBI to create and cache the
connection to the DB. As this connection uses a single Oracle session,
it is obvious that it becomes a bottleneck. On the other hand, opening
and closing a connection for each request (i.e., using DBI instead of
Apache::DBI) is not acceptable. Ideally, one would have a pool of DB
sessions (= DB handles) that the Apache threads would use in serving the
requests coming from clients. Was such functionality implemented?
Alternatively, is it possible to convince several Apache servers running
concurrently to cooperate (i.e., load balance) in answering incoming
requests? If yes, how?
Thanks,
George
Re: Connection pool with Apache::DBI and Oracle
Posted by Perrin Harkins <pe...@elem.com>.
Georg Botorog wrote:
> More precisely, I am using Apache::DBI to create and cache the
> connection to the DB. As this connection uses a single Oracle session,
> it is obvious that it becomes a bottleneck.
Apache::DBI uses one connection per process. There is no bottleneck
there. Each process only handles one request at a time so it would have
no use for more than one database connection.
> Ideally, one would have a pool of DB
> sessions (= DB handles) that the Apache threads would use in serving the
> requests coming from clients.
That's only ideal if your code spends a lot of time doing things that
don't involve a database. You shgould be running with a reverse proxy
in front, so that mod_perl processed will not be serving static files.
> Alternatively, is it possible to convince several Apache servers running
> concurrently to cooperate (i.e., load balance) in answering incoming
> requests? If yes, how?
Any load-balancer will do that. There are dozens, both commercial and
open source. See the mod_perl documentation for a list you can start with.
- Perrin