httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Albert Lash" <>
Subject Re: Fastcgi, use something like spawn-fcgi?
Date Fri, 30 Oct 2009 17:29:31 GMT
> With all the discussion of mod_fcgid lately (I admit, I did not read all
> the
> threads, so forgive me if we already discussed this), I was wondering if a
> different approach would be better.
> I know at one time there was work on a mod_proxy_fastcgi. The current
> trend
> in "other webservers" seems to do the proxying inside the webserver and
> using a separate small process manager - something like spawn-fcgi or
> supervisord.
> So, we could have configs something like:
> ProxyPass /myapp fastcgi:///path/to/my.sock max=6 ...
> And should easily be able to do fasctcgi over tcp, etc.
> This should, hopefully, simplify the "in httpd" code.

Hi Brian,

Thanks for posting this, I have some experience to share, hopefully it
will be useful.

The process you describe is indeed how nginx (and I think Lighttpd) does
it. I've used it a bunch with nginx and it works fine but I actually like
mod_fcgi better. The process management was a little tricky to figure out
at first (DefaultMinClassProcessCount has to be set to 0?):

But in the end, it is awesome for containing memory leaks and
automatically re-spawning fastcgi processes. To be more explicit, in my
experience when memory constraints are not an issue (>128MB total?), I've
found Apache2 + mod_fcgid to be a far superior solution to all the
alternatives I've tried.

With spawn-fcgi, I've found I have to either program-in process management
features into the fastcgi app, or use cron, spawn-fgci and/or a process
manager to deal with stopping and starting the processes.

I've also tried out another approach which uses nginx's failover
capabilities to try connecting to the fastcgi socket (either unix or tcp).
It if fails, it connects to thttpd or mathopd to spawn a cgi process which
kickstarts the fastcgi process again. Its "hacky" and AFAIK only works
with fastcgi apps that are cgi compatible, but in the end it was actually
fairly reliable.

My next experiment will be with the cgi-fcgi bridge, which I just learned
can spawn fastcgi processes like spawn-fcgi, though as I'm writing this
I'm not sure if it can set them up to listen on unix sockets.

In closing, I'll add that I'm greatly appreciative of both Apache and
mod_fcgid and was thrilled when I learned that mod_fcgid was getting
merged into the Apache code base.

Hope that helps!

- Albert

View raw message