离开 Heroku 后我会看到速度变化吗?
我们正在使用 Heroku。这很棒。我喜欢它。我们每个月在实例和数据库之间花费数千美元,并且通常非常高兴。然而,我们正在确定一个新项目的范围,该项目要求我们达到非常激进的延迟目标——低于 100 毫秒。
目前,根据 new-relic 的测量,我们的 Rails 3 应用程序 80-90% 的请求处理时间都在 100 毫秒以下。鉴于我们必须从客户端的角度达到延迟目标,我将再将成功率降低 10%(从而降低到大约 3/4 的请求)。
是的,Heroku 上偶尔会出现网络故障,这可能会导致延迟,但至少在短期内,我们可以将我们的成功与 Heroku 联系起来。
如果我们希望 95% 的请求达到 100 毫秒的延迟目标,我会看到 3 个选项:
- a 优化 Heroku 中当前的 Rails 堆栈
- b 直接迁移到 AWS 或其他托管提供商
- c 将功能重建为我认为更有信心可以实现的功能延迟目标。可能是Java。
a 显然是主要候选者,但我已经摘下了容易实现的目标。 c 可能肯定是最有可能成功的,但也花费了最多的工作(今天的大多数工程师来自 Java,所以我们没有任何 Ruby->Java 的惩罚)。但 b 是一匹黑马,它可能会很好,也可能会更糟——如果不尝试和负载测试,我不知道如何判断,但是,基本上就是这样做,看看它是否是成功的。
我试图在他们之间做出决定,或者找到一种方法在他们之间做出决定。有什么建议吗?经验?
*我们的大多数请求不需要我们渲染 html。
We're using Heroku. It's great. I love it. We spend a few thousand a month on it, between instances and databases, and generally couldn't be happier. However, we're scoping a new project that would require us to hit pretty aggressive latency targets -- sub 100ms.
Currently, we're a Rails 3 app processing between 80-90% of our requests sub 100ms, as measured by new-relic. Given that we have to hit the latency target from the client's perspective, I'm going to fudge another 10% hit to that success rate (thus down to about 3/4 of requests).
Yes, there are occasional network blips on Heroku that can cause latency, but we're fine tying our success to Heroku's at least in the short term.
If we want to hit the 100ms latency target for 95% of requests, I see 3 options:
- a Optimize on our current rails stack in Heroku
- b Move to straight AWS, or other hosting provider
- c Rebuild functionality into something I feel more confident could hit the latency target. Probably Java.
a is obviously the prime candiate, but I've already picked off the low-hanging fruit. c is probably most certainly the most likely to succeed, but also take the most work (most of the engineers today came from Java, so we don't have any Ruby->Java penalty). But b is kind of a dark horse, where it could be good or it could be worse -- I don't know how to tell without trying it out and load testing, but then, that's basically just doing it and seeing if it was successful.
I'm trying to decide between them, or find a way to decide between them. Any advice? experience?
*The majority of our requests do not require us to render html.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
重写通常不会给你带来你期望的回报。
就我个人而言,我会看优化您现有的应用程序。如果架构正确,100 毫秒是很容易获得的,而另一个主机不会真正为您提供 Heroku 无法提供的任何速度,而且不会增加一些麻烦。
我们有许多 Rails 应用程序在 Heroku 上运行,其中一些应用程序始终返回不到 50 毫秒的响应时间。
Rewriting generally doesn't give you the return you're expecting.
Personally, I would look at optimising your existing application. 100ms is more than easy enough to get if architected properly, and another host will not really give you anything speed-wise that Heroku won't, without also adding a load of headaches.
We have numerous Rails apps running on Heroku, some of which are consistently returning less than 50ms response times.