简体   繁体   English

如何在Amazon EC2上为Rails应用程序设置延迟的作业?

[英]How to set up delayed jobs on Amazon EC2 for a Rails application?

When I need to set up the delayed job on Heroku, I need to buy there also the another worker dyno. 当我需要在Heroku上设置延迟的工作时,我还需要在那里购买另一名工人dyno。 How does it work on Amazon EC2? 它如何在Amazon EC2上工作? I am using the small EC2 instance. 我正在使用小型EC2实例。

Do I need to buy a higher instance or what is needed for successful set up of delayed job on Amazon EC2? 我是否需要购买一个更高的实例,或者在Amazon EC2上成功设置延迟工作需要什么?

Thank you 谢谢

On EC2, you're basically buying infrastructure, so it basically depends on the workload that you're having if you need a higher instance or not. 在EC2上,您基本上是在购买基础架构,因此,如果您是否需要更高的实例,它基本上取决于您所拥有的工作负载。 If you're not saturating the CPU on your current EC2 instance, all you have to do is use a gem like delayed_job ( https://rubygems.org/gems/delayed_job ) or resque ( https://rubygems.org/gems/resque ). 如果您不使当前EC2实例上的CPU饱和,您所要做的就是使用gem如delay_job( https://rubygems.org/gems/delayed_job )或resque( https://rubygems.org/gems / resque )。 Personally, I didn't need a higher EC2 instance for delayed jobs, as they didn't use up a lot of resources (also small EC2). 就我个人而言,我不需要更高的EC2实例来延迟工作,因为它们不会占用很多资源(也很小的EC2)。

First of all welcome to delayed_job club. 首先欢迎您加入延迟工作俱乐部。 I agree with the previous answer, I was running delayed_job on a ec2 micro instance. 我同意前面的答案,我在ec2微型实例上运行了delay_job。 But chances of delayed_job consuming more memory is high. 但是delay_job占用更多内存的机会很高。 I suggest you to have a separate instance for running delayed_jobs. 我建议您有一个单独的实例来运行delay_jobs。 Minimum a small instance would do. 最小的实例是最小的。 I am using https://github.com/collectiveidea/delayed_job version of delayed since 2 years. 我使用的https://github.com/collectiveidea/delayed_job版本已延迟2年。 Matured a lot over period. 在一段时间内成熟很多。 Quite stabilized compared to previous version. 与以前的版本相比相当稳定。 It also gives the web interface too. 它还提供了Web界面。

i have recently started using EC2(micro instance because its free and because i need a staging env) with delayed job for ActiveRecord. 我最近开始使用EC2(微型实例,因为它是免费的,因为我需要一个暂存环境),且ActiveRecord的工作延迟。 EC2 is same like a fresh machine with minimum configuration. EC2就像是配置最少的新机器一样。 You need to install all the necessary stuff like RVM, ruby, rubygems, git etc that you install on your local machine. 您需要安装在本地计算机上安装的所有必需的东西,例如RVM,ruby,rubygems,git等。 I am using mina deployment and have specified there to manipulate nginx, passenger and delayed_job. 我正在使用Mina部署,并已在那里指定操作Nginx,passenger和delay_job。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM