[Backgroundrb-devel] Multiple deployments of same application using backgroundrb

hemant kumar gethemant at gmail.com
Tue Mar 11 21:16:02 EDT 2008


Hi,

First of all really sorry for late reply.

On Sun, 2008-03-09 at 10:59 -0500, Diego Camacho wrote:
> Thanks for this great app. I am having some problems configuring it in
> my server. I have a single app deployed three times, one is for
> testing, one is for demoing and the other one is for production.
> 
> 
> I read that it was unnecesary and it will not work to have multiple
> instances of backgroundrb for each of my deployments. I read that it
> was enough to instantiate backgroundrb only once from one of the
> deployments and the other deployments should use the workers on the
> deployment where backgroundrb was started. I have been not been able
> to do this. If I request a worker from a deployment that is not
> hosting the workers, I get errors in the worker. I am just able to use
> the workers by restarting the mongrel cluster that handles the
> deployment and by restarting backgroundrb in the deployment I want to
> use the worker.

You can do this if you are using same backgroundrb.yml file across all
deployments and assuming BackgrounDRb server is accessible from all
deployed machines. Are you using same config file?

> 
> 
> As a note, the worker is receiving a ActiveRecord object as a
> parameter and the error seem to be coming from there. I am getting
> undefined methods in the activerecord inside the worker.
> 

By default, You can't pass AR objects as arguments, however if you put following in your backgroundrb.yml file you can do that:

---
:backgroundrb:
  :port: 11006
  :ip: localhost
  :environment: production
  :lazy_load: false

Putting lazy_load as false will make sure that your models are loaded even in master process.






> 



More information about the Backgroundrb-devel mailing list