Re: ModPerl::RegistryLoader
Keywan Ghadami <[email protected]>
| Newsgroups | gmane.comp.apache.mod-perl |
|---|---|
| Message-ID | <[email protected]> |
Hi Jiri,
i am not sure what you are trying to do with ModPerl::RegistryLoader,
but what me helped to improve performance was :
1. Preload almost every library on startup:
PerlPostConfigRequire /xyz/startup.pl (
---------
use Apache2::RequestRec();
use Apache2::RequestIO();
use Apache2::RequestUtil();
use Apache2::ServerRec();
use Apache2::ServerUtil();
use Apache2::Connection();
use Apache2::Log();
use Apache2::Request();
use APR::Table();
#... and so on
----------
2. reused db connection over requests
3. using mmap cache for Data that comes from db
4. last but not least use HTTP cache Protocol with mod_cache
All together hundred of projects with hundreds of simultaneous requests
are possible on only one server.
regards Keywan
Am 21.07.2011 21:58, schrieb Jiří Pavlovský:
> On 21.7.2011 18:41, Perrin Harkins wrote:
>>> So I was looking a solution and found ModPerl::RegistryLoader. I'm
>>> just not
>>> sure I understand it completely. Is this the "compile once at startup"
>>> solution?
>> Yes, that's what it's for.
> Thanks, so I'm on correct track
>>
>>> Do I just put " my $rlbb = ModPerl::RegistryLoader->new();" into
>>> my startup file?
>> Well, you need more than that. Please read the man page and try it
>> out, and if you get stuck, come back and ask questions about the
>> specifics.
>
> I did RTFM, but the man page was not clear to me, so I asked on the list.
>
> Anyway, now I tried to implement something along the lines suggested
> in the synopsis:
>
> sub trans {
> my $uri = shift;
> return File::Spec->catfile(MY_DOC_ROOT, $uri);
> }
> my $rl = ModPerl::RegistryLoader->new(
> package => 'ModPerl::RegistryPrefork',
> trans => \&trans,
> );
>
> ....
> # these $apps are of the form '/cgi-bin/script.pl'
> foreach my $app (@apps) {
> $rl->handler($app);
> }
>
> In addition I've few Location directives in httpd.conf to load few
> other scripts.
>
> However this doesn't work as Apache is segfaulting.
>
>
>
--
*Keywan Ghadami*
Entwicklung und Sicherheit
*ibson*
Fritz-Arnold-Str. 23
D-78467 Konstanz
Telefon +49 (0)75 31 / 81 39 7 93
Fax +49 (0)75 31 / 81 39 7 89