perl-modperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Perrin Harkins <phark...@gmail.com>
Subject Re: Manipulating @INC and tremendous blank page
Date Sun, 15 Feb 2009 18:29:31 GMT
On Fri, Feb 13, 2009 at 11:30 PM,  <shiriru0111@hotmail.com> wrote:
> I am using FindBin and added the FindBin::again() as recommanded
> in hope to switch to ModPerl::RegistryPrefork soon.
> I am using both use lib and unshift @INC but still, for some reasons,
> even with ModPerl::PerlRunPrefork got some pages that could not load
> and in the log, it was always due to a lib that couldn't be found.
> If I reload the page, it works, If I reload again sometimes it won't.
> Adding the startup.pl, get rid of this behavior.
> But I will change all use lib into unshift @INC and see how it behaves.
> I have to say that I do not really understand how mod_perl behaves regarding
> the @INC manipulation.

IIRC, the deal is that if you change @INC before the server forks it
will get picked up by all child processes and stay, but if you change
it after the fork it will be reset after the end of the request.  The
problem with "use lib" is that it only run once, at compile-time.  In
Registry, your code gets compiled on the first request, and afterward
it just executes the compiled code, so @INC gets reset but "use lib"
doesn't run again.  The "unshift @INC" will run every time.

> I've checked it thru firebug but is there a better plugin?

I normally use a proxy for this, so I'm not sure.  It doesn't matter
what you use, as long as it lets you see the full HTTP communication
back and forth.

> I have to say that switching to ModPerl::PerlRunPrefork allowed me to
> improve the performance in a amasing way!
> Well, i have checked the performance with Apache Benchmark (ab n 100 c
> 5,etc)
> and got a boost of about 20 times the cgi version when the simulated traffic
> is high!!

That's a great start.

> (this is true for pages that were cached with Cache::Cache but required perl
> to be executed in some way)

Have you looked at CHI, the new replacement for Cache::Cache?  It has
faster storage options.

- Perrin

Mime
View raw message