[Backgroundrb-devel] Trouble on Multi Server setup

Ron Miles ron.miles at 1000paces.com
Fri Oct 12 17:17:55 EDT 2007

Hello all,

I'm having some trouble getting backgroundrb set up so that all the
processing happens on a single machine.  I have 3 load balanced
machines.  Right now, all three run our web application and create
MiddleMan workers to generate a large PDF report.

However, because of the processing power needed to generate the PDFs,
I want to change our setup so that two servers run Apache/Mongrel
serving our web application.  The third would handle a number of other
tasks, including report generation.

I found this thread, but I can't get it to work:


In my setup, server1 will be the report server, and server2 and
server3 are the application/web servers

The backgroundrb.yml looks like this on servers 2 and 3:

port: 22223
timer-sleep: 60
load_rails: true
rails_env: production
environment: production
database_yml: config/database.yml
pool_size: 10

( is the local IP for server1)

On the report server (server1), I have this:

port: 22223
timer-sleep: 60
load_rails: true
rails_env: production
environment: production
host: localhost
database_yml: config/database.yml
pool_size: 10
protocal: druby
  :deny: all
  :allow: localhost
  :order: deny,allow

I tried commenting out "self.setup_drb_acl" in
lib/backgroundrb_server.rb, but it didn't make any difference.

Also, if I run "MiddleMan.jobs" from ./script/console on server2 or
server3, I get this:


>From server1, I get this:


This **seems** right, since the correct port and host are there.  I'm
suspicious about drbunix vs. druby though.  If change the protocol to
druby, I get connection refused errors.

DRb::DRbConnError: druby:// - #<Errno::ECONNREFUSED:
Connection refused - connect(2)>

As it I have it set up right now, all the logging appears on the web
server that accepted the request (both in backgroundrb.log and
production.log).  It seems like at least some of this should be
offloaded to the report server.  Also, if I run top on the web server,
I get 50+% processor usage when I click the link in the app to start
the process.

So I'm stumped.  Can anyone give me any pointers?  I'm not very
familiar with the technology backgroundrb is based on, so I apologize
if I'm missing something obvious.

Thanks in advance for any help

BTW, I'm using ruby 1.8.5, rails 1.2.2 and the latest backgroundrb.


More information about the Backgroundrb-devel mailing list