Heroku上的一个自动缩放web dynos如何? [英] How does one autoscale web dynos on Heroku?

查看:137
本文介绍了Heroku上的一个自动缩放web dynos如何?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用Heroku时,如果需要, AUTO 如何根据Web dynos进行扩展?假设我们每2-3分钟就有100个并发用户激增。如果我们的应用程序停留在5-6个Web dynos上。



第二,我无法监控24小时的流量,以确定是否需要放大或缩小。



到目前为止,我已经看过 http://hirefireapp.com/ http://www.heroscale.com/
有关这两方面的建议?

解决方案

heroku原本不这样做的原因是,这是一个难以置信的复杂问题需要解决。例如,假设你的情况如上,你突然开始看到一个队列正在形成,并且想要增加动力。你还有十个曲柄。然而,这不是一个动态的问题,你的数据库运行缓慢,所以现在你已经有更多的动态链接等待数据库,现在有更多的需求。



虽然有自动缩放产品,但我还没有尝试过其中的任何产品,并且完全相信目前只有人类可以对缩放进行正确调用。您的里程可能会有所不同。



过去我发现将资源设置为预期使用级别(可能高于当前使用级别)往往效果最佳,排除大量的流量涌入(例如黑客新闻等)

With Heroku, how does one AUTO scale up in terms of web dynos when it is needed? Say we get a surge of 100 concurrent users every 2-3 minutes. If our app is stuck on 5-6 web dynos. We are screwed.

Second, I wouldn't be able to monitor traffic 24 hours to determine whether a scale up or down is required.

So far, I've seen http://hirefireapp.com/ and http://www.heroscale.com/ Any suggestions about these two?

解决方案

The reason heroku don't do this natively is that it's an incredibly complex problem to solve.

For instance, imagine your scenario above, you suddenly start seeing a queue forming and want to ramp the dynos. You crank on ten more. However, it's not a dyno problem, your database is running slow, so now you've got more dynos all sat waiting for the database which now has even more demand placed on it.

Whilst there are auto-scaling products out there, I've not tried any of them, and fully believe that at the moment only a human can make the correct call on scaling. Your mileage may vary.

I have found in the past that setting the resources to an expected usage level (which may be above the current usage) tends to work best, excluding massive traffic influx (such as being on Hacker News etc)

这篇关于Heroku上的一个自动缩放web dynos如何?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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