in reply to Sharing a database handle over multiple processes
If the overhead of connect() is really the bottleneck of your system,
then I'd suggest you to follow the apache/mod_perl model:
a child doesn't exit immediately after serving a client, but doing an accept() loop instead
to serve more subsequent requests until a certain maximum number reached.
Your program still
creates a new $dbh for each forked child, but this $dbh is reused several times
within the child before exits, not just once. This way you reduce the number
of connect().
Update: Added a suggestion.
|
---|