Greg Hauptmann
2007-Aug-12 20:56 UTC
24 seconds for FASTCGI process to startup??? Is this normal???
Hi, I''m on Dreamhost for hosting and have been finding that (noting Dreamhost kill off ruby processes) the first page return takes 20-40seconds, after which things go ok. I''ve put some logging in the "dispatch.fcgi" code and note the following: - HTTP log output for initial request: X seconds - "dispatch.fcgi" entry: 1 second after this - fastcgi process log entry: 24 seconds after last step - my RoR app log entry: 1 second after last step Question - Is it normal for the fastcgi processes to take this long to start up? Any suggestions on how to improve startup time? Note: I am aware of a work around mentioned on the Dreamhost wiki which I will try (see below), however I wanted to make sure I can''t optimize the root cause start up time before going into work around mode. If you are using fcgi with Ruby on Rails, you might get what appear to be random 500 errors occasionally. Alex Young''s workaround<http://work.alexyoung.org/archives/102/dreamhost-and-rails-500-errors>, adapted from Gary Lin''s workaround<http://thread.gmane.org/gmane.comp.lang.ruby.rails/33057>seems to resolve this. Basically, add the following code to your dispatch.fcgi, right *before* RailsFCGIHandler.process! class RailsFCGIHandler private def frao_handler(signal) dispatcher_log :info, "asked to terminate immediately" dispatcher_log :info, "frao handler working its magic!" restart_handler(signal) end alias_method :exit_now_handler, :frao_handler Regards --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---