You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by reto <re...@gmail.com> on 2007/10/05 01:03:36 UTC

[QUESTION] mod_perl2 and selfmade Modules

Hi everyone,

I just configured mod_perl on for my apache2 server on debian 4.
I have a perl-script index.cgi which is handled by mod_perl, by:
 SetHandler perl-script
 PerlHandler Apache::Registry
 Options ExecCGI

This script uses a Perl-Module in the same directory I wrote. This
could be something simple as:
 package Test;
 sub test() { return "hello world"; }

Now to the question: Will this module also gain speed the same way as
the script which uses this module and is handled by mod_perl?

Greets
 Reto

Re: [QUESTION] mod_perl2 and selfmade Modules

Posted by "D. Hageman" <dh...@dracken.com>.
Jeff Pang wrote:
> 2007/10/5, D. Hageman <dh...@dracken.com>:
> 
>> The module will be preloaded just like your script, thus any speed up
>> experienced by your script will also be experienced by the module.
>>
> 
> Hi,
> 
> If you don't preload it in startup.pl or with PerlModule directive in
> httpd.conf,I don't think registry scripts would be preloaded by apache
> defaultly.Yes when first request hit the cgi script,the script would
> be parsed and compiled and server that request,then it will be stored
> in apache child.Next time if requests are coming,the same cgi script
> won't be re-loaded and re-parsed.This was "load by needed",not
> preload.
> 
> Hope I'm right.If not,please point it out.
> 

The devil is in the details.  You are technically right.  Let me adjust 
what I said.

s/preloaded/cached/

-- 
========================================================
D. Hageman                        <dh...@dracken.com>
Dracken Technology, Inc.         http://www.dracken.com/
========================================================

Re: [QUESTION] mod_perl2 and selfmade Modules

Posted by Jeff Pang <rw...@gmail.com>.
2007/10/5, D. Hageman <dh...@dracken.com>:

> The module will be preloaded just like your script, thus any speed up
> experienced by your script will also be experienced by the module.
>

Hi,

If you don't preload it in startup.pl or with PerlModule directive in
httpd.conf,I don't think registry scripts would be preloaded by apache
defaultly.Yes when first request hit the cgi script,the script would
be parsed and compiled and server that request,then it will be stored
in apache child.Next time if requests are coming,the same cgi script
won't be re-loaded and re-parsed.This was "load by needed",not
preload.

Hope I'm right.If not,please point it out.

Re: [QUESTION] mod_perl2 and selfmade Modules

Posted by "D. Hageman" <dh...@dracken.com>.
reto wrote:
> Hi everyone,
> 
> I just configured mod_perl on for my apache2 server on debian 4.
> I have a perl-script index.cgi which is handled by mod_perl, by:
>  SetHandler perl-script
>  PerlHandler Apache::Registry
>  Options ExecCGI
> 
> This script uses a Perl-Module in the same directory I wrote. This
> could be something simple as:
>  package Test;
>  sub test() { return "hello world"; }
> 
> Now to the question: Will this module also gain speed the same way as
> the script which uses this module and is handled by mod_perl?

The module will be preloaded just like your script, thus any speed up 
experienced by your script will also be experienced by the module.

-- 
========================================================
D. Hageman                        <dh...@dracken.com>
Dracken Technology, Inc.         http://www.dracken.com/
========================================================