Forum: Ruby on Rails RE: Dreamhost subscription?

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.
60e38de043848f82392062088f191213?d=identicon&s=25 Hogan, Brian P. (Guest)
on 2006-03-06 17:30
(Received via mailing list)
Dreamhost can be made stable. It's easy to get around the 500 errors by
simply modifying the fcgi_handler code to ignore the TERM signals.

Here's a sample dispatcher that will fix the 500 problems.  Combine this
with the cron task that keeps your app alive and responsive and DH seems
to work a lot better.

#!/usr/bin/ruby
#
# You may specify the path to the FastCGI crash log (a log of unhandled
# exceptions which forced the FastCGI instance to exit, great for
debugging)
# and the number of requests to process before running garbage
collection.
#
# By default, the FastCGI crash log is RAILS_ROOT/log/fastcgi.crash.log
# and the GC period is nil (turned off).  A reasonable number of
requests
# could range from 10-100 depending on the memory footprint of your app.
#
# Example:
#   # Default log path, normal GC behavior.
#   RailsFCGIHandler.process!
#
#   # Default log path, 50 requests between GC.
#   RailsFCGIHandler.process! nil, 50
#
#   # Custom log path, normal GC behavior.
#   RailsFCGIHandler.process! '/var/log/myapp_fcgi_crash.log'
#
require File.dirname(__FILE__) + "/../config/environment"
require 'fcgi_handler'

class RailsFCGIHandler
    SIGNALS = {
        'TERM' => :exit_now,
    }

    def exit_now_handler(signal)
        dispatcher_log :info, "ignoring request to terminate
immediately"
    end
end

RailsFCGIHandler.process!

# end of file


Brian Hogan
Web Development
Learning & Technology Services
Schofield 3-B
University of Wisconsin-Eau Claire
hoganbp@uwec.edu
0592d2d715f66b9413903e73096af273?d=identicon&s=25 Eric Knapp (Guest)
on 2006-03-07 15:34
(Received via mailing list)
I am trying to understand why this is necessary. I am on another shared
hosting company but I am seeing the same thing. The fastcgi log is
filled
with these:

[05/Mar/2006:00:34:59 :: 25968] asked to terminate immediately
[05/Mar/2006:00:34:59 :: 25968] terminated by explicit exit
[05/Mar/2006:00:40:36 :: 30458] starting

What is doing this? Does your fix address this? Are there any side
effects?

Thanks,

-Eric
This topic is locked and can not be replied to.