[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

View File

@ -225,6 +225,8 @@ DEF_CAP(cache_wash_threshold, OB_CLUSTER_PARAMETER, "4GB", "[0B,]",
ObParameterAttr(Section::OBSERVER, Source::DEFAULT, EditLevel::DYNAMIC_EFFECTIVE));
DEF_CAP(memory_chunk_cache_size, OB_CLUSTER_PARAMETER, "0M", "[0M,]", "the maximum size of memory cached by memory chunk cache. Range: [0M,], 0 stands for adaptive",
ObParameterAttr(Section::OBSERVER, Source::DEFAULT, EditLevel::DYNAMIC_EFFECTIVE));
DEF_CAP(_memory_large_chunk_cache_size, OB_CLUSTER_PARAMETER, "0M", "[0M,]", "the maximum size of large memory cached by memory chunk cache. Range: [0M,], 0 stands for adaptive",
ObParameterAttr(Section::OBSERVER, Source::DEFAULT, EditLevel::DYNAMIC_EFFECTIVE));
DEF_TIME(autoinc_cache_refresh_interval, OB_CLUSTER_PARAMETER, "3600s", "[100ms,]",
"auto-increment service cache refresh sync_value in this interval, "
"with default 3600s. Range: [100ms, +∞)",

View File

@ -127,7 +127,10 @@ int ObTenantMemoryPrinter::print_tenant_usage()
int64_t memory_used = get_virtual_memory_used(&resident_size);
_STORAGE_LOG(INFO,
"[CHUNK_MGR] free=%ld pushes=%ld pops=%ld limit=%'15ld hold=%'15ld total_hold=%'15ld used=%'15ld" \
" freelist_hold=%'15ld maps=%'15ld unmaps=%'15ld large_maps=%'15ld large_unmaps=%'15ld" \
" freelist_hold=%'15ld large_freelist_hold=%'15ld" \
" maps=%'15ld unmaps=%'15ld" \
" large_maps=%'15ld large_unmaps=%'15ld" \
" huge_maps=%'15ld huge_unmaps=%'15ld" \
" memalign=%d resident_size=%'15ld"
#ifndef ENABLE_SANITY
" virtual_memory_used=%'15ld\n",
@ -141,11 +144,14 @@ int ObTenantMemoryPrinter::print_tenant_usage()
CHUNK_MGR.get_hold(),
CHUNK_MGR.get_total_hold(),
CHUNK_MGR.get_used(),
CHUNK_MGR.get_freelist_hold(),
CHUNK_MGR.get_freelist_hold() + CHUNK_MGR.get_large_freelist_hold(),
CHUNK_MGR.get_large_freelist_hold(),
CHUNK_MGR.get_maps(),
CHUNK_MGR.get_unmaps(),
CHUNK_MGR.get_large_maps(),
CHUNK_MGR.get_large_unmaps(),
CHUNK_MGR.get_huge_maps(),
CHUNK_MGR.get_huge_unmaps(),
0,
resident_size,
#ifndef ENABLE_SANITY