[Mongrel] random cpu spikes, EBADF errors

Will Green will at hotgazpacho.com
Mon Oct 29 19:18:59 EDT 2007


I disagree. As soon as you start putting code specific to other web servers in the core Mongrel, 
you'll either have to start adding it for other servers as well (thus bloating the code!), or take a 
stance on which other servers to support. I think this goes completely against Zed's originally vision.

Zed has written several times about how easy it is to create your own handler (I believe as a Gem 
plugin), and to configure Mongrel to use it. Plus, if you bundle it as a plugin, you can distribute 
it separately from the Mongrel core, so those of us who don't need it won't have to load code for 
program we choose not to run.

==
Will Green

Evan Weaver wrote:
> 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
>>
> 
> 
> 


More information about the Mongrel-users mailing list