[Mongrel] Mongrel error : EMFILE too many open files

Kirk Haines wyhaines at gmail.com
Mon Dec 17 12:40:50 EST 2007

On Dec 17, 2007 10:30 AM, Scott Derrick <lists at ruby-forum.com> wrote:
> Kirk Haines wrote:
> All that makes sense if
> 1.) sessions is the problem.  I upped the file handle limit to 4096 and
> now I don't get an EMFILE error from mongrel, mongrel just stops
> responding to requests...
> 2.) Mongrel and my Rails app share the same file handle limit?  I
> thought they were separate ruby apps?  Or do all Ruby apps share the
> same environment?

Mongrel is an app container.  Your Rails app runs inside the same
process as Mongrel does.  Mongrel wraps around it and provides the
facilities to get the request from the client to your app, and the
response from the app to the client.

When a Mongrel seems to be hanged, have you tried running
strace/truss/something-similar on it?

If you are on a Linux system, you'd do something like this:

strace -s8192 -v -p PID -o OUTFILE

Let it go for a few seconds, then break with ctrl-c.

In OUTFILE will be a bunch of lines containing the system calls that
were being made inside the process.
Sometimes this can give one a hint regarding where a piece of code is stuck.

Kirk Haines

More information about the Mongrel-users mailing list