rails 2 and slow external services

ghazel at gmail.com ghazel at gmail.com
Mon Dec 13 15:40:48 EST 2010

On Mon, Dec 13, 2010 at 2:39 AM, Eric Wong <normalperson at yhbt.net> wrote:
> ghazel at gmail.com wrote:
>> Hi,
>> Some of my page loads (currently serviced by Unicorn) spend a great
>> deal of time waiting for external services (OpenID, OAuth, etc over
>> Net::HTTP and curb), so I'm looking at Rainbows!. I use Rails 2.3.10.
>> Which concurrency model in Rainbows! is best suited for this sort of
>> page? I'm not totally clear on which parts if any of Rails are
>> thread-safe.
> Hi, if you want compatibility over the greatest number of existing Gems,
> then ThreadSpawn and ThreadPool are the safest options.
> I'm fairly certain Rails 2.3 (or even 2.2) are _advertised_ as
> thread-safe but I've never tested it heavily.  Hopefully other folks can
> give some feedback here.
> If you're running Ruby 1.9, then RevThreadSpawn and RevThreadPool should
> be good options if you do heavy keepalive, too, but they're a bit iffy
> under 1.8 due to incompatibilities with libev and the MRI 1.8 threading
> model.

This is Ruby 1.8.7 (REE). Is there any interesting difference between
ThreadPool and ThreadSpawn in this environment?

I also make use of a (heavily modified, which is another topic) OobGC.
Does anyone know if garbage collection in ruby 1.8.7 is reasonably
threadable? I expect not, but one can hope.


More information about the rainbows-talk mailing list