Set the max num of direct load thread to 2 * cpu

This commit is contained in:
coolfishchen 2023-06-30 02:53:41 +00:00 committed by ob-robot
parent 96d2098cdf
commit 81cbd7e0fc
4 changed files with 4 additions and 4 deletions

View File

@ -112,7 +112,7 @@ int ObTableLoadBeginP::process()
param.table_id_ = table_id;
param.batch_size_ = arg_.config_.batch_size_;
param.parallel_ = arg_.config_.session_count_;
param.session_count_ = MIN(arg_.config_.session_count_, (int32_t)tenant->unit_max_cpu());
param.session_count_ = MIN(arg_.config_.session_count_, (int32_t)tenant->unit_max_cpu() * 2);
param.max_error_row_count_ = arg_.config_.max_error_row_count_;
param.column_count_ = column_names.count();
param.need_sort_ = arg_.config_.flag_.is_need_sort_;

View File

@ -13,7 +13,7 @@ namespace oceanbase
namespace observer
{
#define ENABLE_TABLE_LOAD_STAT 1
#define ENABLE_TABLE_LOAD_STAT 0
struct ObTableLoadStat
{

View File

@ -1919,7 +1919,7 @@ int ObLoadDataDirectImpl::init_execute_param()
} else {
hint_parallel = hint_parallel > 0 ? hint_parallel : DEFAULT_PARALLEL_THREAD_COUNT;
execute_param_.parallel_ = hint_parallel;
execute_param_.thread_count_ = MIN(hint_parallel, (int64_t)tenant->unit_max_cpu());
execute_param_.thread_count_ = MIN(hint_parallel, (int64_t)tenant->unit_max_cpu() * 2);
execute_param_.data_mem_usage_limit_ =
MIN(execute_param_.thread_count_ * 2, MAX_DATA_MEM_USAGE_LIMIT);
}

View File

@ -62,7 +62,7 @@ int ObTableDirectInsertCtx::init(ObExecContext *exec_ctx,
param.table_id_ = table_id;
param.batch_size_ = 100;
param.parallel_ = parallel;
param.session_count_ = MIN(parallel, (int64_t)tenant->unit_max_cpu());
param.session_count_ = MIN(parallel, (int64_t)tenant->unit_max_cpu() * 2);
param.px_mode_ = true;
param.online_opt_stat_gather_ = false;
param.need_sort_ = true;