Re: [Catalyst] Catalyst::Engine::HTTP::Prefork not used? (solved)

2009-04-14 Thread Neo [GC]

J. Shirley schrieb:
On Tue, Apr 14, 2009 at 8:25 PM, Neo [GC] n...@gothic-chat.de 
mailto:n...@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, this means waiting ;)).

About usage I found only this:

$ cpan Catalyst:Engine::HTTP::Prefork
$ CATALYST_ENGINE='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 the 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} = '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='Yourmom' perl script/myapp_server.pl
 Can't locate Catalyst/Engine/Yourmom.pm in @INC

-J

Ha! Thank you very much, this was exactly the problem!

Our startup-scripts indeed seem to be abount two years old. I remember 
seeing a warning about old scripts once, but haven't seen them in a 
while and thought one of my colleagues fixed it.


If I may ask a following question how to rebuild the scripts? _ I 
can't reproduce the old warning and either I'm too stupid to use Google 
or the howto is hidden somewhere in subspace...


Thanks and regards,
Neo [GC]

___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Catalyst::Engine::HTTP::Prefork not used? (solved)

2009-04-14 Thread Moritz Onken


Am 14.04.2009 um 14:48 schrieb Neo [GC]:


J. Shirley schrieb:
On Tue, Apr 14, 2009 at 8:25 PM, Neo [GC] n...@gothic-chat.de mailto:n...@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, this means waiting ;)).

   About usage I found only this:

   $ cpan Catalyst:Engine::HTTP::Prefork
   $ CATALYST_ENGINE='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 the 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} = '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='Yourmom' perl script/myapp_server.pl
Can't locate Catalyst/Engine/Yourmom.pm in @INC

-J

Ha! Thank you very much, this was exactly the problem!

Our startup-scripts indeed seem to be abount two years old. I  
remember seeing a warning about old scripts once, but haven't seen  
them in a while and thought one of my colleagues fixed it.


If I may ask a following question how to rebuild the scripts?  
_ I can't reproduce the old warning and either I'm too stupid to  
use Google or the howto is hidden somewhere in subspace...




catalyst.pl -force -scripts MyApp

moritz

___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Catalyst::Engine::HTTP::Prefork not used? (solved)

2009-04-14 Thread Neo [GC]



Moritz Onken schrieb:


Am 14.04.2009 um 14:48 schrieb Neo [GC]:


J. Shirley schrieb:
On Tue, Apr 14, 2009 at 8:25 PM, Neo [GC] n...@gothic-chat.de 
mailto:n...@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, this means waiting ;)).

   About usage I found only this:

   $ cpan Catalyst:Engine::HTTP::Prefork
   $ CATALYST_ENGINE='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 the 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} = '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='Yourmom' perl script/myapp_server.pl
Can't locate Catalyst/Engine/Yourmom.pm in @INC

-J

Ha! Thank you very much, this was exactly the problem!

Our startup-scripts indeed seem to be abount two years old. I 
remember seeing a warning about old scripts once, but haven't seen 
them in a while and thought one of my colleagues fixed it.


If I may ask a following question how to rebuild the scripts? _ 
I can't reproduce the old warning and either I'm too stupid to use 
Google or the howto is hidden somewhere in subspace...




catalyst.pl -force -scripts MyApp 


Thanks! This seems to have worked. I still get a warning about old 
scripts, but I think from now on it's our adminmonkeys thing (don't know 
how old our CPAN-modules are...).


Regardsm
Neo [GC]

___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/