Hi to everybody, This my first post on the list. I''m a newby of mongrel & rails, I''ve deployed my first project and everything seems to work fine, the only problem I have is the following: After about 1 or 2 days of the mongrel_rails daemon running the mongrel.pid in the log directory disappears, the mongrel process is still there running but doesn''t respond anymore. I have a very simple configuration an Apache webserver configured as proxy-pass to the mongrel ( single process ) daemon answering on port 8080. Its a demo project thus the traffic is practically 0. Any hints? Thanks, Massimo
On Mon, Sep 25, 2006 at 08:50:07AM +0200, Massimo Santoli wrote:> Hi to everybody, > > This my first post on the list. > I''m a newby of mongrel & rails, I''ve deployed my first project and > everything seems to work fine, the only problem I have is the following: > After about 1 or 2 days of the mongrel_rails daemon running the > mongrel.pid in the log directory disappears, the mongrel process is > still there running > but doesn''t respond anymore. > I have a very simple configuration an Apache webserver configured as > proxy-pass to the mongrel ( single process ) daemon answering on port 8080. > Its a demo project thus the traffic is practically 0.Which operating system are you using? Does mongrel.log show anything? -- Cheers, - Jacob Atzen
On Mon, 25 Sep 2006 08:50:07 +0200 Massimo Santoli <massimo at zero.it> wrote:> Hi to everybody, > > This my first post on the list. > I''m a newby of mongrel & rails, I''ve deployed my first project and > everything seems to work fine, the only problem I have is the following: > After about 1 or 2 days of the mongrel_rails daemon running the > mongrel.pid in the log directory disappears, the mongrel process is > still there running > but doesn''t respond anymore. > I have a very simple configuration an Apache webserver configured as > proxy-pass to the mongrel ( single process ) daemon answering on port 8080. > Its a demo project thus the traffic is practically 0.Hi Massimo, first thing I''d think of is that you have some sort of build process that clears the log directory. Are you running a rake task that does this, or running capistrano and it''s doing this? I vaguely remember something like rake clear_logs doing this. -- Zed A. Shaw, MUDCRAP-CE Master Black Belt Sifu http://www.zedshaw.com/ http://mongrel.rubyforge.org/ http://www.lingr.com/room/3yXhqKbfPy8 -- Come get help.
I had a problem once with logrotation (the logrotate daemon) not being very friendly to lightty and the fcgis - killing ''em and not restarting after clearing their logs. Hope that helps, On 9/25/06, Zed A. Shaw <zedshaw at zedshaw.com> wrote:> On Mon, 25 Sep 2006 08:50:07 +0200 > Massimo Santoli <massimo at zero.it> wrote: > > > Hi to everybody, > > > > This my first post on the list. > > I''m a newby of mongrel & rails, I''ve deployed my first project and > > everything seems to work fine, the only problem I have is the following: > > After about 1 or 2 days of the mongrel_rails daemon running the > > mongrel.pid in the log directory disappears, the mongrel process is > > still there running > > but doesn''t respond anymore. > > I have a very simple configuration an Apache webserver configured as > > proxy-pass to the mongrel ( single process ) daemon answering on port 8080. > > Its a demo project thus the traffic is practically 0. > > Hi Massimo, first thing I''d think of is that you have some sort of build process that clears the log directory. Are you running a rake task that does this, or running capistrano and it''s doing this? I vaguely remember something like rake clear_logs doing this. > > -- > Zed A. Shaw, MUDCRAP-CE Master Black Belt Sifu > http://www.zedshaw.com/ > http://mongrel.rubyforge.org/ > http://www.lingr.com/room/3yXhqKbfPy8 -- Come get help. > _______________________________________________ > Mongrel-users mailing list > Mongrel-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-users >-- Charles Brian Quinn self-promotion: www.seebq.com highgroove studios: www.highgroove.com slingshot hosting: www.slingshothosting.com
Zed, It seems that the issues is fixed. I''ll explain better again: The missing mongrel.pid file problem was reported by the mongrel_rails mongrel::stop command when I noticed that the the mongrel server stop responding and I was trying to stop it, actually sometimes the pid file was there but the mongrel stop command reported that the file was missing. Again I noticed this problem because my configuration ( apache 2.0.59 + mod_proxy + 1 mongrel task ) stopped respoding after a couple of hours it had been launched, also contacting directly the mongrel server didn''t work. Looking around various thread I''ve found for a similar problem : mongrel stopping responding, due to a bug in apache 2.2.x and it could be solved by adding: SetEnv force-proxy-request-1.0 1 SetEnv proxy-nokeepalive 1 I''ve modified the server configuration and now it''s over 8 hours that the server is running fine. Hope this solved the problem I''ll let you know and if you want I can try to reproduce the bug. Massimo Zed A. Shaw wrote:>On Mon, 25 Sep 2006 08:50:07 +0200 >Massimo Santoli <massimo at zero.it> wrote: > > > >>Hi to everybody, >> >>This my first post on the list. >>I''m a newby of mongrel & rails, I''ve deployed my first project and >>everything seems to work fine, the only problem I have is the following: >>After about 1 or 2 days of the mongrel_rails daemon running the >>mongrel.pid in the log directory disappears, the mongrel process is >>still there running >>but doesn''t respond anymore. >>I have a very simple configuration an Apache webserver configured as >>proxy-pass to the mongrel ( single process ) daemon answering on port 8080. >>Its a demo project thus the traffic is practically 0. >> >> > >Hi Massimo, first thing I''d think of is that you have some sort of build process that clears the log directory. Are you running a rake task that does this, or running capistrano and it''s doing this? I vaguely remember something like rake clear_logs doing this. > > >
Unfortunately this morning the mongrel server was hung up ( mongrel.pid was there ). Here is a snapshot from the log: ############################# Processing Base#index (for 212.121.66.93 at 2006-09-26 09:11:00) [GET] Session ID: 0fb84c71774cad2aada0404f9b42e0f9 Parameters: {} Mongrel::TimeoutError (Mongrel timed out this thread: shutdown): /usr/local/lib/ruby/gems/1.8/gems/mongrel-0.3.13.4/lib/mongrel.rb:637:in `write'' /usr/local/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/vendor/mysql.rb:517:in `write'' /usr/local/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/vendor/mysql.rb:491:in `command'' /usr/local/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/vendor/mysql.rb:223:in `close'' /usr/local/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/connection_adapters/mysql_adapter.rb:168:in `disconnect! '' /usr/local/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/connection_adapters/mysql_adapter.rb:163:in `reconnect!'' /usr/local/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/connection_adapters/abstract_adapter.rb:85:in `verify!'' /usr/local/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/connection_adapters/abstract/connection_specification.rb :99:in `verify_active_connections!'' /usr/local/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/connection_adapters/abstract/connection_specification.rb :98:in `verify_active_connections!'' /usr/local/lib/ruby/gems/1.8/gems/rails-1.1.6/lib/dispatcher.rb:70:in `prepare_application'' /usr/local/lib/ruby/gems/1.8/gems/rails-1.1.6/lib/dispatcher.rb:37:in `dispatch'' /usr/local/lib/ruby/gems/1.8/gems/mongrel-0.3.13.4/lib/mongrel/rails.rb:84:in `process'' /usr/local/lib/ruby/1.8/sync.rb:229:in `synchronize'' /usr/local/lib/ruby/gems/1.8/gems/mongrel-0.3.13.4/lib/mongrel/rails.rb:83:in `process'' /usr/local/lib/ruby/gems/1.8/gems/mongrel-0.3.13.4/lib/mongrel.rb:580:in `process_client'' /usr/local/lib/ruby/gems/1.8/gems/mongrel-0.3.13.4/lib/mongrel.rb:579:in `process_client'' /usr/local/lib/ruby/gems/1.8/gems/mongrel-0.3.13.4/lib/mongrel.rb:686:in `run'' /usr/local/lib/ruby/gems/1.8/gems/mongrel-0.3.13.4/lib/mongrel.rb:686:in `run'' /usr/local/lib/ruby/gems/1.8/gems/mongrel-0.3.13.4/lib/mongrel.rb:673:in `run'' /usr/local/lib/ruby/gems/1.8/gems/mongrel-0.3.13.4/lib/mongrel/configurator.rb:267:in `run'' /usr/local/lib/ruby/gems/1.8/gems/mongrel-0.3.13.4/lib/mongrel/configurator.rb:266:in `run'' /usr/local/lib/ruby/gems/1.8/gems/mongrel-0.3.13.4/bin/mongrel_rails:127:in `run'' /usr/local/lib/ruby/gems/1.8/gems/mongrel-0.3.13.4/lib/mongrel/command.rb:211:in `run'' /usr/local/lib/ruby/gems/1.8/gems/mongrel-0.3.13.4/bin/mongrel_rails:231 /usr/local/bin/mongrel_rails:18 ######################## Is there some kind of problem on the mysql connection? Any hints welcomed. Thanks, Massimo
Dont know if this is related but you might want to install the mysql gem, and use the native driver instead of the ruby one. $sudo gem install mysql Should be faster too. Zsombor -- Company - http://primalgrasp.com Thoughts - http://deezsombor.blogspot.com
Thanks for the hint. I''ll try immediately, Massimo Dee Zsombor wrote:>Dont know if this is related but you might want to install the mysql gem, >and use the native driver instead of the ruby one. > >$sudo gem install mysql > >Should be faster too. > >Zsombor > >
I finally solved the problem. I will recap for future memory: I have installed Ruby 1.8.4 + Rails 1.1.6 + Mongrel 0.3.13.4 on a Linux Box - Centos 4.4 - Apache 2.0.59 with proxy pass to a single Mongrel task ( no cluster ). Everything worked just fine... but after 10/12 hours the mongrel process hanged up, both passing trough apache or calling directly the process. The site had practically no traffic - it was a demo installation. Trying to kill the process ''nicely'': mongrel_rails mongrel::stop didn''t stop the process, with the command line reporting there was non mongrel.pid file, actually once the file wasn''t really there but all the other times the file was present. You had to kill the process in a less more graceful manner ( kill -9 ... ) and everything started again running. After a couple of days of killing dead mongrel process, help form this list, and looking around in the debugging outputs I finally found this ruby trace that gave me some hints ( this trace appears regularly when you killed the hanging process ) and the problem was related to a mysql connection hanging. Mongrel::TimeoutError (Mongrel timed out this thread: shutdown): /usr/local/lib/ruby/gems/1.8/gems/mongrel-0.3.13.4/lib/mongrel.rb:637:in `write'' /usr/local/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/vendor/mysql.rb:517:in `write'' /usr/local/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/vendor/mysql.rb:491:in `command'' /usr/local/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/vendor/mysql.rb:223:in `close'' /usr/local/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/connection_adapters/mysql_adapter.rb:168:in `disconnect!'' /usr/local/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/connection_adapters/mysql_adapter.rb:163:in `reconnect!'' /usr/local/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/connection_adapters/abstract_adapter.rb:85:in `verify!'' /usr/local/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/connection_adapters/abstract/connection_specification.rb:99:in `verify_active_connections!'' /usr/local/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/connection_adapters/abstract/connection_specification.r b:98:in `verify_active_connections!'' /usr/local/lib/ruby/gems/1.8/gems/rails-1.1.6/lib/dispatcher.rb:70:in `prepare_application'' /usr/local/lib/ruby/gems/1.8/gems/rails-1.1.6/lib/dispatcher.rb:37:in `dispatch'' /usr/local/lib/ruby/gems/1.8/gems/mongrel-0.3.13.4/lib/mongrel/rails.rb:84:in `process'' /usr/local/lib/ruby/1.8/sync.rb:229:in `synchronize'' /usr/local/lib/ruby/gems/1.8/gems/mongrel-0.3.13.4/lib/mongrel/rails.rb:83:in `process'' /usr/local/lib/ruby/gems/1.8/gems/mongrel-0.3.13.4/lib/mongrel.rb:580:in `process_client'' /usr/local/lib/ruby/gems/1.8/gems/mongrel-0.3.13.4/lib/mongrel.rb:579:in `process_client'' /usr/local/lib/ruby/gems/1.8/gems/mongrel-0.3.13.4/lib/mongrel.rb:686:in `run'' /usr/local/lib/ruby/gems/1.8/gems/mongrel-0.3.13.4/lib/mongrel.rb:686:in `run'' /usr/local/lib/ruby/gems/1.8/gems/mongrel-0.3.13.4/lib/mongrel.rb:673:in `run'' /usr/local/lib/ruby/gems/1.8/gems/mongrel-0.3.13.4/lib/mongrel/configurator.rb:267:in `run'' /usr/local/lib/ruby/gems/1.8/gems/mongrel-0.3.13.4/lib/mongrel/configurator.rb:266:in `run'' /usr/local/lib/ruby/gems/1.8/gems/mongrel-0.3.13.4/bin/mongrel_rails:127:in `run'' /usr/local/lib/ruby/gems/1.8/gems/mongrel-0.3.13.4/lib/mongrel/command.rb:211:in `run'' /usr/local/lib/ruby/gems/1.8/gems/mongrel-0.3.13.4/bin/mongrel_rails:231 /usr/local/bin/mongrel_rails:18 After suggestion on this list to install the mysql gem, and use the native driver instead of the ruby one. I finally manged to solve the problem - the site is running from about 72hours without a glitch. Thanks to everybody Massimo