A nasty evening with dispatch.fcgi

Hello all. Time for an all night installation
campfire (no pun intended) story.

I just helped a customer migrate from a single box
to a 5 box system.

2 Lighty
2 FCGI
1 DB

Everything went quite well. I scripted everything
so it would be easy to add more boxes in the future.
3 scripts, one for each box type above.

Then came time to get the site working. :slight_smile:

Lighty came up easily.
The DB came up easily.

Connectivity to the FCGI boxes to the DB was
demonstrated early and the champagne was nearly
flowing.

But we could not get the spinner/spawner to
launch dispatch.fcgi processes.

running dispatch.fcgi let us sort out a number
of problems, all trivial. Each time we were sure
that the processes would appear, and we’d be
able to sleep…but it just didn’t happen.

Google served hundreds of requests. IRQ was
visited to no avail. I was always sure that
nobody was reading the list at a late hour.
Certainly my lack of sleep made it easier
for me to forget that the net is a big place,
and the planet even larger, and it’s always
daytime somewhere. :slight_smile:

Finally, finally, I realized that I could run
the spinner/spawner combination without the
-d (daemon) option provided in the SwitchTower
docs.

And, after much angst, there was the answer!

In order to spawn an fcgi process, a machine
must have a binary installed by Lighttpd,
fcgi-spawner. The machine providing the FCGI
processes is not running Lighty, but the
requirement is still there.

So, in the future, if you’re setting up FCGI
and having difficulties, remember this post!

I wonder if I have single-handedly figured
out why a lot of people have difficulty with
Apache and IIS? It seems to me, in my sleep
deprived state, that without Lighty, Rails
with FCGI cannot work.

Perhaps this is only true if you’re using
spinner/spawner to manage the FCGI processes?

–
– Tom M.

What a great story Tom ! Thank you for sharing :slight_smile:

On 3/2/06, Tom M. <[email protected] > wrote:

In order to spawn an fcgi process, a machine
must have a binary installed by Lighttpd,
fcgi-spawner. The machine providing the FCGI
processes is not running Lighty, but the
requirement is still there.
You can use cgi-fcgi from libfcgi , so no need to install lighty.
spinner/spawner will not work, but you can use runit [
http://www.smarden.org/runit/ ] for supervising. Something like:

---------------------- >8 ---------------------
#!/bin/sh
exec chpst -e ./env cgi-fcgi -start -supervise -connect
{ip_addr}:{port} /path/to/dispatch.fcgi
---------------------- >8 ---------------------

This will start the fcgi listener on {ip_addr}:{port}.