[Backgroundrb-devel] Backgroundrb with Load Balancing Rails engines

Emil Marceta emarceta at gmail.com
Fri Nov 16 07:46:25 EST 2007


Hi there,

We run several (3-4) Rails servers behind the reverse proxy / load
balancing web server serving the  single application. All Rails
instances share the same database and use the database as a session
storage. Memcached is also part of the picture.

I'm looking into using Backgroundrb for some large uploads / parsing
task that provide progress status updates (via ajax calls). Bdrb would
run on each Rails server using drbunix (domain sockets) and not on the
dedicated / shared Bdrb server.

In this scenario it is not known in which Rails engine will the status
update request land. It may or may not hit the engine where the Bdrb
worker has been created( we don't plan for session affinity nor
anything similar). As mentioned earlier the only shared component is
the database, and I was planning to introduce a 'background_jobs'
table - keyed with the worker key and storing the key in the session.
In addition to the worker key the table would have a blob data where
the updates are stored. Then the MiddleMan is basically used only for
starting the job and  the results could be read by any engine.

This looks to me as a fairly 'generic' requirement and I was wandering
whether someone had a similar requirement and what approach was taken,
whether there is something that is part of the framework already. Also
any comments / suggestions are much appreciated.

cheers,
emil


More information about the Backgroundrb-devel mailing list