modify default iops

This commit is contained in:
renju96
2023-07-22 05:42:41 +00:00
committed by ob-robot
parent ca3be0b8b0
commit 7cfd3fdb3e
2 changed files with 5 additions and 5 deletions

View File

@ -191,7 +191,7 @@ int ObUnitResource::init_and_check_iops_(const ObUnitResource &user_spec)
const int64_t unit_min_iops = UNIT_MIN_IOPS; const int64_t unit_min_iops = UNIT_MIN_IOPS;
// max_iops and min_iops are not specified, auto configure by min_cpu // max_iops and min_iops are not specified, auto configure by min_cpu
if (! user_spec.is_max_iops_valid() && ! user_spec.is_min_iops_valid()) { if (! user_spec.is_max_iops_valid() && ! user_spec.is_min_iops_valid()) {
max_iops_ = get_default_iops(min_cpu_); max_iops_ = get_default_iops();
min_iops_ = max_iops_; min_iops_ = max_iops_;
// if iops_weight is not specified, auto configure by min_cpu // if iops_weight is not specified, auto configure by min_cpu
@ -664,7 +664,7 @@ int ObUnitResource::gen_sys_tenant_default_unit_resource()
min_cpu_ = GCONF.get_sys_tenant_default_min_cpu(); min_cpu_ = GCONF.get_sys_tenant_default_min_cpu();
// SYS tenant log_disk_size keep same with memory size // SYS tenant log_disk_size keep same with memory size
log_disk_size_ = max(memory_size_, UNIT_MIN_LOG_DISK_SIZE); log_disk_size_ = max(memory_size_, UNIT_MIN_LOG_DISK_SIZE);
max_iops_ = get_default_iops(min_cpu_); max_iops_ = get_default_iops();
min_iops_ = max_iops_; min_iops_ = max_iops_;
iops_weight_ = get_default_iops_weight(min_cpu_); iops_weight_ = get_default_iops_weight(min_cpu_);

View File

@ -309,10 +309,10 @@ public:
return memory_size * MEMORY_TO_LOG_DISK_FACTOR; return memory_size * MEMORY_TO_LOG_DISK_FACTOR;
} }
// get default IOPS based on CPU // default IOPS = INT64_MAX
static int64_t get_default_iops(const double cpu) static int64_t get_default_iops()
{ {
return static_cast<int64_t>(cpu * CPU_TO_IOPS_FACTOR); return INT64_MAX;
} }
// get default IOPS_WEIGHT based on CPU // get default IOPS_WEIGHT based on CPU