Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4032108
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T11:40:48+00:00 2026-05-20T11:40:48+00:00

I have a Resque Job backed by ActiveRecord that saves a post message to

  • 0

I have a Resque Job backed by ActiveRecord that saves a post message to the database.
Have 7 worker instances running. I send 20K records to my sinatra application.
When i query the redis database, i see the following results…

redis> get resque:stat:processed:localhost:6929:default
"5696"
redis> get resque:stat:processed:localhost:6930:default
"1"
redis> get resque:stat:processed:localhost:6942:default
"1"
redis> get resque:stat:processed:localhost:6953:default
"10854"
redis> get resque:stat:processed:localhost:6959:default
"3446"
redis> get resque:stat:processed:localhost:6972:default
"1"
redis> get resque:stat:processed:localhost:6986:default
"1"

can anyone comment on it please?
4 of the 7 workers only processed 1 job each in their lifetime

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T11:40:49+00:00Added an answer on May 20, 2026 at 11:40 am

    Finally figured it out when i replaced ActiveRecord with RDBI. I was getting the following error when my workers were trying to connect to the oracle database

    java.sql.SQLRecoverableException: I/O Exception: Connection reset
    at oracle.jdbc.driver.SQLStateMapping.newSQLException(SQLStateMapping.java:281)
    at oracle.jdbc.driver.DatabaseError.newSQLException(DatabaseError.java:118)
    at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:224)
    

    After googling, i stumbled upon this post http://kr.forums.oracle.com/forums/thread.jspa?messageID=3793101 . So, i decided to pass the -Djava.security.egd=file:///dev/urandom option to my jvm. I edited the settings in glassfish’s jvm options, but that did not work as those settings benefited my sinatra app but not the resque workers running in the background.

    So, i had to start the resque workers by passing the jvm argument. I wrote a rake task to do the same.

    desc "Start multiple workers for JRUBY production environment which ocnnects to oracle database"
    task :start_workers => :setup do
    
    threads = []
    
    ENV['COUNT'].to_i.times do
      threads << Thread.new do
        system "/usr/bin/java -Djdk.home= -Djava.security.egd=file:///dev/urandom -Djruby.home=/usr/local/rvm/rubies/jruby-1.6.0 -Djruby.script=jruby -Djruby.shell=/bin/bash -Djffi.boot.library.path=/usr/local/rvm/rubies/jruby-1.6.0/lib/native/ppc-Linux:/usr/local/rvm/rubies/jruby-1.6.0/lib/native/i386-Linux:/usr/local/rvm/rubies/jruby-1.6.0/lib/native/x86_64-Linux -Xmx500m -Xss1024k -Djruby.memory.max=500m -Djruby.stack.max=1024k -Dsun.java.command=org.jruby.Main -Djava.class.path=/usr/local/rvm/rubies/jruby-1.6.0/lib/mysql-connector-java-5.0.6-bin.jar:/usr/local/rvm/rubies/jruby-1.6.0/lib/ojdbc6.jar:/usr/local/rvm/rubies/jruby-1.6.0/lib/sqlitejdbc-v056.jar: -Xbootclasspath/a:/usr/local/rvm/rubies/jruby-1.6.0/lib/jruby.jar org/jruby/Main /usr/local/rvm/gems/jruby-1.6.0/bin/rake resque:work RACK_ENV=#{ENV['RACK_ENV']} QUEUE=#{ENV['QUEUE']} INTERVAL=#{ENV['INTERVAL']}"
      end
    end
    
    threads.each { |thread| thread.join }
    
    end
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an app that sets creates EC2 instances - I have a resque
I have site running rails application and resque workers running in production mode, on
I have an error handling method in my ApplicationController: rescue_from ActiveRecord::RecordNotFound, :with => :not_found
We have to use delayed_job (or some other background-job processor) to run jobs in
I'm using Rails with resque. The sleep time is the seconds of a worker
I have a Rails 2.3.5 project that uses the localization features of Rails. I
I want to have an ability to set a custom message in a model
I have a project that adds elements to an AutoCad drawing. I noticed that
I have a script that appends some rows to a table. One of the
I have a new web app that is packaged as a WAR as part

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.