[LA.pm] Problem with FastCGI under Apache 2

Benjamin J. Tilly ben_tilly at operamail.com
Thu Feb 9 20:07:08 PST 2006


"Kevin Scaldeferri" <kevin+lapm at scaldeferri.com> wrote:
> 
> On Feb 9, 2006, at 5:31 PM, Benjamin J. Tilly wrote:
> 
> > I know the problems, but I'll continue using them unless you can 
> > offer another way to break out of a call to DBI's connect_cached 
> > within a fixed (fairly short) time.
> 
> If you have a known badly behaved call, and you have to meet strict 
> SLAs, and you are not willing to tolerate undefined behavior in 
> your application, and you are dedicated to Perl, the only method I 
> know of is to hide the naughty call behind some type of IPC.  The 
> IPC calls all work nicely, so your server process never hangs, even 
> if the helper process gets stuck.

The badly behaved call is DBI->connect_cached at the start of each page request.  We simply cannot afford to make an actual database connect each time - the database would crumble.  Since code is already written using DBI, we either need to write a wrapper around DBI, write our own DBD, rewrite code to not be using DBI, rewrite DBI to make it interruptable or we need to accept undefined behaviour.

Since the kinds of conditions that lead to undefined behaviour are quite rare, and the other solutions bring overhead work and risk to the table, we accept a solution that potentially will cause undefined behaviour.

Cheers,
Ben


More information about the Losangeles-pm mailing list