Mongrel Woes

An app that we have been using in-house for about 2 years now has
decided it wants to have all sorts of issues with Mongrel dying. Could
someone please look at these log entries and offer some suggestions as
to what I might try? I’m showing two separate entries - the first
entry usually precedes the second, and the second entry is repeated
for each Mongrel that is running (they happen successively until each
Mongrel has died). This app is running on Rails 1.1.6, Ruby 1.8.5 and
Mongrel 1.1.4. Thanks!

FIRST ENTRY****
Errno::ECONNRESET (Connection reset by peer):
/usr/local/lib/ruby/gems/1.8/gems/postgres-pr-0.4.0/lib/postgres-
pr/connection.rb:86:in write' /usr/local/lib/ruby/gems/1.8/gems/postgres-pr-0.4.0/lib/postgres- pr/connection.rb:86:in<<’
/usr/local/lib/ruby/gems/1.8/gems/postgres-pr-0.4.0/lib/postgres-
pr/connection.rb:86:in query' /usr/local/lib/ruby/gems/1.8/gems/postgres-pr-0.4.0/lib/postgres- pr/postgres-compat.rb:33:inquery’
/usr/local/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/
active_record/connection_adapters/postgresql_adapter.rb:65:in
active?' /usr/local/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/ active_record/connection_adapters/abstract_adapter.rb:85:inverify!’
/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:ineach_value’
/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:inprepare_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-1.1.4/bin/../lib/mongrel/ rails.rb:76:inprocess’
/usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.4/bin/…/lib/mongrel/
rails.rb:74:in synchronize' /usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.4/bin/../lib/mongrel/ rails.rb:74:inprocess’
/usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.4/bin/…/lib/
mongrel.rb:159:in process_client' /usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.4/bin/../lib/ mongrel.rb:158:ineach’
/usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.4/bin/…/lib/
mongrel.rb:158:in process_client' /usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.4/bin/../lib/ mongrel.rb:285:inrun’
/usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.4/bin/…/lib/
mongrel.rb:285:in initialize' /usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.4/bin/../lib/ mongrel.rb:285:innew’
/usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.4/bin/…/lib/
mongrel.rb:285:in run' /usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.4/bin/../lib/ mongrel.rb:268:ininitialize’
/usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.4/bin/…/lib/
mongrel.rb:268:in new' /usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.4/bin/../lib/ mongrel.rb:268:inrun’
/usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.4/bin/…/lib/mongrel/
configurator.rb:282:in run' /usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.4/bin/../lib/mongrel/ configurator.rb:281:ineach’
/usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.4/bin/…/lib/mongrel/
configurator.rb:281:in run' /usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.4/bin/mongrel_rails: 128:inrun’
/usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.4/bin/…/lib/mongrel/
command.rb:212:in run' /usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.4/bin/mongrel_rails: 281 /usr/local/bin/mongrel_rails:18:inload’
/usr/local/bin/mongrel_rails:18

SECOND ENTRY**
Mongrel::TimeoutError (Mongrel timed out this thread: shutdown):
/usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.4/bin/…/lib/
mongrel.rb:221:in <<' /usr/local/lib/ruby/gems/1.8/gems/postgres-pr-0.4.0/lib/postgres- pr/connection.rb:86:inquery’
/usr/local/lib/ruby/gems/1.8/gems/postgres-pr-0.4.0/lib/postgres-
pr/postgres-compat.rb:33:in query' /usr/local/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/ active_record/connection_adapters/postgresql_adapter.rb:65:inactive?’
/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:inverify_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 each_value' /usr/local/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/ active_record/connection_adapters/abstract/connection_specification.rb: 98:inverify_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:indispatch’
/usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.4/bin/…/lib/mongrel/
rails.rb:76:in process' /usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.4/bin/../lib/mongrel/ rails.rb:74:insynchronize’
/usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.4/bin/…/lib/mongrel/
rails.rb:74:in process' /usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.4/bin/../lib/ mongrel.rb:159:inprocess_client’
/usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.4/bin/…/lib/
mongrel.rb:158:in each' /usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.4/bin/../lib/ mongrel.rb:158:inprocess_client’
/usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.4/bin/…/lib/
mongrel.rb:285:in run' /usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.4/bin/../lib/ mongrel.rb:285:ininitialize’
/usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.4/bin/…/lib/
mongrel.rb:285:in new' /usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.4/bin/../lib/ mongrel.rb:285:inrun’
/usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.4/bin/…/lib/
mongrel.rb:268:in initialize' /usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.4/bin/../lib/ mongrel.rb:268:innew’
/usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.4/bin/…/lib/
mongrel.rb:268:in run' /usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.4/bin/../lib/mongrel/ configurator.rb:282:inrun’
/usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.4/bin/…/lib/mongrel/
configurator.rb:281:in each' /usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.4/bin/../lib/mongrel/ configurator.rb:281:inrun’
/usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.4/bin/mongrel_rails:
128:in run' /usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.4/bin/../lib/mongrel/ command.rb:212:inrun’
/usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.4/bin/mongrel_rails:
281
/usr/local/bin/mongrel_rails:18:in `load’
/usr/local/bin/mongrel_rails:18

Hi Matt,

I would look at your postgres logs, this looks more like a problem with
Postgres than mongrel…

The ECONNREST is most likely a problem with postgres or the network
between your mongrel and postgres…not mongrel…

I would try increasing the number of connections and resources that
postgres has…

Hope this helps,
-Rama
http://myutil.com/

Matt W. wrote:

FIRST ENTRY****
active_record/connection_adapters/postgresql_adapter.rb:65:in
active_record/connection_adapters/abstract/connection_specification.rb:
rails.rb:74:in process' /usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.4/bin/../lib/ configurator.rb:282:inrun’
/usr/local/bin/mongrel_rails:18:in load' pr/postgres-compat.rb:33:inquery’
98:in each_value' rails.rb:74:insynchronize’
/usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.4/bin/…/lib/
mongrel.rb:268:in run' /usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.4/bin/mongrel_rails: 281 /usr/local/bin/mongrel_rails:18:inload’
/usr/local/bin/mongrel_rails:18


http://myutil.com/

Is there anything I can do to keep Mongrel from completely dying each
time it has a database timeout like this?

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs