I’ve noticed a little instability with my setup recently, at present I have Lighty configured to manage the FastCGI processes itself.
The relevant part of my config looks as follows:
fastcgi.server= (".fcgi" =>("oobaloo.co.uk" => ( "socket" => "/tmp/oobaloo-lighttpd-fcgi.socket", "bin-path" => "/var/www/servers/www.oobaloo.co.uk/current/public/dispatch.fcgi", "bin-environment" => ("RAILS_ENV" => "production" ), "max-load-per-proc" => 4, "min-procs" => 1, "max-procs" => 3, "idle-timeout" => 90 ))
However, I’ve read people suggest that it’s better (when running more than one rails application) to instead use static processes, and there’s a page on the Rails wiki describing this setup.
So, I changed my Lighty config to the following:
fastcgi.server = (".fcgi" => ("localhost-7000" => ("host" => "127.0.0.1", "port" => 7000, "bin-environment" => ("RAILS_ENV" => "production"))), ("localhost-7002" => ("host" => "127.0.0.1", "port" => 7002, "bin-environment" => ("RAILS_ENV" => "production"))), ("localhost-7001" => ("host" => "127.0.0.1", "port" => 7001, "bin-environment" => ("RAILS_ENV" => "production"))))
and instead started the processes manually using the `spawner` with the following script:
!/bin/sh
/var/www/servers/\
www.oobaloo.co.uk/current/script/process/spinner \
-c ’/var/www/servers/\
www.oobaloo.co.uk/current/script/process/spawner -p 7000 -i 3’ \
-d
However, I noticed that over time new processes were being created to handle `dispatch.fcgi` for the blog. This got to the point with about 6 or 7 processes that would choke the VPS and cause it to become relatively unusable.
Is this normal for other processes to be created? Under what conditions would additional processes be spawned?
Anyway, for the time being I’m back on Lighty managed processes—at least the number of processes remain static.