From: Deepak Gole Date: 2008-12-15T22:28:43+09:00 Subject: Re: How to run background processes (more than 1 worker) parallely. ------=_Part_106953_4053219.1229348169182 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline Hello Robert On Sat, Dec 13, 2008 at 10:22 PM, Robert Klemme wrote: > On 12.12.2008 14:58, Deepak Gole wrote: > > My requirement is as follows >> >> 1) I have around 200 feeds in the database that I need to parse (fetch >> contents) *parallely* after some interval and store those feed items in >> database. >> >> 2) Now I am using backgroundrb with 10 workers each worker has assigned a >> job to parse data from 20 feeds (e.g 1st worker will fecth data from >> feeds(1..20), 2nd from feeds(21..30) ..etc..... >> >> 3) But backgroundrb is not reliable and it fails after some time. >> > > Can you be more specific what you really mean by this? How does it fail? > >>> Well when I start the backgroundrb processes then for next few or next 1,2 days everything works well, But after some time worker just gets hangs I can see there process ID till active. But No output. I examine logs also but didn't get anything in log files. I am not getting a single clue of what went wrong? > > > So I have >> tried Starling & Workling but those worker doesn't run *parallely. >> > > Maybe you used it not in the proper way. From what I read on the web site > doing work concurrently is all that S+W is about. > >>> I have created 2 workling workers each worker has one method which just logs the some o/p and then I ran them from console. When I examined the log files I got those o/p sequentially class MyWorker < Workling::Base def sample_one(options) 5.times do |i| logger.info "====Hi from 1st worker===============" end end end end class MySecondWorker < Workling::Base def sample_twooptions) 5.times do |i| logger.info "====Hi from 2nd worker===============" end end end end I got following o/p ====Hi from 1st worker=============== ====Hi from 1st worker=============== ====Hi from 1st worker=============== ====Hi from 1st worker=============== ====Hi from 1st worker=============== ====Hi from 2nd worker=============== ====Hi from 2nd worker=============== ====Hi from 2nd worker=============== ====Hi from 2nd worker=============== ====Hi from 2nd worker=============== I was expecting something like this ====Hi from 1st worker=============== ====Hi from 2nd worker=============== ====Hi from 1st worker=============== ====Hi from 2nd worker=============== > ........ Thanks For your help Deepak ------=_Part_106953_4053219.1229348169182--