如何杀死 Heroku 上的 resque 工作人员?
我正在使用本指南使用 Redis http: //blog.redistogo.com/2010/07/26/resque-with-redis-to-go/
我已将其全部设置完毕,当我放置某些内容时,它会显示在我的 resque 队列中。它在 Heroku 上,所以我运行
heroku rake resque:work QUEUE=*
(in /app)
Starting the New Relic Agent.
Installed New Relic Browser Monitoring middleware
Connected to NewRelic Service at collector-1.newrelic.com:80
^C
[canceled]
This 然后完成工作,但现在工作人员仍然在那里。我现在如何删除/杀死该工作人员?
我目前有这个 0 of 4 Workersworking
我想让它在队列中的任务完成后然后工作人员就删除自己。我将如何继续执行此操作,或者是否需要调用另一个 heroku 终端命令。
resque 工作人员在 Heroku 上也需要花钱吗?我只是想手动触发我的 resque 队列中的任务。我不需要它自动完成。
I am using this guide to setup Resque with Redis http://blog.redistogo.com/2010/07/26/resque-with-redis-to-go/
I have it all set up and when I put something it shows up on my resque queue. It is on heroku so then I run
heroku rake resque:work QUEUE=*
(in /app)
Starting the New Relic Agent.
Installed New Relic Browser Monitoring middleware
Connected to NewRelic Service at collector-1.newrelic.com:80
^C
[canceled]
This then completes the job, but now the worker is still there. How do I now delete/kill the worker?
I currently have this 0 of 4 Workers Working
I want to make it so that after the tasks in the queue are completed then the worker just deletes itself. How would I go on doing this or is there another heroku terminal command I need to call.
Also do resque workers cost any money on heroku? I just want to make so I can manually trigger tasks in my resque queue. I dont need it to be doing it automatically.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
要与 Heroku Worker 集成,您需要实现一个名为 jobs:work 的 Rake 任务。要使其与 resque 一起工作,您需要将以下任务添加到 rake 文件中(取自 http://blog.redistogo.com/2010/07/26/resque-with-redis-to-go/):
在heroku上启动单个worker使用:
要关闭后台工作程序,请执行以下操作:
要使用 5 个工作程序,请执行以下操作:
Heroku 按秒为您运行的每个工作程序收费。如果您登录 Heroku,您将能够在应用程序的资源页面上查看当前的工作人员数量将花费多少费用。
To integrate with the heroku workers you need to implement a rake task called jobs:work. To get this working with resque you need to add the following task to a rake file(taken from http://blog.redistogo.com/2010/07/26/resque-with-redis-to-go/):
To start a single worker on heroku use:
To switch off background workers do:
To use 5 workers do:
Heroku charges you by the second for each worker that you run. If you log into heroku you'll be able to see how much your current number of workers will cost on the resources page for your app.
在 Heroku Cedar Stack 上,这非常简单,这是将工作人员数量更改为 n 的命令,您将运行此命令,它会杀死/创建工作人员以实现 n代码>.
有关更多详细信息,请参阅 Heroku 上的这篇文章:https://devcenter.heroku.com/articles/scaling
On the Heroku Cedar Stack this is pretty easy, this is the command to change the number of workers to
n
you would run this command, and it would kill/create workers to achieven
.See this article at Heroku for more details: https://devcenter.heroku.com/articles/scaling
您尝试过 HireFire 吗?
它是专门为放大/缩小 Heroku 上的 Resque(和延迟作业)工作人员而设计的。
Have you tried out HireFire ?
Its designed specifically to scale up/down Resque (and Delayed Job) workers on Heroku.
我知道这是一个老问题,但你可以从控制台做到这一点:
我还没有尝试过,但还有一个
I know this is an old question but you can do it from the console:
I haven't tried it yet but there's also a gem for doing this manually, sounds like you want to automate it though.