Project

General

Profile

Too many open files - socket(2)

Added by Lennart K almost 16 years ago

Hi there,
a couple of days ago I had the problem that almost every page request lead to an "500 Internal Server Error". The log file told me

Processing IssuesController#index (for 212.1.47.60 at 2008-07-08 20:56:26) [GET]
  Session ID: 4f38c6986317ad92d80878bbad49af87
  Parameters: {"format"=>"atom", "action"=>"index", "controller"=>"issues", "key"=>"NPP8j7oAwhAk8PE2qPrRZ8fgtfOAOmJXHFcXDkGi"}
Rendering common/feed.atom.rxml
Completed in 0.11736 (8 reqs/sec) | Rendering: 0.05667 (48%) | DB: 0.00000 (0%) | 200 OK [http://xyz.com/issues?format=atom&key=NPP8j7oAwhAk8PE2qPrRZ8fgtfOAOmJXHFcXDkGi]
/!\ FAILSAFE /!\  Tue Jul 08 21:26:26 +0200 2008
  Status: 500 Internal Server Error
  Too many open files - /var/httpd/servers/xyz.com/htdocs/tmp/sessions//ruby_sess.4c5a91425c41324c.tmp
    /opt/ruby-1.8.6/lib/ruby/1.8/pstore.rb:332:in `initialize'
    /opt/ruby-1.8.6/lib/ruby/1.8/pstore.rb:332:in `open'
    /opt/ruby-1.8.6/lib/ruby/1.8/pstore.rb:332:in `transaction'
    /var/httpd/servers/xyz.com/htdocs/vendor/rails/actionpack/lib/action_controller/cgi_ext/session.rb:67:in `initialize'
    /opt/ruby-1.8.6/lib/ruby/1.8/cgi/session.rb:273:in `new'
    /opt/ruby-1.8.6/lib/ruby/1.8/cgi/session.rb:273:in `initialize_without_cgi_reader'
    /var/httpd/servers/xyz.com/htdocs/vendor/rails/actionpack/lib/action_controller/cgi_ext/session.rb:39:in `initialize'
    /var/httpd/servers/xyz.com/htdocs/vendor/rails/actionpack/lib/action_controller/cgi_process.rb:130:in `new'
    /var/httpd/servers/xyz.com/htdocs/vendor/rails/actionpack/lib/action_controller/cgi_process.rb:130:in `session'
    /var/httpd/servers/xyz.com/htdocs/vendor/rails/actionpack/lib/action_controller/cgi_process.rb:166:in `stale_session_check!'
    /var/httpd/servers/xyz.com/htdocs/vendor/rails/actionpack/lib/action_controller/cgi_process.rb:114:in `session'
    /var/httpd/servers/xyz.com/htdocs/vendor/rails/actionpack/lib/action_controller/base.rb:1131:in `assign_shortcuts_without_flash'
    /var/httpd/servers/xyz.com/htdocs/vendor/rails/actionpack/lib/action_controller/flash.rb:167:in `assign_shortcuts'
    /var/httpd/servers/xyz.com/htdocs/vendor/rails/actionpack/lib/action_controller/base.rb:518:in `process_without_filters'
    /var/httpd/servers/xyz.com/htdocs/vendor/rails/actionpack/lib/action_controller/filters.rb:685:in `process_without_session_management_support'
    /var/httpd/servers/xyz.com/htdocs/vendor/rails/actionpack/lib/action_controller/session_management.rb:123:in `process'
    /var/httpd/servers/xyz.com/htdocs/vendor/rails/actionpack/lib/action_controller/base.rb:388:in `process'
    /var/httpd/servers/xyz.com/htdocs/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:171:in `handle_request'
    /var/httpd/servers/xyz.com/htdocs/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:115:in `dispatch'
    /var/httpd/servers/xyz.com/htdocs/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:126:in `dispatch_cgi'
    /var/httpd/servers/xyz.com/htdocs/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:9:in `dispatch'
    /opt/ruby-1.8.6/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/rails.rb:76:in `process'
    /opt/ruby-1.8.6/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/rails.rb:74:in `synchronize'
    /opt/ruby-1.8.6/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/rails.rb:74:in `process'
    /opt/ruby-1.8.6/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel.rb:159:in `process_client'
    /opt/ruby-1.8.6/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel.rb:158:in `each'
    /opt/ruby-1.8.6/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel.rb:158:in `process_client'
    /opt/ruby-1.8.6/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel.rb:285:in `run'
    /opt/ruby-1.8.6/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel.rb:285:in `initialize'
    /opt/ruby-1.8.6/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel.rb:285:in `new'
    /opt/ruby-1.8.6/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel.rb:285:in `run'
    /opt/ruby-1.8.6/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel.rb:268:in `initialize'
    /opt/ruby-1.8.6/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel.rb:268:in `new'
    /opt/ruby-1.8.6/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel.rb:268:in `run'
    /opt/ruby-1.8.6/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/configurator.rb:282:in `run'
    /opt/ruby-1.8.6/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/configurator.rb:281:in `each'
    /opt/ruby-1.8.6/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/configurator.rb:281:in `run'
    /opt/ruby-1.8.6/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/mongrel_rails:128:in `run'
    /opt/ruby-1.8.6/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/command.rb:212:in `run'
    /opt/ruby-1.8.6/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/mongrel_rails:281
    /opt/ruby/bin/mongrel_rails:16:in `load'
    /opt/ruby/bin/mongrel_rails:16

I "fixed" the issue by restarting the mongrel-cluster, but I don't wanna wait until that happens again... any ideas? My guess would be that there's a script that does not close its connections, but I would think that one would find something about that in another thread or something... so maybe our server (which serves several pages/databases) was just too busy? But why did it help to restart the mongrel than...

Thanks a lot,
Lennart