Rubytastic
Rubytastic

Reputation: 15501

make resque workers more instant responding? guidelines for configuration

Im using resque to have some jobs running in the background, a client ( user ) initiates these by doing an action on the web app in there browser.

The problem is it takes several seconds for the action to be triggered. How could one speed it up ? I need resque to respond more instant.

IM using all default setup and config nothing modified. Are there any guidelines for configuration or suggestions out of the field to make resque response faster?

Im running with 1 worker and low queues like 1,2 at a time.

Upvotes: 2

Views: 1315

Answers (1)

mind.blank
mind.blank

Reputation: 4880

Resque workers check the queue every 5 seconds by default, taken from the Resque page on Github:

start
loop do
  if job = reserve
    job.process
  else
    sleep 5 # Polling frequency = 5 
  end
end
shutdown

Under "Polling frequency" it then says:

You can pass an INTERVAL option which is a float representing the polling frequency.
The default is 5 seconds, but for a semi-active app you may want to use a smaller value.

$ INTERVAL=0.1 QUEUE=file_serve rake environment resque:work

Also you could have a look at something like beanstalkd instead, you can watch this railscast about it.

Upvotes: 5

Related Questions