Sidekiq: Long running jobs

Created on 5 Dec 2017  路  2Comments  路  Source: mperham/sidekiq

Is there a timeout for Sidekiq job?

We have some long running jobs (pull data from an external source via API) -- we loop through & batch until we run into rate limit and then restart that job later based on delay time in the header.

Also, is it advisable to use Sidekiq for such long-running jobs?

Most helpful comment

Is there a timeout for Sidekiq job?

No

then restart that job later based on delay time in the header

Does "restart" mean something like self.class.perform_in(10.minutes, args)? Because rescheduling the job to run later should work well.

is it advisable to use Sidekiq for such long-running jobs?

Sidekiq is designed to run quick jobs. Many people use it for long-running jobs with some success, but troubleshooting problems with long-running jobs is hard.

I suggest breaking down your work into multiple Sidekiq worker classes. Enqueue "children" jobs for each item in an API response, for instance.

All 2 comments

Is there a timeout for Sidekiq job?

No

then restart that job later based on delay time in the header

Does "restart" mean something like self.class.perform_in(10.minutes, args)? Because rescheduling the job to run later should work well.

is it advisable to use Sidekiq for such long-running jobs?

Sidekiq is designed to run quick jobs. Many people use it for long-running jobs with some success, but troubleshooting problems with long-running jobs is hard.

I suggest breaking down your work into multiple Sidekiq worker classes. Enqueue "children" jobs for each item in an API response, for instance.

@mikegee Thanks for your quick response 馃憣

Was this page helpful?
0 / 5 - 0 ratings

Related issues

HenleyChiu picture HenleyChiu  路  4Comments

smanolloff picture smanolloff  路  3Comments

sandstrom picture sandstrom  路  3Comments

davidcelis picture davidcelis  路  3Comments

fatcatt316 picture fatcatt316  路  4Comments