List:MySQL and Perl« Previous MessageNext Message »
From:Jochen Wiedmann Date:June 10 2001 2:04pm
Subject:Re: Maintaining State/Cached Connections
View as plain text  
Hi, Stas,

Quoting Stas Bekman <stas@stripped>:

> Jocheh, your example could be correct if the parent process is the one
> that opens the connections. However this is not true:
> Apache::DBI->connect_on_init only registers a hook to DBI::connect()
> for PerlChildInitProcess phase. Which means that every time Apache
> spawns a new process, a *new* connection gets opened by this new child
> process. This connection is unique to each process, hence there is no
> problem.
> 
> This section of the guide is correct to my understanding and
> experience.

If that's the case, you are right, of course. However, I don't
see the performance gain in that case? IMO this means, that even
those child processes will open a database connection that never
use it at all?

As Stas said: Anything done in the parent process should be
avoided. This implies the creation of statement handles, if
you think of such things.


Yours,

Jochen
Thread
DBD::mysql ProblemsJason Allocco6 Jun
  • Re: DBD::mysql ProblemsJeremy Zawodny6 Jun
  • Re: DBD::mysql Problemsed phillips6 Jun
  • Maintaining State/Cached ConnectionsDodger6 Jun
    • Re: Maintaining State/Cached ConnectionsTodd Finney7 Jun
    • Re: Maintaining State/Cached ConnectionsDave Rolsky8 Jun
      • Re: Maintaining State/Cached ConnectionsJochen Wiedmann8 Jun
      • Re: Maintaining State/Cached ConnectionsTodd Finney8 Jun
    • Re: Maintaining State/Cached ConnectionsJochen Wiedmann8 Jun
      • Re: Maintaining State/Cached ConnectionsTodd Finney8 Jun
        • Re: Maintaining State/Cached ConnectionsJochen Wiedmann9 Jun
          • Re: Maintaining State/Cached ConnectionsStas Bekman9 Jun
            • Re: Maintaining State/Cached ConnectionsJochen Wiedmann10 Jun
              • Re: Maintaining State/Cached ConnectionsStas Bekman10 Jun