Search:

Search all manuals
Search this manual
Manual
Couchbase Server Manual 2.0
Community Wiki and Resources
Download Couchbase Server 2.0
Couchbase Developer Guide 2.0
Client Libraries
Couchbase Server Forum
Additional Resources
Community Wiki
Community Forums
Couchbase SDKs
Parent Section
5 Administration Tasks
Chapter Sections
Chapters

5.3. Ejection and Working Set Management

Couchbase Server actively manages the data stored in a caching layer; this includes the information which is frequently accessed by clients and which needs to be available for rapid reads and writes. When there are too many items in RAM, Couchbase Server will remove certain data to create free space and to maintain system performance. This process is called working set management and we refer to the set of data in RAM as a working set.

In general your working set consists of all the keys, metadata, and associated documents which are frequently used in your system and therefore require fast access. The process the server performs to remove data from RAM is known as ejection, and when the server performs this process, it removes the document, but not the keys or metadata for an item. Keeping keys and metadata in RAM serves three important purposes in a system:

Understanding the Item Pager

The process that periodically runs and removes documents from RAM is known as the item pager. When a threshold known as low water mark is reached, this process starts ejecting inactive replica data from RAM on the node. If the amount of RAM used by items reaches an upper threshold, known as the high water mark, both replica data and active data written from clients will be ejected. The item pager will continue to eject items from RAM until the amount of RAM consumed is below the low water mark. Both the high water mark and low water mark are expressed as an absolute amount of RAM, such as 5577375744 bytes.

When you change either of these settings, you can provide a percentage of total RAM for a node such as 60% or as an absolute number of bytes. For Couchbase Server 2.0, we recommend you remain using the default settings provided, which are 60% for the low water mark and 75% for the high water mark. For more information about changing this setting, see Section 7.6.4, “Changing Thresholds for Ejection”.

Understanding Not-Frequently-Used Items

All items in the server contain 1 bit of metadata indicating whether the item has been recently accessed or not; this metadata is known as NRU, which is an abbreviation for not-recently-used. If an item has not been recently used then the item is a candidate for ejection if the high water mark has been exceeded. When the high water mark has been exceeded, the item pager evicts items from RAM in two phases:

There are two processes which change the NRU for an item: 1) if a client reads or writes an item, the server will specify that the item is frequently used, 2) Couchbase Server also has a daily process which creates a list of frequently-used items in RAM. After the process runs, the server will specify that all items are not frequently used. So be aware that these two processes will change NRUs and therefore will affect which items are candidates for ejection. For more information about the access scanner, see Section 5.1, “Handling Server Warmup”.

You can adjust settings for Couchbase Server which affect the ejection process. In doing so, you can indicate the percentage of RAM you are willing to consume before items are ejected, or you can indicate whether ejection should occur more frequently on replica data than on original, source data. Be aware that for Couchbase Server 2.0, we recommend that you remain using the defaults provided.

For information about changing settings for ejection, see Section 7.6.4, “Changing Thresholds for Ejection”.