We use rails 0.9.1 on apache 2 (linux) with fast cgi. One of our rails application is very slowly. It works about 2 minutes on standart cgi installation (without fast cgi). On fast cgi we have followin problem: fast cgi server restarts every 3 seconds. The following lines we found in apache error log: [Thu Dec 23 13:59:21 2004] [warn] FastCGI: (dynamic) server "/home/rails/rails/public/dispatch.fcgi" restarted (pid 3611) [Thu Dec 23 13:59:27 2004] [warn] FastCGI: (dynamic) server "/home/rails/rails/public/dispatch.fcgi" restarted (pid 3612) [Thu Dec 23 14:00:24 2004] [warn] FastCGI: scheduled the restart of the last (dynamic) server "/home/rails/rails/public/dispatch.fcgi" process: reached dynamicMaxClassProcs (10) [Thu Dec 23 14:00:24 2004] [warn] FastCGI: (dynamic) server "/home/rails/rails/public/dispatch.fcgi" restarted (pid 3619) Sometimes application works correctly and fast sometimes not. What happened?
> Sometimes application works correctly and fast sometimes not. What > happened?Apache 2 and mod_fcgi are not a stable combination, unfortunately. You''ll need to use Apache 1.3.x if you want a stable experience with mod_fcgi. There is some work being planned to make a ap2 safe version of mod_fcgi, but its not underway yet. -- David Heinemeier Hansson, http://www.basecamphq.com/ -- Web-based Project Management http://www.rubyonrails.org/ -- Web-application framework for Ruby http://macromates.com/ -- TextMate: Code and markup editor (OS X) http://www.loudthinking.com/ -- Broadcasting Brain
David Heinemeier Hansson wrote:>> Sometimes application works correctly and fast sometimes not. What >> happened? > > Apache 2 and mod_fcgi are not a stable combination, unfortunately. > You''ll need to use Apache 1.3.x if you want a stable experience with > mod_fcgi. There is some work being planned to make a ap2 safe version of > mod_fcgi, but its not underway yet.Hello, Has anyone tried to do a port of SCGI to Ruby? http://www.mems-exchange.org/software/scgi/ """ Introduction The SCGI protocol is a replacement for the Common Gateway Interface (CGI) protocol. It is a standard for applications to interface with HTTP servers. It is similar to FastCGI but is designed to be easier to implement. """ It has both Apache 1 & 2 implementations. Might be an easier and more maintainable route than FastCGI. They reported a small performance improvement when switching from FastCGI. Jimmie Houchin
Viktor Radigin wrote:> We use rails 0.9.1 on apache 2 (linux) with fast cgi. One of our rails > application is very slowly. It works about 2 minutes on standart cgi > installation (without fast cgi). On fast cgi we have followin problem: > fast cgi server restarts every 3 seconds. The following lines we found > in apache error log: > [Thu Dec 23 13:59:21 2004] [warn] FastCGI: (dynamic) server > "/home/rails/rails/public/dispatch.fcgi" restarted (pid 3611) > [Thu Dec 23 13:59:27 2004] [warn] FastCGI: (dynamic) server > "/home/rails/rails/public/dispatch.fcgi" restarted (pid 3612) > [Thu Dec 23 14:00:24 2004] [warn] FastCGI: scheduled the restart of the > last (dynamic) server "/home/rails/rails/public/dispatch.fcgi" process: > reached dynamicMaxClassProcs (10) > [Thu Dec 23 14:00:24 2004] [warn] FastCGI: (dynamic) server > "/home/rails/rails/public/dispatch.fcgi" restarted (pid 3619) > > Sometimes application works correctly and fast sometimes not. What > happened?Are there any error messages in the Rails logfile? Did you try using a static fastcgi server (see mod_fastcgi documentation)?
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Dec 23, 2004, at 9:25 AM, Andreas Schwarz wrote:> Are there any error messages in the Rails logfile? Did you try using a > static fastcgi server (see mod_fastcgi documentation)?I would second this. I''ve experimented quite a bit with this (have experience doing it with PHP and with perl going back to when fastcgi was new) and there are a lot of tunables that help when you run it as a static server or if you wrap as a way of passing environmental settings to the dynamic server. That said, there can be issues with fastcgi under apache2 (many of which are the driving force behind mod_fcgid), even though the most common is just the opposite of what you''re experiencing. - - - J -----BEGIN PGP SIGNATURE----- Version: PGP 8.1 iQA/AwUBQcsF5FUyB+ajXkCLEQI+owCggPrboA+jgVms4kEqSXBPzn1ZTioAn19o SYCch30/vRerQ9qZi2krwsVj =GQNk -----END PGP SIGNATURE-----