解决Heroku上的后台工作? [英] Solution for background jobs on Heroku?

查看:76
本文介绍了解决Heroku上的后台工作?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Heroku较旧的堆栈(Aspen和Bamboo)上使用了延迟作业,但是对于新的(雪松木)雪松堆栈,我想尝试更有效的方法。

I've used Delayed Job on Heroku's older stacks (Aspen and Bamboo), but with their new(ish) Cedar stack, I'd like to try something more efficient.

我正在执行的特定后台作业是对不同运营商(UPS,FedEx,USPS等)的API调用,并且我通常每小时处理数千个。

The specific background jobs I'm performing are API calls to different carriers (UPS, FedEx, USPS, etc etc) and I typically am processing thousands every hour.

我需要能够同时处理作业,以便快速通过队列。

I need to be able to process jobs concurrently to get through the queue quickly.

最重要的是,我想尝试降低成本。在以前使用延迟作业的堆栈中,我一直不得不提高工人的工时,这大大增加了我的成本。

On top of that, I'd like to try to reduce costs. On the previous stacks where I've been using Delayed Job, I keep having to crank up the Workers, which increases my costs pretty significantly.

所以,有什么好的背景

推荐答案

新的Cedar堆栈允许您使用其他类型的调度程序和工作程序,例如Resque 。您可以在雪松页面中找到有关Procfile和新堆栈的更多详细信息。

The new Cedar stack allows you to use different kind of scheduler and workers, such as Resque. You can find more details about the Procfile and the new stack in the cedar page.

还请注意,您可以根据负载轻松而自动地扩展您的工作人员。 这里是一个例子。这样,您仅在实际需要时才支付工人工资。

Also note you can easily and automatically scale your workers depending on the load. Here's an example. In this way, you will pay for a worker only when you actually need it.

这篇关于解决Heroku上的后台工作?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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