[FEAT MERGE] OLTP performance and cpu reduction optimization under tiny specification

Co-authored-by: hezuojiao <hezuojiao@gmail.com>
This commit is contained in:
obdev
2023-04-26 15:30:17 +00:00
committed by ob-robot
parent 8ad13af591
commit 8fb50cdf65
179 changed files with 3131 additions and 1425 deletions

View File

@ -1619,15 +1619,17 @@ int ObServer::set_running_mode()
{
int ret = OB_SUCCESS;
const int64_t memory_limit = GMEMCONF.get_server_memory_limit();
const int64_t cnt = GCONF.cpu_count;
const int64_t cpu_cnt = cnt > 0 ? cnt : common::get_cpu_num();
if (memory_limit < lib::ObRunningModeConfig::MINI_MEM_LOWER) {
ret = OB_MACHINE_RESOURCE_NOT_ENOUGH;
LOG_ERROR("memory limit too small", KR(ret), K(memory_limit));
} else if (memory_limit < lib::ObRunningModeConfig::MINI_MEM_UPPER) {
ObTaskController::get().allow_next_syslog();
LOG_INFO("observer start with mini_mode", K(memory_limit));
lib::update_mini_mode(memory_limit);
lib::update_mini_mode(memory_limit, cpu_cnt);
} else {
lib::update_mini_mode(memory_limit);
lib::update_mini_mode(memory_limit, cpu_cnt);
}
_OB_LOG(INFO, "mini mode: %s", lib::is_mini_mode() ? "true" : "false");
return ret;