Read more

Uncaught exception in PassengerServer client thread exception: Cannot accept new connection: Too many open files

Thomas Eisenbarth
April 27, 2012Software engineer at makandra GmbH

So you probably see the following error trace within your Passenger log file if you got here:

[ pid=123 thr=1401414 file=ext/nginx/HelperAgent.cpp:964 time=2012-04-27 10:01:49.273 ]: Uncaught exception in PassengerServer client thread:
   exception: Cannot accept new connection: Too many open files (24)
   backtrace:
     in 'Passenger::FileDescriptor Client::acceptConnection()' (HelperAgent.cpp:429)
     in 'void Client::threadMain()' (HelperAgent.cpp:953)
Illustration online protection

Rails Long Term Support

Rails LTS provides security patches for old versions of Ruby on Rails (2.3, 3.2, 4.2 and 5.2)

  • Prevents you from data breaches and liability risks
  • Upgrade at your own pace
  • Works with modern Rubies
Read more Show archive.org snapshot

You can either

  1. Lower the maximum number of running Passenger instances. Use passenger_max_pool_size within nginx configuration and the PassengerMaxPoolSize directive in Apache. See [http://www.modrails.com/documentation.html] Passenger documentation for details.
  2. Increase the maximum number of open files per process. If you google around, don't get confused by the forum guys suggesting to look at cat /proc/sys/fs/file-max - this is the global maximum, an arbitrary won't be allowed to open that number of FDs. You will have to set limits within /etc/security/limits.conf in case you need that.
Posted by Thomas Eisenbarth to makandra dev (2012-04-27 10:11)