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:
http://rubyforge.org/pipermail/backgroundrb-devel/2006-December/000576.html
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
host: 172.16.0.1
database_yml: config/database.yml
pool_size: 10
(172.16.0.1 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 127.0.0.1 172.16.0.1 172.16.0.2
: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:
#<DRb::DRbObject:0x41b3f240
@uri="drbunix:///tmp/backgroundrbunix_172.16.0.3_22223",
@ref=542952540>
>From server1, I get this:
#<DRb::DRbObject:0xb69ee894
@uri="drbunix:///tmp/backgroundrbunix_localhost_2000",
@ref=-610099128>
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://172.16.0.3:22223 - #<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.
-Ron