Membase存储

In addition to the quota, there are two watermarks the engine will use to determine when it is necessary to start freeing up available memory. These are mem_low_wat and mem_high_wat.

As the system is loaded with data, eventually the mem_low_wat is passed. At this time, a background job is scheduled to reclaim the cached values of replica items from RAM...freeing up memory for further data growth. This is called "ejection" and can only take place on items that have already been written to disk...marking them as "clean". As data continues to load, it will evenutally reach/pass mem_high_wat. The job will continue to run, now ejecting active items as well until memory is below mem_low_wat. If the rate of incoming items is faster than the writing of items to disk, the system may return errors indicating there is not enough space. This will continue until there is available memory.

达到low_wat时会回收 复制的内容
达到high_wat时会回收 活动的内容
 In the case of memcached, items are evicted from memory, and the newly mutated item is stored. In the case of Membase, however, the expectation is that we'll migrate items to disk.
Return a SERVER_ERROR with a standard message indicating that a retry later is likely to succeed

Currently, we have implemented option 2. The handling of SERVER_ERROR is required by the client.(目前空间不足时,只返回SERVER_ERROR)

Get Flow

The actual process of eviction is relatively simple now.  When we need memory, we look around in hash tables and attempt to find things we can get rid of (i.e.things that are persisted on disk) andstart dropping it.  We will also eject data as soon as it's persisted iff it's for an inactive (e.g. replica) vbucket






















  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值