[rt-users] Trying again

darren chamberlain darren at boston.com
Tue Mar 5 16:00:59 EST 2002


Quoting Russ Johnson <russj at dimstar.net> [Mar 05, 2002 14:26]:
> At 01:09 PM 3/5/2002 -0500, you wrote:
> >Quoting Russ Johnson <russj at dimstar.net> [Mar 05, 2002 12:52]:
> >> Well, it evidently doesn't break it, as I have a fully
> >> functional (at least, everything is working..) RT 2.0.7
> >> installed with the following in my httpd.conf:
> >>
> >> <VirtualHost 10.69.1.11>
> >> ServerName helpfish.qa.tripwire.com
> >> ServerAlias helpfish
> >> DocumentRoot /local/rt2/WebRT/html
> >> PerlModule Bundle::DBI
> >             ^^^^^^^^^^^
> >This doesn't do anything; it should be Apache::DBI.  Bundle::DBI
> >is an empty module (i.e., devoid of Perl).
> 
> That was my point. Having that misconfigured on my server does
> not seem to be having any ill effects. Since I'm in the process
> of replacing that server, and the current one is presently
> working, I'm leaving it alone.

Ah, I see.

The thing is, Apache::DBI is *not* necessary; it never is.  All
it does is redefine a few DBI class methods, so that connections
are persistant until a child exits (that's an over-simplification,
but essentially true).  It makes database access faster, because
the connections to the database are already open, but removing it
will not cause the database or the app to stop working (unless
you are hitting a performance ceiling).  The way Apache::DBI and
DBI are set up, if you load DBI before Apache::DBI in your
httpd.conf, Apache::DBI does not do anything (DBI checks for the
existence of Apache::DBI and modifies itself accordingly, not the
other way around).

In fact, Apache::DBI can *cause* problems, if your database can't
handle the number of persistant connections that you are trying
to maintain.  For example, a mod_perl server with a lot of
independent modules, each with their own db to connect to (all
running on the same database instance) will each have their own
persistent DBI connection under Apache::DBI.  With (for example)
10 different modules, and 16 Apache children, we now have 160
persistent connections to the database (keep in mind that
Apache::DBI caches connections based on the variables used to
connect initially; any change in the DBD string means a new
persistent connection).  If you are running that app on a web
farm, say three machines, we've just jumped to 480 persistent
connections to your database machine.  If the box running your db
is beefy enough, and well configured, this may not phase you; but
then again, if your boxen are beefy enough, you may not need
Apache::DBI.

All that being said, if you are running a single app on a single
httpd, accessing a single db server, then Apache::DBI can make a
huge difference, especially on databases like Oracle on which
connecting is expensive.

(darren)

-- 
Buying books would be a good thing if one could also buy the time to
read them in: but as a rule the purchase of books is mistaken for the
appropriation of their contents.
    -- Arthur Schopenhauer




More information about the rt-users mailing list