注册 登录  
 加关注
   显示下一条  |  关闭
温馨提示!由于新浪微博认证机制调整,您的新浪微博帐号绑定已过期,请重新绑定!立即重新绑定新浪微博》  |  关闭

老和山小和尚

敬天爱人

 
 
 

日志

 
 
 
 

Varnish上持久存储的设想(翻译)  

2010-01-22 16:08:37|  分类: 其他服务软件 |  标签: |举报 |字号 订阅

  下载LOFTER 我的照片书  |
Plans for persistent storage i Varnish
Varnish上持久存储的设想(翻译)

翻译连接:http: //varnish.projects.linpro.no/wiki/ArchitecturePersistentStorage

Fundamentally, there are two architecture for a cache with persistent storage: either go look for the object on disk when you need it, or preload the index of what is there, before you start service.
一般来说,现在有两种架构方式来实现缓存的持久存储:要么直接去磁盘寻找需要的对象,要么在启动时把所有对象的索引预先加载进来。

They both have advantages and disadvantages.
这两种方式既有优点也有缺点。

The first model is well suited for small machines with big caches, the traditional "squid" scenario, where some old workstation could faster seek out an object in the filesystem, than it could download it over the slow internet connection.
第一种模型适合于比较弱的服务器配合大缓存,就像squid的应用场景,从磁盘上找到对象,总比通过网络重新从原始服务器拿快。

But for high-traffic sites with relatively small data sets, it has devastating startup behaviour: every request results in a handful of disk transactions and at least a couple of semi-longish disk seeks, fighting for the disks attention with the other requests.
但是对于高负载缓存数据又不多的站点,就不是很好了:每个请求都会经过一系列的磁盘操作,至少两次寻道时间,同时与其他请求竞争对磁盘的使用。

Clearly this is much less of a concern with SSD disks about to become the new black, but writing off rotating platters entirely is premature. The other model has different and less troubling startup behaviour, in that a single thread loading the index of disk will not have competing searches, and provided the index to be read is thin enough, the time spent is not prohibitive.
很明显使用SSD磁盘就极少考虑这些问题。但是现有的替换算法还不是很成熟。另外一些模型缺少启动时的问题检查,尤其那些单线程的索引加载也不会进行完整 的索引搜索,其实仅仅读索引已经很精简了,其花费的时间也不应被限制得很短。

Thus we aim for this model.
我们的目标就是实现上述模型。

Both models suffer equally from the "is the disk consistent" neurosis after a crash, just like any filesystem does.
所有的模型都遇到同样的问题:在crash以后,磁盘上的数据还是一致的吗?这跟所有其他文件系统碰到的问题一样。

In difference from a filesystem, we can live with loosing sections of our stored data with no other ill effects than a decrease in cache efficiency.
与文件系统不同的是,我们可以使用松散的扇区来存储数据,而不会减少缓存的使用效率。

This calls for a hierachy of consistency, where the high-level structure is very heavily protected from corruption, using the strongest methods we have, and where decreasing levels of protection is applied the closer we get to the leaves of the data structure.
这就需要通过多层数据结构来保证一致性,高层结构严格保证数据可以恢复,可以使用现有的最严格的方法。减少需要保护的层次,这就要求我们更接近那些‘叶子 ’数据结构。

With Solid State Disks being the new black, the traditional focus on minimizing the seektimes of reads get turned on its head and suddenly being nice to the wear-leveling algorithms on write becomes the priority.
使用SSD以后,读的寻道时间已经不需要担心,但是写的损耗平衡算法需要优先考虑。

It is too early to write of rotating media entirely, so a sensible weighted compromise must be found.
考虑对整个媒介进行轮换还为时过早,但应找一个损耗敏感的方法。

I belive this is a log-structured approach, where writes are mostly sequential and seek distance from the most likely head position is proportional with the age of the object being sought.
我相信这应该是一种日志式的构造方法,大部分写是顺序的,查找对象应该根据时间老化,其头部位置排过序的。

So, with this overall architectural outline, how does persistent look in Varnish ?
这大致是我们架构的轮廓。

译者记:在varnish现有的开发代码库里,已经有持久数据存储的支持了。


  评论这张
 
阅读(1149)| 评论(0)
推荐 转载

历史上的今天

评论

<#--最新日志,群博日志--> <#--推荐日志--> <#--引用记录--> <#--博主推荐--> <#--随机阅读--> <#--首页推荐--> <#--历史上的今天--> <#--被推荐日志--> <#--上一篇,下一篇--> <#-- 热度 --> <#-- 网易新闻广告 --> <#--右边模块结构--> <#--评论模块结构--> <#--引用模块结构--> <#--博主发起的投票-->
 
 
 
 
 
 
 
 
 
 
 
 
 
 

页脚

网易公司版权所有 ©1997-2017