Saltman
2005-Nov-04 04:59 UTC
lighttpd + spawner, only one process doing all the work (solution)
It took me a little while to figure this one out. Perhaps it''s obvious
to other folks, but in case it''s not:
If you''re using lighttpd with an external spawner for non-PHP
applications like rails, you need to list explicitly each port that the
spawned processes are using, ex:
fastcgi.server = (
".fcgi" => (
"localhost" =>
(
"host" => "127.0.0.1",
"port" => "1100"
),
(
"host" => "127.0.0.1",
"port" => "1101"
),
(
"host" => "127.0.0.1",
"port" => "1102"
)
)
)
Apparently PHP/fastcgi handles multiple requests from the same port
internally, so you only need to specify the first port in lighttpd.conf.
I was using a PHP example configuration when I set up my lighttpd.conf,
but with only the first fastcgi port for my rails app listed in the
config file, all requests were being fed to the first fastcgi process in
serial and the other processes never did anything.
The cool thing is that the rails app is so quick, I never noticed the
problem directly. I just happened to notice it today looking at the
total cpu time for the dispatchers.
