Return-Path: Delivered-To: apmail-perl-modperl-archive@www.apache.org Received: (qmail 11002 invoked from network); 7 Apr 2005 11:49:30 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 7 Apr 2005 11:49:30 -0000 Received: (qmail 31937 invoked by uid 500); 7 Apr 2005 11:49:17 -0000 Delivered-To: apmail-perl-modperl-archive@perl.apache.org Received: (qmail 31924 invoked by uid 500); 7 Apr 2005 11:49:17 -0000 Mailing-List: contact modperl-help@perl.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Delivered-To: mailing list modperl@perl.apache.org Received: (qmail 31910 invoked by uid 99); 7 Apr 2005 11:49:17 -0000 X-ASF-Spam-Status: No, hits=2.3 required=10.0 tests=DNS_FROM_RFC_ABUSE,DNS_FROM_RFC_POST,HOT_NASTY X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: local policy includes SPF record at spf.trusted-forwarder.org) Received: from web86608.mail.ukl.yahoo.com (HELO web86608.mail.ukl.yahoo.com) (217.12.13.30) by apache.org (qpsmtpd/0.28) with SMTP; Thu, 07 Apr 2005 04:49:15 -0700 Message-ID: <20050407114913.53747.qmail@web86608.mail.ukl.yahoo.com> Received: from [213.178.159.251] by web86608.mail.ukl.yahoo.com via HTTP; Thu, 07 Apr 2005 12:49:12 BST Date: Thu, 7 Apr 2005 12:49:12 +0100 (BST) From: Martin Moss Subject: Re: Authentication problem To: "Levi E. Stanley" , modperl@perl.apache.org In-Reply-To: 6667 MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Virus-Checked: Checked X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Hi, what's your MaxClients setting in your apache conf? It could just be that you aren't running enough apache child processes to serve the number of connections being made, Regards Marty --- "Levi E. Stanley" wrote: > Hi, > > Been seeing problems with an Authenticate script > lately. It was working > fine up to the time I started getting slammed with > traffic. I don't see > any connection problems in the log file at all. But > what I have noticed > on the site is, I will click to go to download a > file from the secure > area, and it won't prompt me for a username and > password until minutes > later, like it is being delayed or something. Is > this normal behavior > from high traffic? > > More Info: > > The server isn't even being over worked, it has 4 > cpus and on high > traffic hours, it is around 2 on cpu load. So it > can only be two > possibilities, the script or apache configuration. > The apache version I > am using http-2.0.53, and mod_perl-2.0.0-RC4. > > Here is the code: > > package My::Authenticate; > > use strict; > use ModPerl::Util (); > use Apache::Const qw(OK DECLINED AUTH_REQUIRED); > use Apache::Log; > use DBI; > > sub handler{ > my $r = shift; > my $s = Apache->server; > > return Apache::DECLINED unless > $r->is_initial_req; > > my ($status,$password) = > $r->get_basic_auth_pw; > my $username = $r->user; > > return $status unless $status == Apache::OK; > > my $hostname = $r->hostname; > $hostname=~/(.*?\.)?(.*?)\.[a-z]{3}$/; > my $table_access = $2."_access"; > my $dbh = > DBI->connect('DBI:mysql:database=site_authentication;host=xxx.xxx.xxx.xxx','xxx','xxx'); > my $rs = $dbh->prepare("select 1 from > $table_access where > username='$username' and passwd='$password'"); > $rs->execute; > my ($result) = $rs->fetchrow_array; > $rs->finish(); > $dbh->disconnect(); > > if ($result){ > return Apache::OK; > } > > $r->note_basic_auth_failure; > return Apache::AUTH_REQUIRED; > } > > 1; > > Any assistance on this issue would be greatly > appreciated. > Send instant messages to your online friends http://uk.messenger.yahoo.com