[Catalyst] Catalyst::Engine::HTTP::Prefork not used?

J. Shirley jshirley at gmail.com
Tue Apr 14 11:49:56 GMT 2009


On Tue, Apr 14, 2009 at 8:25 PM, Neo [GC] <neo at gothic-chat.de> wrote:

> Hi,
>
> I've read about the prefork-engine for the test-server in another thread,
> which could be very useful for me (our outsourced codemonkeys sometimes
> produce VERY SLOW controllers and together with multiple ajax-request, th=
is
> means waiting ;)).
>
> About usage I found only this:
>
> $ cpan Catalyst:Engine::HTTP::Prefork
> $ CATALYST_ENGINE=3D'HTTP::Prefork' script/myapp_server.pl
>
> Amazingly, this doesn't change anything at all with my app, after starting
> there are still only two processes (some kind of supervisor I think and t=
he
> real server process) and the requests are served one-by-one. Even more
> confusing, if I set CATALYST_ENGINE to 'Whatever', I get no error message=
 or
> something.
>
> Is there required more to use it, besides installing the module from CPAN?
>
>
> Thanks and regards,
> Neo [GC]
>
>
>
Hi Neo,

Are you running a really old version of Catalyst::Devel?

If you specify the -r option to myapp_server.pl that was generated with a
(oh, 2 years?) very old version of Catalyst::Devel it will not work right.

This option clobbers your engine and sets the engine to 'HTTP::Restart'.
Take a look at your script/myapp_server.pl and find the section for checking
$restart

The proper lines should be:

if ( $restart && $ENV{CATALYST_ENGINE} eq 'HTTP' ) {
    $ENV{CATALYST_ENGINE} =3D 'HTTP::Restarter';
}

It used to omit the test for CATALYST_ENGINE, and ... well, that's not right
:)

Otherwise, it should definitely throw an error for an invalid engine being
specified:

 $ CATALYST_ENGINE=3D'Yourmom' perl script/myapp_server.pl
 Can't locate Catalyst/Engine/Yourmom.pm in @INC

-J
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.scsys.co.uk/pipermail/catalyst/attachments/20090414/ac294=
a25/attachment.htm


More information about the Catalyst mailing list