[enhancement](compaction) optimizing memory usage for compaction#36492
[enhancement](compaction) optimizing memory usage for compaction#36492gavinchou merged 9 commits intoapache:masterfrom
Conversation
|
Thank you for your contribution to Apache Doris. Since 2024-03-18, the Document has been moved to doris-website. |
|
run buildall |
|
clang-tidy review says "All clean, LGTM! 👍" |
|
run buildall |
|
clang-tidy review says "All clean, LGTM! 👍" |
|
clang-tidy review says "All clean, LGTM! 👍" |
|
clang-tidy review says "All clean, LGTM! 👍" |
|
run buildall |
|
clang-tidy review says "All clean, LGTM! 👍" |
TPC-H: Total hot run time: 40420 ms |
TPC-DS: Total hot run time: 173148 ms |
ClickBench: Total hot run time: 30.31 s |
|
TeamCity be ut coverage result: |
|
run buildall |
|
clang-tidy review says "All clean, LGTM! 👍" |
TPC-H: Total hot run time: 41006 ms |
|
TeamCity be ut coverage result: |
| break; | ||
| } | ||
| } | ||
|
|
There was a problem hiding this comment.
Should be a defer, because there are other places where rowsets are removed.
|
|
||
| DEFINE_Bool(enable_base_compaction_idle_sched, "true"); | ||
| DEFINE_mInt64(base_compaction_min_rowset_num, "5"); | ||
| DEFINE_mInt64(base_compaction_max_rowset_num, "20"); |
There was a problem hiding this comment.
We shoud limit comlumn num, it is waynum * column_num, because segment columns consumes memory too.
There was a problem hiding this comment.
According to rowset num, we shoud limit score?
| way_num = num_segments(); | ||
| CHECK(way_num > 0); | ||
| } | ||
| return way_num; |
There was a problem hiding this comment.
The score contains an empty rowset, while the merge way does not include an empty rowset
| _merge_rowsets_latency_timer = ADD_TIMER(_profile, "merge_rowsets_latency"); | ||
| } | ||
|
|
||
| int64_t Compaction::merge_way() { |
| << tablet->tablet_id() << " way cnt: " << way_cnt; | ||
| return 4096 - 32; | ||
| } | ||
| int64_t block_mem_limit = config::compaction_memory_bytes_limit / way_cnt; |
There was a problem hiding this comment.
There are meta consuming memory too.
There was a problem hiding this comment.
This PR temporarily does not calculate the memory consumption of metadata
| src_rowset_readers, dst_rowset_writer, max_rows_per_segment, stats_output, | ||
| key_group_cluster_key_idxes)); | ||
| key_group_cluster_key_idxes, batch_size, &(tablet->sample_infos[i]))); | ||
| if (is_key) { |
There was a problem hiding this comment.
When memlimit happens, we should adjust batch_size.
ClickBench: Total hot run time: 30.47 s |
| void BaseCompaction::_filter_input_rowset() { | ||
| auto rs_iter = _input_rowsets.begin(); | ||
| int score = 0; | ||
| while (rs_iter != _input_rowsets.end()) { |
|
run buildall |
| // specific language governing permissions and limitations | ||
| // under the License. | ||
|
|
||
| #include "olap/base_compaction.h" |
There was a problem hiding this comment.
warning: 'olap/base_compaction.h' file not found [clang-diagnostic-error]
#include "olap/base_compaction.h"
^
TPC-H: Total hot run time: 40077 ms |
TPC-DS: Total hot run time: 172010 ms |
ClickBench: Total hot run time: 30.53 s |
|
run buildall |
TPC-H: Total hot run time: 40180 ms |
TPC-DS: Total hot run time: 173175 ms |
ClickBench: Total hot run time: 30.65 s |
|
run p0 |
|
PR approved by at least one committer and no changes requested. |
|
PR approved by anyone and no changes requested. |
…ion (apache#36492)" This reverts commit 9990181.
|
revert and recommit in #37099 |
1 Limit the number of rowsets participating in base compaction.
2 Estimate the appropriate batch size by sampling and analyzing the memory consumption of blocks.