Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Long-running Sidekiq jobs keep dying

I'm using the sidekiq gem to process background jobs in Rails. For some reason, the job just hang after a while -- the process either becomes unresponsive, showing up on top but not much else, or mysteriously vanishes, without errors (nothing is reported to airbrake.io).

Has anyone had experience with this?

like image 557
Avishai Avatar asked Jul 01 '12 07:07

Avishai


People also ask

Is Sidekiq reliable?

Sidekiq does its best to never lose jobs but it can't guarantee it; the only way to guarantee job durability is to not remove it from Redis until it is complete. For instance, if Sidekiq is restarted mid-job, it will try to push the unfinished jobs back to Redis but networking issues can prevent this.

How many jobs can Sidekiq handle?

Today Sidekiq uses a default concurrency of 25. These means Sidekiq will spawn 25 worker threads and execute up to 25 jobs concurrently in a process.

Is Sidekiq a FIFO?

Sidekiq reads jobs from a Redis queue, using the First In First Out (FIFO) model, to process jobs.

Should I use Activejob Sidekiq?

If you build a web application you should minimize the amount of time spent responding to every user; a fast website means a happy user.


1 Answers

Use the TTIN signal to get a backtrace of all threads in the process so you can figure out where the workers are stuck.

https://github.com/mperham/sidekiq/wiki/Signals

like image 69
Mike Perham Avatar answered Oct 13 '22 06:10

Mike Perham