[CP] Set up caching for large chunks of memory

This commit is contained in:
obdev
2023-06-02 02:49:03 +00:00
committed by ob-robot
parent 1c4a29ea94
commit a84b7a3e75
15 changed files with 472 additions and 104 deletions

View File

@ -196,9 +196,16 @@ int ObServerReloadConfig::operator()()
const int64_t cache_size = GCONF.memory_chunk_cache_size;
const int cache_cnt = (cache_size > 0 ? cache_size : GMEMCONF.get_server_memory_limit()) / INTACT_ACHUNK_SIZE;
lib::AChunkMgr::instance().set_max_chunk_cache_cnt(cache_cnt);
int64_t cache_size = GCONF.memory_chunk_cache_size;
if (0 == cache_size) {
cache_size = GMEMCONF.get_server_memory_limit();
}
int64_t large_cache_size = GCONF._memory_large_chunk_cache_size;
if (0 == large_cache_size) {
large_cache_size = lib::AChunkMgr::DEFAULT_LARGE_CHUNK_CACHE_SIZE;
}
lib::AChunkMgr::instance().set_max_chunk_cache_size(cache_size);
lib::AChunkMgr::instance().set_max_large_chunk_cache_size(large_cache_size);
if (!is_arbitration_mode) {
// Refresh cluster_id, cluster_name_hash for non arbitration mode