# File descriptor leak in Mongrel server?

**URL:** <https://www.ruby-forum.com/t/file-descriptor-leak-in-mongrel-server/159087>\
**Category:** Rails\
**Created:** [January 31, 2009, 12:50pm UTC](https://www.ruby-forum.com/t/file-descriptor-leak-in-mongrel-server/159087 "2009-01-31T12:50:21Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![psujohn](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/f6c823/32.png) [@psujohn](https://www.ruby-forum.com/u/psujohn)\
**Post date:** [January 31, 2009, 12:50pm UTC](https://www.ruby-forum.com/t/file-descriptor-leak-in-mongrel-server/159087/1 "2009-01-31T12:50:21Z")

</div>

Excuse my ignorance for I’m a RoR newby.

We have a number of RoR applications running on a server with a cPanel  
installation. One of the clients sites went belly up with the error  
message:  
Errno::EMFILE  
Too many open files - socket(2)

Digging a bit I found that the mongrel server had a large number of  
sockets open and appears to be leaking them fairly frequently. The  
lsof looks like this

mongrel\_r 11184 username 193u unix 0xda4fa480 637209350  
socket  
mongrel\_r 11184 username 194u unix 0xf685a680 637408911  
socket  
mongrel\_r 11184 username 195u unix 0xcc2ea3c0 637684747  
socket

The application doesn’t do anything explicitly with sockets. As far as  
I know the RoR installation is standard - from what I understand the  
hosting company support installed it and RoR is only semi-supported by  
cPanel so they’re somewhat reluctant/lack the knowledge to be of much  
assistance?

I did google searches of every combination of ruby/rails/socket/leak/  
cPanel/file descriptor/etc that I could think of and didn’t find  
anything. I’m not exactly sure of what versions of ruby/rails/mongrel  
we have installed but didn’t find anything about this being a known  
issue that had been fixed. I’d warrant a guess that we’re not running  
the bleeding edge at any rate and are likely a few versions behind but  
again I’m not entirely sure how ruby is installed/managed under cPanel/  
WHM.

Any ideas on where to look further or what the issue could be?
