[Catalyst] Catalyst on Windows: fork issues

Rodrigo rodrigolive at gmail.com
Thu Feb 26 23:45:31 GMT 2009


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.scsys.co.uk/pipermail/catalyst/attachments/20090227/235d0=
54c/attachment.htm


More information about the Catalyst mailing list