[Catalyst] Catalyst on Windows: fork issues

Kieren Diment diment at gmail.com
Thu Feb 26 23:54:57 GMT 2009


Good call.  Lighttpd will be much simpler than  apache, as it's a  
single standalone executable, just run it with lighttpd -f  
my_config_file

Here's a vbs that will get your .bat file that does all of the jiggery- 
pokery running without a cmd.exe window at startup.  I put everything  
in %APPLICATION_DATA% except for this start.vbs script which goes in ~/ 
Startup or whatever the stupid naming convention is in windows.



On 27/02/2009, at 10:45 AM, Rodrigo wrote:

> Stefan, I've had similar problems in windows with prefork, which can  
> be
> started up after some tweaking, but will hang after a few requests.  
> Perl's
> fork() is a no-no in windows. FCGI can be painful to setup, so I  
> ended up
> giving up on it. I went on to use mod_perl with Apache, which has  
> problems
> of its own too, but a more trivial setup. Finally, the approach I'm  
> using
> right now is to setup a pool of single-threaded Catalyst dev servers,
> starting them up in a startup.bat such as this:
>
> start /b perl script\myapp_server.pl -p 3000
> start /b perl script\myapp_server.pl -p 3001
> start /b perl script\myapp_server.pl -p 3002
> ...
>
> If you wish to keep all your logs in one place:
>
> startup.bat >myapp.log 2>&1
>
> Then setup an Apache mod_proxy load-balancer (or lighttpd's, etc.) to
> balance the load among dev servers. Make sure you understand the  
> drawbacks
> of using catalyst dev servers in this manner, even though they work
> superbly.
>
> httpd.conf (or apache2.conf or etc.):
>
> LoadModule proxy_module modules/mod_proxy.so
> LoadModule proxy_balancer_module modules/mod_proxy_balancer.so
> LoadModule proxy_http_module modules/mod_proxy_http.so
>
> <Proxy balancer://cat>
> BalancerMember http://localhost:3000
> BalancerMember http://localhost:3001
>  BalancerMember http://localhost:3002
> </Proxy>
>
> ProxyPass / balancer://cat/
> ProxyPassReverse / balancer://cat/
>
> Take a look around the web for other settings that you may need,  
> such as
> catalyst's "using_frontend_proxy" and apache's static aliases,  
> balancer
> features, etc. Apache is extremely lightweight if you only run it for
> reverse proxy load-balancing.
>
> If you want to startup your catalyst server pool from a windows  
> service
> using a configuration file, I have a perl script that does that  
> somewhere.
> Just let me know.
>
> Hope this works for you.
>
> --rodrigo
> _______________________________________________
> List: Catalyst at 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/




More information about the Catalyst mailing list