[Rails] Webrick in production?
Ben Munat
bent at munat.com
Sat Mar 4 18:04:22 GMT 2006
Zed Shaw wrote:
>>>>On Feb 27, 2006, at 9:55 PM, Ben Munat wrote:
>>>>
>>>>>So what about the mythical "mutex on each request" that WEBrick has?
>>>>
>>>>I don't know about Rails, but no such thing exists in WEBrick. (Note
>>>>that I'm not using WEBrick to serve Rails requests, I'm using it for
>>>>"image hits".)
>>>
>>>Duh... helps if I read more carefully. The passage in AWDWR is: [WEBrick
>>>is] not a particulary attractive approach for heavy-duty use. One of the
>>>reasons is the lack of thread safety in *ActionPack* (emphasis mine),
>>>which forces WEBrick to place a mutex at the gate of dynamic requests..."
>>>
>>
>>As I understand it, the mutex is in Rails, and it affects Mongrel in
>>exactly the same way that it affects WEBrick.
>>
>
>
> Yes, Mongrel has to use a "grand mutex" around the Dispatcher.dispatch in
> order to prevent Rails from going crazy. Rails just isn't thread safe.
>
> One thing you can do in both Mongrel (and WEBrick) is if there's a
> particular little part of your Rails application that needs to run very
> fast, then write a handler that runs right inside Mongrel. This then moves
> the processing out reducing the overhead and giving you full threaded
> operation (which you have to be careful of yourself).
Wow. This just took the wind out of my sails.
So, I should pretty much forget ever seeing a servlet container for rails? Sorry Zed, but
this pretty much brings me around to Eric's point of view: why bother creating Mongrel at all?
b
More information about the Rails
mailing list