Return-Path: Delivered-To: apmail-perl-modperl-archive@www.apache.org Received: (qmail 93591 invoked from network); 5 Apr 2004 20:03:49 -0000 Received: from daedalus.apache.org (HELO mail.apache.org) (208.185.179.12) by minotaur-2.apache.org with SMTP; 5 Apr 2004 20:03:49 -0000 Received: (qmail 1833 invoked by uid 500); 5 Apr 2004 20:03:22 -0000 Delivered-To: apmail-perl-modperl-archive@perl.apache.org Received: (qmail 1797 invoked by uid 500); 5 Apr 2004 20:03:22 -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 1732 invoked from network); 5 Apr 2004 20:03:21 -0000 From: "John Brahy" To: "'Modperl List'" Subject: RE: Performance Issues with mod_perl's PerlAccessHandler Date: Mon, 5 Apr 2004 13:03:28 -0700 Message-ID: <007f01c41b49$0fdf9510$6f01a8c0@superg9000> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_0080_01C41B0E.6380BD10" X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook, Build 10.0.6626 Importance: Normal X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 In-Reply-To: <043001c412b7$d76126c0$6f01a8c0@superg9000> X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N ------=_NextPart_000_0080_01C41B0E.6380BD10 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Just a follow-up on the performance issue that we were experiencing. = Someone had enabled IdentityChecks in Apache's httpd.conf file and some of our clients were behind firewalls and would cause up to a 30 delay per request... It's documented in the apache docs.=20 =20 =20 ::::: John Brahy ::::: Research and Development ::::: www.ad2.com =20 =20 ::::: johnb@ad2.com ::::: t: 310. 394. 8379 ::::: f: 310. 451. 0966 =20 ::::: ad2, Inc. ::::: 2118 Wilshire Blvd # 205 ::::: Santa Monica, CA 90403 =20 =20 -----Original Message----- From: John Brahy [mailto:JohnB@ad2.com]=20 Sent: Thursday, March 25, 2004 2:24 PM To: 'Modperl List' Subject: Performance Issues with mod_perl's PerlAccessHandler=20 Hello, =20 We're experiencing problems with an authentication handler I wrote. I probably did something wrong when I wrote it.=20 =20 Apache 1.3.27=20 mod_perl mod_perl/1.26 =20 I know I'm not running the latest versions, if you think that is the = problem I will upgrade. =20 in .htaccess I have: ad2::Extranet::Authenticate which refers to: sub handler { my $r =3D shift; =20 my $uri =3D $r->uri;=20 my $ticket =3D &getTicket($r); my $validTicket =3D &isValidTicket($dbh,$ticket); if ($validTicket){ my $allowedURI =3D &isAllowedURI($dbh,$ticket,$uri); if ($allowedURI){ &updateTicket($dbh,$ticket); return OK; } else { $r->content_type('text/html'); &reportError($dbh,"Unauthorized Access",$ticket,$r); $r->header_out(Location =3D> = 'http://www.ad2.com/login/index.ad2'); return REDIRECT; }=20 } else { my $expiredString =3D ""; my $inactiveTime =3D &getInactiveSpanForTicket($dbh,$ticket); $r->content_type('text/html'); if ($inactiveTime < 60) { $expiredString =3D " $inactiveTime seconds "; =20 } else { my $minutes =3D int($inactiveTime / 60); =20 my $seconds =3D $inactiveTime % 60; =20 $expiredString =3D " $minutes minutes and $seconds seconds"; } &reportError($dbh,"Ticket has been expired for $expiredString ",$ticket,$r); $r->header_out(Location =3D> 'http://www.ad2.com/login/index.ad2?error=3Dexpired_session&expiredURL=3D= ' . $uri); return REDIRECT; } =20 $r->content_type('text/html'); &reportError($dbh,"Expired",$ticket,$r); $r->header_out(Location =3D> 'http://www.ad2.com/login/index.ad2'); return REDIRECT; } sub getTicket { my ($r) =3D @_; my %cookies =3D CGI::Cookie->parse($r->header_in('Cookie')); if (defined $cookies{'Ticket'}){ return $cookies{'Ticket'}->value; }=20 } =20 Thanks in advance for any assistance. =20 John =20 =20 ::::: John Brahy ::::: Research and Development ::::: www.ad2.com =20 =20 ::::: johnb@ad2.com ::::: t: 310. 394. 8379 ::::: f: 310. 451. 0966 =20 ::::: ad2, Inc. ::::: 2118 Wilshire Blvd # 205 ::::: Santa Monica, CA 90403 =20 =20 =20 ------=_NextPart_000_0080_01C41B0E.6380BD10 Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Message
Just a=20 follow-up on the performance issue that we were experiencing. Someone = had=20 enabled IdentityChecks in Apache's httpd.conf file and some of our = clients were=20 behind firewalls and would cause up to a 30 delay per request... It's = documented=20 in the apache docs.
 
 
:::::  John = Brahy
::::: =20 Research and Development
:::::  www.ad2.com
 
:::::  johnb@ad2.com
:::::  t: 310. = 394.=20 8379
:::::  f: 310. 451. 0966
 
:::::  ad2, = Inc.
::::: =20 2118 Wilshire Blvd # 205
:::::  Santa Monica, CA = 90403
 
 
-----Original Message-----
From: John = Brahy=20 [mailto:JohnB@ad2.com]
Sent: Thursday, March 25, 2004 2:24=20 PM
To: 'Modperl List'
Subject: Performance Issues = with=20 mod_perl's PerlAccessHandler

Hello,
 
We're experiencing=20 problems with an authentication handler I wrote. I probably did = something=20 wrong when I wrote it.
 
Apache 1.3.27=20
mod_perl = mod_perl/1.26
 
I=20 know I'm not running the latest versions, if you think that is the = problem I=20 will upgrade.
 
in = .htaccess I=20 have:  ad2::Extranet::Authenticate
which refers to:

sub handler {
 my $r =3D=20 shift;
 
 my $uri =3D $r->uri;
 my $ticket = =3D=20 &getTicket($r);
 my $validTicket =3D=20 &isValidTicket($dbh,$ticket);
 if=20 ($validTicket){
  my $allowedURI =3D=20 &isAllowedURI($dbh,$ticket,$uri);
  if=20 = ($allowedURI){
   &updateTicket($dbh,$ticket);
&= nbsp;  return=20 OK;
  } else=20 = {
   $r->content_type('text/html');
  &= nbsp;&reportError($dbh,"Unauthorized=20 Access",$ticket,$r);
     =20 $r->header_out(Location =3D>=20 'http://www.ad2.com/login/index.ad2');
   return=20 REDIRECT;
  } 
 } else {
  my=20 $expiredString =3D "";
  my $inactiveTime =3D=20 = &getInactiveSpanForTicket($dbh,$ticket);
  $r->conten= t_type('text/html');
  if=20 ($inactiveTime < 60) {
    $expiredString = =3D "=20 $inactiveTime seconds ";
 
  =20 } else=20 {
    my $minutes =3D int($inactiveTime /=20 60);   
    my $seconds =3D = $inactiveTime=20 % 60;   
    $expiredString =3D = " $minutes=20 minutes and $seconds=20 = seconds";
  }
  &reportError($dbh,"Ticket = has=20 been expired for $expiredString=20 ",$ticket,$r);
  $r->header_out(Location =3D>=20 = 'http://www.ad2.com/login/index.ad2?error=3Dexpired_session&expiredUR= L=3D' .=20 $uri);
  return REDIRECT;
 }
 
 $r->content_type('text/html');
 &reportErro= r($dbh,"Expired",$ticket,$r);
 $r->header_out(Location=20 =3D> 'http://www.ad2.com/login/index.ad2');
 return=20 REDIRECT;
}

sub getTicket {
 my ($r) = =3D=20 @_;
 my %cookies =3D=20 CGI::Cookie->parse($r->header_in('Cookie'));
 if = (defined=20 $cookies{'Ticket'}){
  return=20 $cookies{'Ticket'}->value;
 }
}
 
Thanks in advance=20 for any assistance.
 
John
 
 
:::::  John = Brahy
::::: =20 Research and Development
:::::  www.ad2.com
 
:::::  johnb@ad2.com
:::::  t: 310. = 394.=20 8379
:::::  f: 310. 451. 0966
 
:::::  ad2, = Inc.
::::: =20 2118 Wilshire Blvd # 205
:::::  Santa Monica, CA = 90403
 
 
 
------=_NextPart_000_0080_01C41B0E.6380BD10--