Tuning response time from Apache server (using mod_perl handler)

Tuning response time from Apache server (using mod_perl handler)

am 15.02.2011 21:15:21 von Jeff Anderson

--90e6ba4fc308eab2f4049c57d2ba
Content-Type: text/plain; charset=ISO-8859-1

Greetings,

I have a mod_perl handler (that is intended to run on a proxy server)
written like so:

package Handler;

sub handler { return -1 }

1;

I am testing this handler by registering it as a Trans handler like so:

PerlTransHandler Handler

*I have also tried testing by registering as a Fixup handler:*
*
*
**
* SetHandler perl-script*
* PerlFixupHandler Handler*
*
*

Before I register this handler, my average response time serving a static
document is about 20 milli seconds. When i register this handler as either a
Trans or Fixup handler, my performance degrades to 2 whole seconds.

I am using the worker.c threaded version, here are my settings:


ServerLimit 100
StartServers 16
MaxClients 1025
MinSpareThreads 25
MaxSpareThreads 100
ThreadsPerChild 25
MaxRequestsPerChild 2048


# Put this here to fix broken pipe from mod_perl (?)
ProxyReceiveBufferSize 217088
ProxyIOBufferSize 217088


Can anyone see the reason why my performance is being degraded
significantly? Is this normal? Any suggestions or recommendations are
greatly appreciated. Thank you in advance, and please let me know if you
need any more details in case i left them out.

Thanks!
jeffa

--90e6ba4fc308eab2f4049c57d2ba
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

Greetings,


I have a mod_perl handler (that is intended t=
o run on a proxy server) written like so:

nt class=3D"Apple-style-span" face=3D"'courier new', monospace">pac=
kage Handler;

ace">
urier new', monospace">sub handler { return -1 }
class=3D"Apple-style-span" face=3D"'courier new', monospace">

', monospace">1;

I am testing this hand=
ler by registering it as a Trans handler like so:


=
PerlTransHandler Handler

I have also tri=
ed testing by registering as a Fixup handler:

v>
onospace"><Location />
tyle-span" face=3D"'courier new', monospace">   =A0SetHandle=
r perl-script

ace">   =A0PerlFixupHandler Handler
=3D"Apple-style-span" face=3D"'courier new', monospace"></Loc=
ation>


Before I register this handler, my average respon=
se time serving a static document is about 20 milli seconds. When i registe=
r this handler as either a Trans or Fixup handler, my performance degrades =
to 2 whole seconds.


I am using the worker.c threaded version, here are my s=
ettings:

e=3D"'courier new', monospace"><IfModule worker.c> v>
ace">ServerLimit =A0 =A0 =A0 =A0 =A0 100
ple-style-span" face=3D"'courier new', monospace">StartServers =A0 =
=A0 =A0 =A0 =A0 16

ace">MaxClients =A0 =A0 =A0 =A0 =A0 1025
ple-style-span" face=3D"'courier new', monospace">MinSpareThreads =
=A0 =A0 =A0 =A025

ace">MaxSpareThreads =A0 =A0 =A0 100
style-span" face=3D"'courier new', monospace">ThreadsPerChild =A0 =
=A0 =A0 =A025

ace">MaxRequestsPerChild =A02048
e-span" face=3D"'courier new', monospace"></IfModule><=
/div>

ace">
39;courier new', monospace"># Put this here to fix broken pipe from mod=
_perl (?)

ace">ProxyReceiveBufferSize 217088
yle-span" face=3D"'courier new', monospace">ProxyIOBufferSize =A0 =
=A0 =A0217088

ace">

Can anyone see the reason w=
hy my performance is being degraded significantly? Is this normal? Any sugg=
estions or recommendations are greatly appreciated. Thank you in advance, a=
nd please let me know if you need any more details in case i left them out.=


Thanks!
jeffa



--90e6ba4fc308eab2f4049c57d2ba--

Re: Tuning response time from Apache server (using mod_perl handler)

am 17.02.2011 11:47:38 von aw

Jeff Anderson wrote:
> Greetings,
>
> I have a mod_perl handler (that is intended to run on a proxy server)
> written like so:
>
> package Handler;
>
> sub handler { return -1 }
>
What is -1 ?
Have you checked that this is a valid return value for a Trans handler ?

Re: Tuning response time from Apache server (using mod_perl handler)

am 17.02.2011 12:06:32 von torsten.foertsch

On Thursday, February 17, 2011 11:47:38 Andr=E9 Warnier wrote:
> What is -1 ?

the same as Apache2::Const::DECLINED. So, the handler itself seems okay.

Torsten Förtsch

=2D-=20
Need professional modperl support? Hire me! (http://foertsch.name)

Like fantasy? http://kabatinte.net

Re: Tuning response time from Apache server (using mod_perl handler)

am 17.02.2011 14:16:31 von Perrin Harkins

On Tue, Feb 15, 2011 at 3:15 PM, Jeff Anderson wrote:
> I have a mod_perl handler (that is intended to run on a proxy server)

Is this the only mod_perl running on the server? Normally people
avoid running it on a proxy.

- Perrin

Re: Tuning response time from Apache server (using mod_perl handler)

am 17.02.2011 21:42:57 von Randolf Richardson

> Greetings,
>
> I have a mod_perl handler (that is intended to run on a proxy server)
> written like so:
[sNip]
> **
> * SetHandler perl-script*
> * PerlFixupHandler Handler*
> *
*
>
> Before I register this handler, my average response time serving a static
> document is about 20 milli seconds. When i register this handler as either a
> Trans or Fixup handler, my performance degrades to 2 whole seconds.
[sNip]
> Can anyone see the reason why my performance is being degraded
> significantly? Is this normal? Any suggestions or recommendations are
> greatly appreciated. Thank you in advance, and please let me know if you
> need any more details in case i left them out.

Have you tried using the "modperl" handler instead of the "perl-
script" handler? There is more overhead with the "perl-script"
handler due to populating %ENV as per documentation:


http://perl.apache.org/docs/2.0/user/config/config.html#C_Se tHandler_

I normally use the "modperl" handler for all the stuff I do and I
find the response time is slightly better than serving static HTML
pages, but I'm also not doing anything with PerlFixupHandler.

Randolf Richardson - randolf@inter-corporate.com
Inter-Corporate Computer & Network Services, Inc.
Vancouver, British Columbia, Canada
http://www.inter-corporate.com