in reply to Sharing a database handle over multiple processes

Have you thought about doing some profiling? If you already suspect which block of code is hitting you hardest, some timing checkpoints at the beginning, end, and just before and after the code in question should be able to confirm or deny whether the ->connect is really the problem.

If it is, you might want to think about having a seperate process maintain the $dbh, and have the other processes pass queries off to it. If you perform a fairly small set of queries frequently, you would then be able to cache the prepared queries without much memory penalty.

  • Comment on Re: Sharing a database handle over multiple processes