perl-modperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Enrico Sorcinelli <e.sorcine...@pisa.iol.it>
Subject Re: Apache::DBI new connects in error_log...
Date Wed, 04 Sep 2002 08:50:11 GMT
On Tue, 3 Sep 2002 10:36:30 -0700 (PDT)
"Anthony E." <apwebdesign@yahoo.com> wrote:

> 
> --- Enrico Sorcinelli <e.sorcinelli@pisa.iol.it>
> wrote:
> > On Tue, 3 Sep 2002 09:05:45 -0700 (PDT)
> > "Anthony E." <apwebdesign@yahoo.com> wrote:
> > 
> > > Hello,
> > > 
> > > I'm getting an awful lot of these error statements in
> > > my error_log file for apache:
> > > 
> > > --
> > > 25935 Apache::DBI             new connect to
> > > 'db:1.2.3.4UserPassAutoCommit=1PrintError=1'
> > > --
> > > 
> > > It looks like they are happening for every database
> > > connection, like the db connections are not staying
> > > persistent. I'm using Apache::DBI in my startup.pl
> > > script under mod_perl. Also the web server has been
> > > crashing every 10 minutes, when the server load gets
> > > up to about 105.
> > > 
> > > any ideas?
> > > 
> > 
> > There are some additional informations that you
> > should supply
> > in order to help you, like
> > 
> > - Are connections per-user?
> How to i tell?

Hi Anthony,

Apache::DBI caches connection based on his args (dbd driver, user, password...)
and attributes. So, if your application uses a different user and/or 
attributes to connect to (a different?) database, every connection will be
cached. Also, every child could have these cached DB's handles.
Apache::DBI works very well for web applications that uses same DB user.

> > - Have you loaded Apache::DBI before DBI or before
> > any module that load it?
> Yes, in startup.pl.
> 

This doesn't assure that you have loaded it before!
For instance if you have in your httpd.conf:

	PerlModule DBI (or any module that uses it)
before
	PerlRequire /path/to/startup.pl

or load DBI (or any module that uses it) before Apache::DBI
in your startup.pl script.

> > - How many childs? (with Apache::DBI 1 child = 1
> > connection)
> How to i tell?

On Unix/Linux you can do this:

   ps -A | grep -c httpd 
 

Bye
	- Enrico


[OT]: The 2.11-13 paragraphs of "mod_perl developers cookbook" are a good 
      recipe! (if you are a mod_perl developer you must to have it! ;-)

Mime
View raw message