[Mongrel] Long-running pages cause mongrel time-outs

Ezra Zygmuntowicz ezmobius at gmail.com
Wed Dec 19 16:08:32 EST 2007

On Dec 19, 2007, at 9:01 AM, Steve Midgley wrote:

> At 02:42 AM 12/19/2007, mongrel-users-request at rubyforge.org wrote:
>> Message: 6
>> Date: Tue, 18 Dec 2007 12:34:54 -0600
>> From: "Mason Hale" <masonhale at gmail.com>
>> Subject: Re: [Mongrel] Long-running pages cause mongrel time-outs
>> To: mongrel-users at rubyforge.org
>> Message-ID:
>>        <8bca3aa10712181034m79968dd4he6fa91ea44e3d2d6 at mail.gmail.com>
>> Content-Type: text/plain; charset="iso-8859-1"
>> Hi Ezra --
>> I found it interesting that you recommended Bj (backgroundjobs) and
>> not
>> BackgrounDrb. I hadn't heard of Bj before, and I'll check it out.
>> Thanks for
>> the link. Given that you initiated the development BackgrounDrb, I'm
>> curious
>> when and where you would recommend Bj over BackgrounDrb.
>> Mason

	Backgroundrb and Bj serve different purposes. The new backgroundrb is  
a complete rewrite by Hemant that throws out drb and uses an event  
driven styel of programming. It really is very stable now and it's  
main focus is on doing jobs that require reporting status in your  
rails app. Like if you want to fetch some news feeds and report a  
progress bar via ajax polling in your app. Bdrb works very well for  
this and other more real time background jobs.

	Bj is a work queue. You just shove jobs into the queue which is a  
database table and the Bj daemon will run through them and call each  
job one at a time. But you can also have Bj daemons on each node in a  
cluster of servers and have them all pulling from the same queue. Bj  
jobs are just shell commands. So your actual jobs can be ruby scripts,  
shell scripts, or script/runner calls.  The main idea behind Bj is  
that you could throw 100K jobs at it and it will just do them as fast  
as it can one at a time without overwhelming the system all at once.

	So both of these tools are very solid now, they just serve different  
purposes. Backgroiundrb is more for real time jobs and status reports  
as well as having a very nice cron like scheduler for jobs.  Bj is  
more of a work queue that is persistent.

	Hope that clears things up, Both of these tools are great for  
different circumstances.

- Ezra Zygmuntowicz
-- Founder & Software Architect
-- ezra at engineyard.com
-- EngineYard.com

More information about the Mongrel-users mailing list