Details
-
Bug
-
Resolution: Won't Fix
-
Major
-
None
-
*Location*: https://developer.couchbase.com/documentation/server/4.6/indexes/gsi-for-n1ql.html
*Referrer*: https://issues.couchbase.com/browse/CBSE-3704
*User-Agent*: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:52.0) Gecko/20100101 Firefox/52.0
*Screen Resolution*: 1440 x 900
Description
Request
Provide more details regarding the algorithm for ejecting Standard (ForestDB) indexes when they cannot fit in RAM.
Background
MOI behavior under OOM is already described here:
https://developer.couchbase.com/documentation/server/4.6/indexes/gsi-for-n1ql.html
We need similar type of information for FDB.
As per engineering:
Ejection algorithm of FDB buffer cache is simple. FDB tries to cache as many data as possible in its own in-memory cache, whose size is fixed and configured by upper level module (GSI in this case). If the overall data size is bigger than the cache size, FDB cache begins to eject blocks based on LRU algorithm.
In addition to that, FDB cache classifies cached data into two types: index blocks and document blocks. Index blocks represent B+tree nodes that point to other blocks, while document blocks denote leaf nodes that contain actual key-value data. Index blocks have higher priority than that of document blocks, to minimize the number of disk IO per tree traversal. Generally the hit ratio of index blocks are greater than that of document blocks, granting priority to index blocks helps improving the overall hit ratio of the cache.
FDB cache gives index blocks a second chance; when an index block is selected as a victim for ejection, FDB cache moves it to the front of LRU list instead of ejecting it. By contrast, document blocks are ejected immediately. If an index block becomes victim for ejection once again without further access since its second chance, FDB cache ejects it eventually.
Attachments
Issue Links
- relates to
-
DOC-5989 Add information on GSI eviction policy
- Closed