Alexey Serbin has submitted this change and it was merged. ( 
http://gerrit.cloudera.org:8080/20607 )

Change subject: KUDU-613: Introduce SLRU cache
......................................................................

KUDU-613: Introduce SLRU cache

This patch introduces the SLRU cache that has two internal segments,
the probationary and protected, to protect the cache from long/random
reads. The SLRU cache has a parameter named 'lookups_threshold_' that
determines the minimum amount of times an entry can be accessed
before it's upgraded to the protected segment. Any random scans would
then only evict entries from the probationary segment.

Both the protected and probationary segment have their own
configurable capacities. When the protected segment is at capacity,
any entries evicted will be added to the MRU end of the
probationary segment.

Metrics will be added in a follow-up patch.

Ran cache benchmarks for RELEASE build.
Used default flag values in cache-bench.
Build ran locally on macOS, 6 cores and 2.6GHz.

Here are some benchmark numbers for SLRU cache:
Test case           | Algorithm | Lookups/sec  | Hit rate
ZIPFIAN ratio=1.00x | LRU       | 11.01M       | 99.8%
ZIPFIAN ratio=1.00x | SLRU      | 10.62M       | 99.9%
ZIPFIAN ratio=3.00x | LRU       | 11.06M       | 95.9%
ZIPFIAN ratio=3.00x | SLRU      | 9.69M        | 95.9%
UNIFORM ratio=1.00x | LRU       | 8.54M        | 99.7%
UNIFORM ratio=1.00x | SLRU      | 6.18M        | 99.7%
UNIFORM ratio=3.00x | LRU       | 6.53M        | 33.3%
UNIFORM ratio=3.00x | SLRU      | 4.99M        | 33.3%

Change-Id: I45531534a2049dd38c002f4dc7982df9fd46e0bb
Reviewed-on: http://gerrit.cloudera.org:8080/20607
Tested-by: Alexey Serbin <[email protected]>
Reviewed-by: Alexey Serbin <[email protected]>
---
M src/kudu/util/CMakeLists.txt
M src/kudu/util/cache-bench.cc
M src/kudu/util/cache.cc
M src/kudu/util/cache.h
A src/kudu/util/slru_cache-test.cc
A src/kudu/util/slru_cache.cc
A src/kudu/util/slru_cache.h
7 files changed, 1,486 insertions(+), 5 deletions(-)

Approvals:
  Alexey Serbin: Looks good to me, approved; Verified

--
To view, visit http://gerrit.cloudera.org:8080/20607
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I45531534a2049dd38c002f4dc7982df9fd46e0bb
Gerrit-Change-Number: 20607
Gerrit-PatchSet: 23
Gerrit-Owner: Mahesh Reddy <[email protected]>
Gerrit-Reviewer: Abhishek Chennaka <[email protected]>
Gerrit-Reviewer: Alexey Serbin <[email protected]>
Gerrit-Reviewer: Attila Bukor <[email protected]>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Mahesh Reddy <[email protected]>
Gerrit-Reviewer: Marton Greber <[email protected]>
Gerrit-Reviewer: Tidy Bot (241)

Reply via email to