in reply to Sharing database handle
Instead of sharing a connection you probably want to do connection pooling. You could have your app open up a bunch of connections at application startup then as a child process is spawned it gets a connection from the pool. When it is finished it returns the connection to the pool. If there aren't any available connections then your process can block until one becomes available. Since opening and closing database connections is very costly this should greatly help your performance. Also, by pre-allocating the connections, you always have control over how many connections are out there.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Re: Sharing database handle
by perrin (Chancellor) on Apr 18, 2002 at 18:40 UTC | |
Re: Re: Sharing database handle
by belg4mit (Prior) on Apr 24, 2002 at 02:24 UTC |
In Section
Seekers of Perl Wisdom