Heroku雪松堆栈中rack-cache vs varnish的缺点? [英] Disadvantages to rack-cache vs. Varnish in Heroku cedar stack?

查看:101
本文介绍了Heroku雪松堆栈中rack-cache vs varnish的缺点?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

之前的2个Heroku应用程序堆栈带有一个 Varnish 图层,该图层自动反向代理缓存的内容基于http头。



新的Heroku雪松堆栈没有这个清漆层。 Heroku建议使用机架缓存 memcache



这与使用清漆层的先前堆栈相比,是否有缺点?使用rack-cache,服务缓存层的服务器不会少,而且优化方式不那么简单?


解决方案

绝对没有问题,删除清漆层是缓存中的巨大降级性能 - 延迟和吞吐量 - 从Heroku的竹子到雪松烟囱。例如,您的应用程序请求与缓存命中时间匹配,并且可能排在后面。



缺点,仅举几例:解释ruby与编译的C)应用程序级别(与代理级别)基于memcached(与基于进程内存的对比)阻止基于I / O(与基于非阻塞I / O)。任何暗示这两种缓存策略都可能在规模上竞争的说法是荒谬的。你不会看到很小的区别。但是如果你每秒钟有数百乃至数千次的高速缓存命中,清漆不会大幅降级,而雪松堆栈则需要许多动态码才能以高性能的方式提供静态资产。 (我看到在Cedar上缓存命中的5-10分钟dyno处理时间)。

Cedar的构建方式并不是为了提高性能,而是为了引入您的应用程序具有更高的灵活性。虽然它允许您执行非阻塞I / O操作(如长轮询),并对静态资产缓存参数进行细粒度控制,但很显然,如果您的目标是Internet规模,那么heroku会希望您带上自己的缓存/带宽。 >

The previous 2 Heroku application stacks came with a Varnish layer which automatically reverse-proxy-cached content based on http headers.

The new Heroku cedar stack doesn't have this Varnish layer. Heroku suggests using rack-cache and memcache instead.

Does this have disadvantages compared to the previous stacks with the varnish layer? With rack-cache, aren't there fewer servers serving the caching layer, and in a less optimized way?

解决方案

There is absolutely no question that removing the varnish layer is a huge downgrade in cache performance -- both latency and throughput -- from Heroku's bamboo to cedar stack. For one, your application requests are competing with, and may be queued behind, cache hits for dyno time.

The disadvantages, to name a few, are: interpreted ruby (vs. compiled C) application level (vs. proxy level) memcached based (vs. in process memory based) blocking I/O based (vs. nonblocking I/O based). Any suggestion that the two caching strategies could compete at scale is ridiculous. You won't see much difference on a small scale. But if you have hundreds or even thousands of cache hits per second, varnish will not substantially degrade, while the cedar stack would require many dynos just to serve static assets in a performant fashion. (I'm seeing ~ 5-10ms dyno processing time for cache hits on cedar).

Cedar was built the way it was built not to improve performance, but to introduce new levels of flexibility over your application. While it allows you to do non blocking I/O operations like long polling, and fine grained control over static asset caching parameters, it's clear that heroku would like you to bring your own caching/bandwidth if your goal is internet scale.

这篇关于Heroku雪松堆栈中rack-cache vs varnish的缺点?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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