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)

DGM Implementation Details

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






















你可能感兴趣的:(server,memcached,活动,System,UP,disk)