[CP] adjust cache map node clean
This commit is contained in:
5
src/share/cache/ob_kv_storecache.cpp
vendored
5
src/share/cache/ob_kv_storecache.cpp
vendored
@ -231,7 +231,10 @@ int ObKVGlobalCache::init(
|
|||||||
cache_num_ = 0;
|
cache_num_ = 0;
|
||||||
stopped_ = false;
|
stopped_ = false;
|
||||||
mem_limit_getter_ = mem_limit_getter;
|
mem_limit_getter_ = mem_limit_getter;
|
||||||
map_once_clean_num_ = min(MAX_MAP_ONCE_CLEAN_NUM, bucket_num / MAP_ONCE_CLEAN_RATIO);
|
map_once_clean_num_ = bucket_num / MAP_ONCE_CLEAN_RATIO;
|
||||||
|
if (map_once_clean_num_ > MAX_MAP_ONCE_CLEAN_NUM) {
|
||||||
|
map_once_clean_num_ = MAX(MAX_MAP_ONCE_CLEAN_NUM, map_once_clean_num_/EXPAND_MAP_ONCE_CLEAN_RATIO);
|
||||||
|
}
|
||||||
map_once_replace_num_ = min(MAX_MAP_ONCE_REPLACE_NUM, bucket_num / MAP_ONCE_REPLACE_RATIO);
|
map_once_replace_num_ = min(MAX_MAP_ONCE_REPLACE_NUM, bucket_num / MAP_ONCE_REPLACE_RATIO);
|
||||||
inited_ = true;
|
inited_ = true;
|
||||||
#ifdef ENABLE_DEBUG_LOG
|
#ifdef ENABLE_DEBUG_LOG
|
||||||
|
1
src/share/cache/ob_kv_storecache.h
vendored
1
src/share/cache/ob_kv_storecache.h
vendored
@ -239,6 +239,7 @@ private:
|
|||||||
static const int64_t MAP_ONCE_CLEAN_RATIO = 50; // 50 * 0.2 = 10s
|
static const int64_t MAP_ONCE_CLEAN_RATIO = 50; // 50 * 0.2 = 10s
|
||||||
static const int64_t MAP_ONCE_REPLACE_RATIO = 100; // 100 * 0.2 = 20s
|
static const int64_t MAP_ONCE_REPLACE_RATIO = 100; // 100 * 0.2 = 20s
|
||||||
static const int64_t MAX_MAP_ONCE_CLEAN_NUM = 200000; // 200K
|
static const int64_t MAX_MAP_ONCE_CLEAN_NUM = 200000; // 200K
|
||||||
|
static const int64_t EXPAND_MAP_ONCE_CLEAN_RATIO = 10;
|
||||||
static const int64_t MAX_MAP_ONCE_REPLACE_NUM = 100000; // 100K
|
static const int64_t MAX_MAP_ONCE_REPLACE_NUM = 100000; // 100K
|
||||||
static const int64_t TIMER_SCHEDULE_INTERVAL_US = 800 * 1000;
|
static const int64_t TIMER_SCHEDULE_INTERVAL_US = 800 * 1000;
|
||||||
static const int64_t WORKING_SET_LIMIT_PERCENTAGE = 5;
|
static const int64_t WORKING_SET_LIMIT_PERCENTAGE = 5;
|
||||||
|
Reference in New Issue
Block a user