You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Buddy Lee Haystack <ha...@surfree.com> on 2000/03/03 16:04:38 UTC
Re: mod_perl/apache::DBI Database Persistent Connectionquestion
Eight!
I think you got it right.
Nice to know I not doing anything wrong. :-)
Thank you very much for the quickest response I have ever received.
Unbelievable!
Bill Moseley wrote:
> How many Apache children were running?
>
> At 09:47 AM 03/03/00 -0500, Buddy Lee Haystack wrote:
> >I have question concerning the number of persistent database connections
> >per database handle maintained by the "mod_perl/DBI/Apache::DBI"
> >combination.
> >
> >Prior to installing the Apache::DBI module, I rewrote my perl cgi
> >scripts so that they would work with my newly installed mod_perl module.
> >All of my scripts worked fine after modification. I made sure that all
> >database handles were disconnected after use in each script, and checked
> >my PostgreSQL postmaster to verify that only a single instance was
> >running after I ran each cgi script many, many times.
> >
> >After installing the Apache::DBI module, it maintained persistent
> >database connections to my PostgreSQL database, but it seems to have
> >maintained 8 persistent connections to one database which I was
> >accessing from one cgi script.
> >
> >The cgi script contained one database handle at the start, three
> >statement handles each of which was prepared, executed & finished within
> >its own subroutine using the single database handle declared at the
> >beginning, and a final database disconnect statement at the scripts end.
> >All the variable assignments were local to the subroutines ["my"] with
> >the exception of the database handle & subroutine names which were
> >declared ["my"] at the start of the cgi script. I works really, really,
> >really, fast!
> >
> >How many persistent database handles does the Apache::DBI make? I
> >thought that it would make one persistent connection per database
> >handle, but in my case it made 8 persistent connections for one database
> >handle.
> >
> >What concerned me was the manner by which the persistent count
> >increased. Upon the initial test that I ran on the PC that contained the
> >web server & database, I had 4 persistent database connections. After
> >firing up another workstation, accessing the cgi scripts left me with 8
> >persistent database connections. I was really nervous at this point -4
> >persistent connections per client? So, I crossed my fingers & fired up a
> >third client. Still had 8 persistent database connections. I was
> >somewhat relieved.
> >
> >Can anyone shed some light on this? Is this the way it is supposed to
> >work? Am I doing something wrong, or should I just leave it to the
> >Apache::DBI module to manage the connections?
> >
> >Thanks!
> >
> >
>
> Bill Moseley
> mailto:moseley@hank.org