[Mongrel] Mongrel spewing backtraces and nanosleeping

Jacob Atzen jacob at jacobatzen.dk
Fri Sep 15 09:02:11 EDT 2006


On Thu, Sep 14, 2006 at 10:04:56AM -0600, Kirk Haines wrote:
> On 9/14/06, Jacob Atzen <jacob at jacobatzen.dk> wrote:
> 
> > How do I get Mongrel to use Mutex?
> 
> In your mongrel/rails.rb, right at the beginning:
> 
> require 'sync'
> 
> Comment that out and add
> 
> require 'thread'
> 
> Use the thread lib I sent to you, as it should fix the problem that
> caused Zed to want to switch from Mutex to Sync in the first place.
> 
> Then, just below that, in this code:
> 
>     class RailsHandler < Mongrel::HttpHandler
>       attr_reader :files
>       attr_reader :guard
>       @@file_only_methods = ["GET","HEAD"]
> 
>       def initialize(dir, mime_map = {})
>         @files = Mongrel::DirHandler.new(dir,false)
>         @guard = Sync.new
> 
> That last line, comment it out and add:
> 
>         @guard = Mutex.new
> 
> Then try your test again and see if you can reproduce that mode of failure.

A little heads-up before the weekend, I've been running with the above
modifications and a few more to make the mutex calls run. So far I've
been processing ~28000 rails requests on a mongrel with a limit of 64
processors. I will perform further testing and supply a full diff of my
modifications early next week.

-- 
Cheers,
- Jacob Atzen


More information about the Mongrel-users mailing list