[Mongrel] random cpu spikes, EBADF errors

Evan Weaver evan at cloudbur.st
Mon Oct 29 17:43:59 EDT 2007


Perhaps you are exhausting the number of worker threads in the queue
available to mongrel (default 900ish I think). If your cached files
are very big, maybe they aren't being served quickly enough by the
DirHandler and your queue becomes clogged.

Should mongrel definitely send 503 after this state, or not? I think
there was some debate recently about the same issue and the resolution
was inconclusive.

Does Litespeed support x-sendfile? Maybe the DirHandler should be
updated to take advantage of that.

Evan

On Oct 29, 2007 4:27 PM, Robert Mela <rob at robmela.com> wrote:
>  > When mongrel was working, it should send the reply back to LSWS
> before closing the socket.
>
> There's a string prepared for the purpose in mongre.rb
>
>     ERROR_503_RESPONSE="HTTP/1.1 503 Service Unavailable\r\n\r\nBUSY".freeze
>
> It's a one-liner to send that to the socket before calling close.
>
>
> Zachary Powell wrote:
> > Hi All,
> >
> > Follow up to the CPU/EBADF issue I was having with lsws:
> >
> >
> > http://www.litespeedtech.com/support/forum/showthread.php?t=1012&goto=newpost
> > <http://www.litespeedtech.com/support/forum/showthread.php?t=1012&goto=newpost>
> > Here is the message that has just been posted:
> > ***************
> > The problem is on mongrel side. As shown in the strace output, file
> > handle 5 is the reverse proxy connection from LSWS to mongrel. Mongrel
> > read the request, then it closed the connection immediately without
> > sending back anything, then try to close it again with result EBADF,
> > because the file descriptor has been closed already.
> >
> > When mongrel was working, it should send the reply back to LSWS before
> > closing the socket.
> >
> > The root cause of the problem is on Mongrel side, however, LSWS should
> > fail the request after a few retries. We will implement that in our
> > 3.3 release.
> > ***************
> >
> >
> > Zach
>
>
> _______________________________________________
> Mongrel-users mailing list
> Mongrel-users at rubyforge.org
> http://rubyforge.org/mailman/listinfo/mongrel-users
>



-- 
Evan Weaver
Cloudburst, LLC


More information about the Mongrel-users mailing list