in reply to Database Connection Pooling
Is there a way to get mod_perl/Apache::DBI to hold (multiple) connections around so that users can exec the same CGI concurrently without having to wait?Apache::DBI does hold the database connections open. One connection for each process. But only under mod_perl, not CGI (don't confuse the two, Apache::Registry lets your CGI scripts run under mod_perl, but then it's not CGI anymore). That's not connection pooling though. Each apache process will hold a database connection open, which means if you allow 1000 simultaneous processes for 1000 people hitting your site at once, there are 1000 connections. (update: connection "pooling" would be something more like having those 1000 processes share a pool of 100 connections, and having each processes grabbing an available connection as needed, then releasing it back to the pool when done).
True connection pooling is possible with Sybase (there's a module on CPAN), but most databases don't support that. Besides, Sybase only allows one active statement handle per connection, so it tends to need more than one connection more than other databases (update: that's been changed, it now transparently opens more connections for more statement handles, but now I'm probably getting OT).
Update: Just noticed that it says Apache 2.x, which I vaguely think I remember supports connection pooling, but I don't know how...
and more thoughts on the subject (a post in the thread in the first link of this google currently proposes that connection pooling is actually rarely needed, and that people only think they need it because MS has it).
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Database Connection Pooling
by mdog (Pilgrim) on Mar 06, 2003 at 23:11 UTC | |
by perrin (Chancellor) on Mar 06, 2003 at 23:21 UTC |