fix sys tenant backlog with cgroup on
This commit is contained in:
@ -167,6 +167,34 @@ void ObServerConfig::print() const
|
||||
OB_LOG(INFO, "===================== *stop server config report* =======================");
|
||||
}
|
||||
|
||||
double ObServerConfig::get_sys_tenant_default_min_cpu()
|
||||
{
|
||||
double min_cpu = server_cpu_quota_min;
|
||||
if (0 == min_cpu) {
|
||||
int64_t cpu_count = get_cpu_count();
|
||||
if (cpu_count < 8) {
|
||||
min_cpu = 1;
|
||||
} else {
|
||||
min_cpu = 2;
|
||||
}
|
||||
}
|
||||
return min_cpu;
|
||||
}
|
||||
|
||||
double ObServerConfig::get_sys_tenant_default_max_cpu()
|
||||
{
|
||||
double max_cpu = server_cpu_quota_min;
|
||||
if (0 == max_cpu) {
|
||||
int64_t cpu_count = get_cpu_count();
|
||||
if (cpu_count < 8) {
|
||||
max_cpu = 1;
|
||||
} else {
|
||||
max_cpu = 2;
|
||||
}
|
||||
}
|
||||
return max_cpu;
|
||||
}
|
||||
|
||||
int ObServerConfig::deserialize_with_compat(const char *buf, const int64_t data_len, int64_t &pos)
|
||||
{
|
||||
int ret = OB_SUCCESS;
|
||||
|
||||
@ -80,8 +80,8 @@ public:
|
||||
// print all config to log file
|
||||
void print() const;
|
||||
|
||||
double get_sys_tenant_default_min_cpu() { return server_cpu_quota_min; }
|
||||
double get_sys_tenant_default_max_cpu() { return server_cpu_quota_max; }
|
||||
double get_sys_tenant_default_min_cpu();
|
||||
double get_sys_tenant_default_max_cpu();
|
||||
|
||||
virtual ObServerRole get_server_type() const { return common::OB_SERVER; }
|
||||
virtual bool is_debug_sync_enabled() const { return static_cast<int64_t>(debug_sync_timeout) > 0; }
|
||||
|
||||
@ -272,13 +272,13 @@ DEF_TIME_WITH_CHECKER(max_stale_time_for_weak_consistency, OB_TENANT_PARAMETER,
|
||||
DEF_BOOL(enable_monotonic_weak_read, OB_TENANT_PARAMETER, "false",
|
||||
"specifies observer supportting atomicity and monotonic order read",
|
||||
ObParameterAttr(Section::TENANT, Source::DEFAULT, EditLevel::DYNAMIC_EFFECTIVE));
|
||||
DEF_DBL(server_cpu_quota_min, OB_CLUSTER_PARAMETER, "1", "[1,16]",
|
||||
DEF_DBL(server_cpu_quota_min, OB_CLUSTER_PARAMETER, "0", "[0,16]",
|
||||
"the number of minimal vCPUs allocated to the server tenant"
|
||||
"(a special internal tenant that exists on every observer). Range: [1, 16]",
|
||||
"(a special internal tenant that exists on every observer). 0 stands for adaptive. Range: [0, 16]",
|
||||
ObParameterAttr(Section::TENANT, Source::DEFAULT, EditLevel::STATIC_EFFECTIVE));
|
||||
DEF_DBL(server_cpu_quota_max, OB_CLUSTER_PARAMETER, "1", "[1,16]",
|
||||
DEF_DBL(server_cpu_quota_max, OB_CLUSTER_PARAMETER, "0", "[0,16]",
|
||||
"the number of maximal vCPUs allocated to the server tenant"
|
||||
"(a special internal tenant that exists on every observer). Range: [1, 16]",
|
||||
"(a special internal tenant that exists on every observer). 0 stands for adaptive. Range: [0, 16]",
|
||||
ObParameterAttr(Section::TENANT, Source::DEFAULT, EditLevel::STATIC_EFFECTIVE));
|
||||
DEF_CAP_WITH_CHECKER(_hidden_sys_tenant_memory, OB_CLUSTER_PARAMETER, "0M",
|
||||
common::ObConfigTenantMemoryChecker, "[0M,)",
|
||||
|
||||
@ -192,7 +192,7 @@ int ObResourcePlanManager::normalize_cpu_directives(ObPlanDirectiveSet &directiv
|
||||
cfs_period_us))) {
|
||||
LOG_WARN("fail get cpu cfs period", K(d), K(ret));
|
||||
} else {
|
||||
if (d.utilization_limit_ == 100) {
|
||||
if (is_sys_tenant(d.tenant_id_) || d.utilization_limit_ == 100) {
|
||||
// 不限制
|
||||
d.utilization_limit_ = -1;
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user