Resque vs Sidekiq? [closed]

社会主义新天地 提交于 2019-11-26 17:56:00

问题


I am currently using Resque for my background process but recently I heard a lot of huff-buff about sidekiq. Could anybody compare/differentiate?

In particular I would like to know is there a way to monitor programmatically whether a job is completed in sidekiq


回答1:


Resque:

Pros:

  • does not require thread safety (works with pretty much any gem out there);
  • has no interpreter preference (you can use any ruby);
    Resque currently supports MRI 2.3.0 or later
  • loads of plugins.

Cons

  • runs a process per worker (uses more memory);
  • does not retry jobs (out of the box, anyway).

Sidekiq:

Pros

  • runs thread per worker (uses much less memory);
  • less forking (works faster);
  • more options out of the box.

Cons

  • [huge] requires thread-safety of your code and all dependencies. If you run thread-unsafe code with threads, you're asking for trouble;
  • works on some rubies better than others (jruby is recommended, efficiency on MRI is decreased due to GVL (global VM lock)).



回答2:


Ryan has created a webcast for Sidekiq this week which also include some comparison with Resque. You probably want to check it out:

Url: http://railscasts.com/episodes/366-sidekiq




回答3:


From the question:

In particular I would like to know is there a way to monitor programmatically whether a job is completed in sidekiq

Here's a solution for that:

  1. Sidekiq::Status gem
  2. Batch API (Sidekiq Pro) - usage


来源:https://stackoverflow.com/questions/11580954/resque-vs-sidekiq

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!