[Catalyst] FastCGI deployment - slow to complete request

Toby Corkindale toby.corkindale at strategicdata.com.au
Mon Feb 15 08:33:22 GMT 2010

On 15/02/10 15:59, Steve Rippl wrote:
> Hi,
> I have a small Catalyst app, the production version of which has been
> running pretty well using the built in server as there haven't been too
> many user at once. I'm trying to anticipate higher concurrent usage and
> switch to FastCGI (as that seems to be recommended in the book) and I
> have the following running in Apache
> FastCgiServer /srv/WsdSis/script/wsdsis_fastcgi.pl -processes 5
> Alias / /srv/WsdSis/script/wsdsis_fastcgi.pl/
> <VirtualHost *:80>
> ServerName sis.woodlandschools.org
> ServerAdmin webmaster at woodlandschool.org
> DocumentRoot /srv/WsdSis/root
> Alias /static /srv/WsdSis/root/static
> </VirtualHost>
> Now this works, it's serving up the application, but each request is
> really slow to complete! The obvious effect of this is that a page with
> JavaScript waiting for a complete page before it does it's thing looks
> dreadful for a while, the html has arrived but the browser is still
> spinning, then eventually the page completes and the JS runs. (I know
> about graceful failure for JS, but I have an app that is going to depend
> on it!). If I switch this back to the built in server then the page is
> completed faster than I can notice and the page renders correctly
> immediately. Back on FastCGI and even a simple page request is taking
> ~10 seconds to complete (again, that html arrives straight away, but
> then the browser keeps spinning as if it's still waiting on something).
> This is running on a Debian 5 machine using libapache2-mod-fastcgi.

You can get good performance out of catalyst by just running the PREFORK 
standalone server*, with a reverse-proxy cache sitting in front of it. 
(eg. Varnish http://varnish-cache.org/)

[* http://search.cpan.org/dist/Catalyst-Engine-HTTP-Prefork/ ]

I've never been satisfied by either of the FastCGI implementations 
available to Apache. I do like the one for Lighttpd, but some other 
aspects of lighty can be annoying.

More information about the Catalyst mailing list