Re: Ima::DBI and connections at Apache startup

[prev] [thread] [next] [Date index for 2004/10/05]

From: Brad Bowman
Subject: Re: Ima::DBI and connections at Apache startup
Date: 01:15 on 05 Oct 2004
Thanks for telling me your approach Perrin.
Is there anything tricky to your replacement db_Main, or
does it just call DBI->connect?

I'm glad it's not just me that's had trouble here.

> > Another approach is to let DBI handle it and just call connect_cached.
> > This'd be slower, I guess.
> 
> That was the main issue according to Schwern when I complained about the
> closure thing before.
> 
> > But at least then Ima::DBI isn't duplicating
> > Apache::DBI and DBI's functions.
> 
> Agreed, this would be highly desirable.  Maybe you could do some
> benchmarking on how much of a difference the closure makes?

There is a significant difference, especially since Class::DBI
calls db_Main everywhere expecting a the same handle.

Benchmark: timing 50000 iterations of DBI_cc, ImaDBI...
    DBI_cc: 14 wallclock secs (12.16 usr +  0.43 sys = 12.59 CPU) @ 3971.41/s (n=50000)
    ImaDBI:  2 wallclock secs ( 0.81 usr +  0.33 sys =  1.14 CPU) @ 43859.65/s (n=50000)
          Rate DBI_cc ImaDBI
DBI_cc  3971/s     --   -91%
ImaDBI 43860/s  1004%     --

However, Ima::DBI's caching can cause errors under mod_perl
so something has to be done.  Perhaps another form of caching
which is easier to tweak?


Another BIG hitch with my plan is that Class::DBI needs to
consistently get the same handle from db_Main for transactions
to work.  At least that's what I think is happening now.

A replacement for db_Main could probably handle this.
I'm still working on it.


Brad

        -- 
          It is not good to settle into a set of opinions. It is a mistake to
  put forth effort and obtain some understanding and then stop at that.
    -- Hagakure http://bereft.net/hagakure/

(message missing)

Ima::DBI and connections at Apache startup
Brad Bowman 08:03 on 04 Oct 2004

Re: Ima::DBI and connections at Apache startup
Perrin Harkins 17:15 on 04 Oct 2004

Re: Ima::DBI and connections at Apache startup
Brad Bowman 01:15 on 05 Oct 2004

Re: Ima::DBI and connections at Apache startup
Brad Bowman 04:47 on 05 Oct 2004

Re: Ima::DBI and connections at Apache startup
Perrin Harkins 14:27 on 05 Oct 2004

Problem with has_many and searching
John Day 16:06 on 05 Oct 2004

Re: Ima::DBI and connections at Apache startup
Perrin Harkins 14:26 on 05 Oct 2004

Re: Ima::DBI and connections at Apache startup
Brad Bowman 05:01 on 06 Oct 2004

Re: Ima::DBI and connections at Apache startup
Perrin Harkins 15:23 on 06 Oct 2004

Re: Problem with has_many and searching
Perrin Harkins 16:21 on 05 Oct 2004

Re: Problem with has_many and searching
John Day 17:26 on 05 Oct 2004

Re: Ima::DBI and connections at Apache startup
Tony Bowden 17:31 on 06 Oct 2004

Generated at 11:34 on 01 Dec 2004 by mariachi v0.52