List:General Discussion« Previous MessageNext Message »
From:Daniel Koch Date:June 23 1999 6:14pm
Subject:Re: Persistent connections to db?
View as plain text  
Tom Cunningham wrote:

> On Wed, 23 Jun 1999, Paul DuBois wrote:
>
> > At 12:48 PM -0400 6/23/1999, Tom Cunningham wrote:
> > >I'm running Red Hat 6.0, and I'm unsure of whether I'm using persistent
> > >connections to my mysql db. I've installed the MySQL binaries on my
> > >system. How would I find out whether I'm using persistent connections or
> > >not, and if I'm not, how would I go about setting up persistent
> > >connections?
> >
> > Persistent connections are a PHP thing.  Are you using PHP?
>
> Nope. Perl and mod_perl. Someone suggested my problems might be persistent
> connections, so I wanted to explore that problem, but I'm not so sure
> about that. I'm using bind_param and bind_col everywhere I can in my CGI
> scripts.
>
> I'm configuring a new Red Hat 6.0 machine with SCSI drives that I've
> determined through benchmarks to be 2 times as fast as my current Red Hat
> 5.2 server. I've run the mysql benchmarks on both machines, and the new
> machines has come out roughly twice as fast. I've ran Apache benchmarks on
> the new and old machines using static html, and the new machine seems to
> be twice as fast at that. Then new machine also is about twice as fast at
> doing non-db driven cgi-bin perl, and non-db driven mod_perl.
>
> When I try to benchmark my cgi though (exact same script on both machines,
> I get the strange results :
>
> >From Apache Benchmark :
>                         Old Machine             New Machine
> Requests per second :   1.47                    .84
> Processing Min          1980                    1940
> Processing Avg          2665                    4685
> Processing Max          4273                    6869
>
> I ftp'ed the tables straight from the old machine - which is RedHat 5.2
> and the new one is RedHat 6.0. Would glibc factor into this at all? Would
> I be better off creating the tables locally on the new machine?
>
> Every benchmark I've ran says that the new machine is faster (which it
> is), except the CGI I really need to be faster. The wide variance in
> processing time in the Apache Benchmarks for the cgi on the new machine
> really make me wonder what's going on, and whether there's some library
> issue here.
>

Tom:

Install Apache::DBI from CPAN, e.g.:

# perl -MCPAN -e shell
cpan> install Apache::DBI

Then place in your Apache configuration file (httpd.conf):

PerlModule Apache::DBI

Or you can use a startup perl file.  Make sure you load Apache::DBI before
other DBI-related modules.

Apache::DBI provides for persistant connections, transparently.

Regards,

--
Dan Koch
Webmaster
American City Business Journals
http://www.amcity.com/


Thread
Persistent connections to db?Tom Cunningham23 Jun
  • Re: Persistent connections to db?Paul DuBois23 Jun
    • Re: Persistent connections to db?Tom Cunningham23 Jun
      • Re: Persistent connections to db?Daniel Koch23 Jun
        • DBD::mysql fails on two tests?Tom Cunningham24 Jun
          • glibc 2.1 performanceTom Cunningham25 Jun
            • Re: glibc 2.1 performance(Paul D. Smith)25 Jun
              • Re: glibc 2.1 performanceTom Cunningham25 Jun
                • Re: glibc 2.1 performanceathompso28 Jun
    • Re: Persistent connections to db?ed23 Jun
Re: glibc 2.1 performanceAndrew Dunstan25 Jun