delay_jobs vs resque vs beanstalkd? [英] delayed_jobs vs resque vs beanstalkd?

查看:66
本文介绍了delay_jobs vs resque vs beanstalkd?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是我的需求:

  • Enqueue_in(10.hours, ... )(DJ 语法完美.)
  • 同时增加工作人员.(Resque 或 beanstalkd 对此有好处,但 DJ 不行)
  • 每秒必须处理 100 个作业的推送和弹出.(我需要进行测试以确保,但我认为 DJ 无法处理这么多工作)

Resque 和 beanstalkd 不执行 enqueue_in.

Resque and beanstalkd don't do the enqueue_in.

有一个插件 (resque_scheduler) 可以做到这一点,但我不确定它的稳定性.

There is a plugin (resque_scheduler) that does it, but I'm not sure of how stable it is.

我们的环境在亚马逊上,他们为拥有亚马逊实例的人免费推出了 beanstalkd,这对我们来说是一个加分项,但我仍然不确定这里的最佳选择是什么.

Our enviroment is on amazon, and they rolled out the beanstalkd for free for who has amazon instances, that is a plus for us, but I'm still not sure what is the best option here.

我们运行 rails 2.3,但我们很快就会将其加速到 rails 3.0.3.

We run rails 2.3 but we are bringing it to speed to rails 3.0.3 soon.

但我最好的选择是什么?我是否错过了另一个可以更好地完成这项工作的宝石?

But what is my best choice here? Am I missing another gem that does this job better?

我觉得我现在唯一可行的选择是 resque_scheduler.

I feel my only option that actually works now is the resque_scheduler.

Sidekiq (https://github.com/mperham/sidekiq) 是另一个您应该选择的选项看看吧.

Sidekiq (https://github.com/mperham/sidekiq) is another option that you should check it out.

推荐答案

对于我的项目,我会对 collectiveidea 感到非常舒服/delayed_job 在 rails2 和 3 中.我不知道 beanstalkd,但我很快就会尝试:-).我已遵循 resque 文档中的建议.我会举报的.

For my projects I will feel very comfortbale with collectiveidea/delayed_job in rails2 and 3. I don't know beanstalkd, but i will try it soon :-). I have followed the suggestions in the resque documentation. I will report it.

Resque vs DelayedJob

Resque 与 DelayedJob 相比如何,为什么您会选择其中之一?

How does Resque compare to DelayedJob, and why would you choose one over the other?

  • Resque 支持多队列
  • DelayedJob 支持更细粒度的优先级
  • Resque Worker 可以抵御内存泄漏/膨胀
  • DelayedJob Worker 非常简单且易于修改
  • Resque 需要 Redis
  • DelayedJob 需要 ActiveRecord
  • Resque 只能将 JSONable Ruby 对象作为参数放置在队列中
  • DelayedJob 可以将任何 Ruby 对象作为参数放置在其队列中
  • Resque 包含一个 Sinatra 应用程序,用于监控正在发生的事情
  • 如果您想添加接口,可以从 Rails 应用程序中查询 DelayedJob

如果你在做 Rails 开发,你已经有了一个数据库和 ActiveRecord.DelayedJob 非常容易设置并且效果很好.GitHub 使用它数月来处理了近 2 亿个作业.

If you're doing Rails development, you already have a database and ActiveRecord. DelayedJob is super easy to setup and works great. GitHub used it for many months to process almost 200 million jobs.

在以下情况下选择 Resque:

Choose Resque if:

  • 您需要多个队列
  • 你不在乎/不喜欢数字优先级
  • 你永远不需要持久化每个 Ruby 对象
  • 您可能需要排队
  • 你想看看发生了什么
  • 你期待很多失败/混乱
  • 您可以设置Redis
  • 您的 RAM 并不短缺

在以下情况下选择 DelayedJob:

Choose DelayedJob if:

  • 你喜欢数字优先级
  • 您并不是每天都在做大量的工作
  • 您的队列保持小而灵活
  • 没有很多失败/混乱
  • 您想轻松地向队列中扔任何东西
  • 您不想设置 Redis

在以下情况下选择 Beanstalkd:

Choose Beanstalkd if:

  • 你喜欢数字优先级
  • 你想要极快的队列
  • 你不想浪费内存
  • 您希望为大量工作提供服务
  • 您可以将队列中的 JSONable Ruby 对象用作参数
  • 您需要多个队列

Resque 绝不是更好"的 DelayedJob,因此请确保选择最适合您的应用的工具.

In no way is Resque a "better" DelayedJob, so make sure you pick the tool that's best for your app.

一个不错的队列后端速度的比较:

                 enqueue                work
-------------------------------------------------
delayed job |   200 jobs/sec     120 jobs/sec
resque      |  3800 jobs/sec     300 jobs/sec
rabbitmq    |  2500 jobs/sec    1300 jobs/sec
beanstalk   |  9000 jobs/sec    5200 jobs/sec

祝您有美好的一天!

附言有一个关于 resque 的 RailsCast,延迟作业(修订版本)和Beanstakld.看看!

P.S. There is a RailsCast about resque, Delayed Job (revised version) and Beanstakld. Have a look!

P.P.S.我最喜欢的 choiche 现在是 Sidekiq(对于简单的工作非常简单、快速和高效),看看此页面进行比较.

P.P.S. My favourite choiche is now Sidekiq ( very Simple, Fast and efficient for simple jobs ), have a look at this page for comparison.

这篇关于delay_jobs vs resque vs beanstalkd?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆