set worker_concurrency of user group as cpu_quota_concurrency
This commit is contained in:
parent
9045cbee1e
commit
44523be159
@ -1060,6 +1060,12 @@ void ObTenant::set_unit_min_cpu(double cpu)
|
||||
}
|
||||
}
|
||||
|
||||
int64_t ObTenant::cpu_quota_concurrency() const
|
||||
{
|
||||
ObTenantConfigGuard tenant_config(TENANT_CONF(id_));
|
||||
return static_cast<int64_t>((tenant_config.is_valid() ? tenant_config->cpu_quota_concurrency : 4));
|
||||
}
|
||||
|
||||
int64_t ObTenant::min_worker_cnt() const
|
||||
{
|
||||
ObTenantConfigGuard tenant_config(TENANT_CONF(id_));
|
||||
|
@ -408,6 +408,7 @@ public:
|
||||
void set_unit_max_cpu(double cpu);
|
||||
void set_unit_min_cpu(double cpu);
|
||||
OB_INLINE int64_t total_worker_cnt() const { return total_worker_cnt_; }
|
||||
int64_t cpu_quota_concurrency() const;
|
||||
int64_t min_worker_cnt() const;
|
||||
int64_t max_worker_cnt() const;
|
||||
lib::Worker::CompatMode get_compat_mode() const;
|
||||
@ -604,7 +605,12 @@ public:
|
||||
|
||||
OB_INLINE int64_t ObResourceGroup::min_worker_cnt() const
|
||||
{
|
||||
const uint64_t worker_concurrency = share::ObCgSet::instance().get_worker_concurrency(group_id_);
|
||||
uint64_t worker_concurrency = 0;
|
||||
if (is_user_group(group_id_)) {
|
||||
worker_concurrency = tenant_->cpu_quota_concurrency();
|
||||
} else {
|
||||
worker_concurrency = share::ObCgSet::instance().get_worker_concurrency(group_id_);
|
||||
}
|
||||
int64_t cnt = worker_concurrency * (int64_t)ceil(tenant_->unit_min_cpu());
|
||||
if (share::OBCG_CLOG == group_id_ || share::OBCG_LQ == group_id_) {
|
||||
cnt = std::max(cnt, 8L);
|
||||
@ -618,7 +624,12 @@ OB_INLINE int64_t ObResourceGroup::min_worker_cnt() const
|
||||
|
||||
OB_INLINE int64_t ObResourceGroup::max_worker_cnt() const
|
||||
{
|
||||
const uint64_t worker_concurrency = share::ObCgSet::instance().get_worker_concurrency(group_id_);
|
||||
uint64_t worker_concurrency = 0;
|
||||
if (is_user_group(group_id_)) {
|
||||
worker_concurrency = tenant_->cpu_quota_concurrency();
|
||||
} else {
|
||||
worker_concurrency = share::ObCgSet::instance().get_worker_concurrency(group_id_);
|
||||
}
|
||||
int64_t cnt = worker_concurrency * (int64_t)ceil(tenant_->unit_max_cpu());
|
||||
if (share::OBCG_CLOG == group_id_) {
|
||||
cnt = std::max(cnt, 8L);
|
||||
|
Loading…
x
Reference in New Issue
Block a user