in reply to Database Connection Pools with Perl
One thing that you might be able to implement assuming the work load isn't too high is a threaded connection pool server in perl, where you create a number of worker threads that each have a connection, and then use something like Thread::Queue to feed data to the threads. However, given the state of threading support in perl 5.8 I would be a little wary of implementing this in a production environment.
I've written a connection pooling module for Apache/Modperl (Apache::Sybase::ConPool) that works pretty well, but it requires Sybase as the back-end database, and it works because Sybase has one of the few database client APIs that is capable of sharing database connections between processes.
You also mention that you'd like to have each connection stay bound to the session for the duration of the session. This will be difficult to do if by "session" you mean more than a single request, given that such requests aren't guaranteed to be picked up by the same server process (at least under the http protocol), and if the process that handles the request changes, then you've obviously got a different connection for the new request...
Michael
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Database Connection Pools with Perl
by Anonymous Monk on Oct 15, 2008 at 21:28 UTC | |
by Anonymous Monk on Oct 16, 2008 at 12:30 UTC |