Rails 实时处理后台作业
我在heroku cedar-stack 上使用了hirefire-gem 和Delayed-Job 3,它在招聘/解雇方面工作得很好,但工作执行的性能很糟糕。在本地启动后台作业并在 UI 中查看结果大约需要 5-8 秒,在 Heroku 上大约需要 25-30 秒(!)。
作业的处理时间与本地/部署的时间大致相同,但雇用工人(扩展、扩大、启动......)似乎需要很多时间(?)。
这是一个常见问题吗?有解决方案吗(rake 任务等)?
多谢。 最好的,菲尔
I use hirefire-gem with Delayed-Job 3 on heroku cedar-stack and it is working pretty good in terms of hiring/firing but performance of the job execution is terrible. firing up the background job and seeing the results in the UI takes about 5-8 seconds locally and about 25-30 seconds (!) on heroku.
Processing time of the jobs is about the same locally/deployed but hiring workers (scaling, up, starting, ...) seems to take a lot of time(?).
is that a common issue? is there a solution (rake tasks, etc.)?
Thanks a lot.
Best, Phil
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这是因为您的工作人员并不是一直在运行,而是为每项单独的工作而旋转。滞后是代码启动时间。
如果您有全职测功机,则作业几乎应该立即处理。
It's down to the fact that your worker isn't running all the time but spinning up for each individual job. The lag is the code start-up time.
If you have a full time dyno the jobs should process almost instantaneously.