Title: MP2 PerlTransHandler and VirtualHosts
I'd like to ask a question in tangent to yours:
What happens you load a package via PerlPostConfigRequire? I usually 'require' a script, but if it is possible to execute a package instead, that may be better.
----- Original Message -----
Sent: Wednesday, February 15, 2006 6:16 AM
Subject: MP2 PerlTransHandler and VirtualHosts

List,

Is there any method to restore Apache's default PerlTransHandler
(or in general any other handler) in VirtualServer container after
a PerlTransHandler was set up in the main server config?

Consider the following:

PerlLoadModule            MyApp::ConfigParameters
PerlPostConfigRequire  MyApp/DeviceProxy.pm
PerlTransHandler          MyApp::DeviceProxy

<VirtualHost *:7780>
PerlOptions +Parent # don't use the main server's perl interpreter pool
….
PerlLoadModule            MyApp::ConfigParameters
….
_ Don't want the main server's TransHandler to run here _
_ No PerlTransHandler directive is present _
</VirtualHost>

In the main server  PerlPostConfigRequire  MyApp/DeviceProxy.pm
is used to load some big chunk of data into memory that is then used
by the PerlTransHandler to rewrite the uri and eventually dispatch the request
 to one of the several virtual servers. (This in-memory data is huge and
not needed for handlers defined VirtualHosts)
The handler sub for the TransHandler is defined in the MyApp::DeviceProxy
module as well and it returns DECLINED.

At server start-up the stuff is loaded into memory before the very first request
and requests ending up on the main server are serverd fast.
When, however, I go for the doc root on any of the virtual servers I notice that
there is a huge delay for the first request (further requests are served fast).

What happens is that for the first request the MyApp::DeviceProxy
is loaded for the virt host.. But there is not a single line in the virt host
that would cause loading that module!
It is crucial for me to avoid loading that module again and again for every virtual
server. And it is also required for the virtual servers to have their own independent
interpreter pool.

I compiled apache+mod perl with worker mpm.
And here is the relevant info on the components:
Apache/2.2.0 (Unix) mod_perl/2.0.2 Perl/v5.8.7

Please give me a hint what I'm doing wrong

Thanks,
--Attila

Reply via email to