Forum: Ruby on Rails managing number of dispatch.fcgi processes ?

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Todd S. (Guest)
on 2006-03-04 21:28
I have a problem where when I try and access my site a dispatch.fcgi
process is started but then exits right after the page has loaded.
Requireing it to start all over agin the next time a request is made.
I've read about people using two or more FCGI processes to help with the
request load but how do people do this?

Firstly, how do you make a FCGI process persistant?  I'm not sure why
mine is exiting, no errors reported in the logs.

Secondly, if you wanted to run 2 or more concurrent FCGI processes how
would you go about setting that up?
Luca Pireddu (Guest)
on 2006-03-04 21:49
(Received via mailing list)
On March 4, 2006 12:28, Todd S. wrote:
> would you go about setting that up?
Depends on the web server you're using.  For instance, you can set
Apache2 and
mod_fcgi to use 4 of persistent fcgi processes with a configuration like

FastCgiServer /abs/path/to/application/public/dispatch.fcgi \
       -idle-timeout 120 \
       -initial-env PERL_SIGNALS=unsafe \
       -initial-env RAILS_ENV=production \
       -processes 4
You can also set it to dynamically manage its fcgi processes.

For lighttpd you can set min-procs and max-procs in your fcgi
configuration.
Look at the documentation here for more details:
http://www.lighttpd.net/documentation/fastcgi.html

For other web servers check the relevant documentation.  Hope that
helps.

Luca
Todd S. (Guest)
on 2006-03-04 23:00
Well, I'm on a shared host running apache so I'm not sure how much
control I have over the configuration.  They (dreamhost) and others
claim that rails works great there but I've not seen it work yet.

I do get these errors in my http error log....

Couldn't write to 4: starting
  TypeError: can't convert Fixnum into String
Couldn't write to 4: terminated gracefully
  TypeError: can't convert Fixnum into String


I'm not sure if this is the cause of the problem or not.
Todd S. (Guest)
on 2006-03-04 23:34
> Couldn't write to 4: starting
>   TypeError: can't convert Fixnum into String
> Couldn't write to 4: terminated gracefully
>   TypeError: can't convert Fixnum into String
>


These erros came from having..
    RailsFCGIHandler.process! 4

in the dispatch.fcgi script as opposed to just

    RailsFCGIHandler.process!


but that didn't make the process persistant or speed up load time at
all.
Todd S. (Guest)
on 2006-03-05 00:10
Okay, I think I got it...


in my .htaccess file I had

AddHandler fastcgi-script .fcgi
AddHandler cgi-script .fcgi

if I change it to

AddHandler fastcgi-script .fcgi
# AddHandler cgi-script .fcgi

then things work.  Wow.
This topic is locked and can not be replied to.