问题
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.
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.
So, what's a good background job solution for me on Heroku?
回答1:
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.
回答2:
Using Unicorn to run several worker processes on one Dyno can boost concurrency whilst reducing the overall number of workers required. Usually around 3 - 4 unicorn workers per dyno gives the best performance.
来源:https://stackoverflow.com/questions/7407359/solution-for-background-jobs-on-heroku