-
Notifications
You must be signed in to change notification settings - Fork 3.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[improve](load) limit flush thread num proportional to CPU count #33325
Conversation
Thank you for your contribution to Apache Doris. Since 2024-03-18, the Document has been moved to doris-website. |
clang-tidy review says "All clean, LGTM! 👍" |
run buildall |
clang-tidy review says "All clean, LGTM! 👍" |
ff22068
to
902dc00
Compare
clang-tidy review says "All clean, LGTM! 👍" |
1 similar comment
clang-tidy review says "All clean, LGTM! 👍" |
run buildall |
clang-tidy review says "All clean, LGTM! 👍" |
run buildall |
1 similar comment
run buildall |
clang-tidy review says "All clean, LGTM! 👍" |
2 similar comments
clang-tidy review says "All clean, LGTM! 👍" |
clang-tidy review says "All clean, LGTM! 👍" |
b4cccc6
to
2028ebf
Compare
run buildall |
clang-tidy review says "All clean, LGTM! 👍" |
TPC-H: Total hot run time: 38504 ms
|
TeamCity be ut coverage result: |
TPC-DS: Total hot run time: 185557 ms
|
ClickBench: Total hot run time: 29.8 s
|
Load test result on machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
|
@@ -203,15 +203,18 @@ void FlushToken::_flush_memtable(std::unique_ptr<MemTable> memtable_ptr, int32_t | |||
|
|||
void MemTableFlushExecutor::init(int num_disk) { | |||
num_disk = std::max(1, num_disk); | |||
size_t min_threads = std::max(1, config::flush_thread_num_per_store); | |||
size_t max_threads = num_disk * min_threads; | |||
int num_cpus = static_cast<int>(std::thread::hardware_concurrency()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the value is not well defined or not computable,hardware_concurrency may return 0. We should process this case.
be/src/common/config.cpp
Outdated
@@ -662,6 +662,12 @@ DEFINE_mInt64(storage_flood_stage_left_capacity_bytes, "1073741824"); // 1GB | |||
DEFINE_Int32(flush_thread_num_per_store, "6"); | |||
// number of thread for flushing memtable per store, for high priority load task | |||
DEFINE_Int32(high_priority_flush_thread_num_per_store, "6"); | |||
// number of threads = min(flush_thread_num_per_store * num_store, | |||
// max_flush_thread_num_per_cpu * num_cpu) | |||
DEFINE_Int32(max_flush_thread_num_per_cpu, "8"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The default value of 8 is a bit large, and 2 or 4 may be more suitable.
run buildall |
clang-tidy review says "All clean, LGTM! 👍" |
TeamCity be ut coverage result: |
run buildall |
clang-tidy review says "All clean, LGTM! 👍" |
4 similar comments
clang-tidy review says "All clean, LGTM! 👍" |
clang-tidy review says "All clean, LGTM! 👍" |
clang-tidy review says "All clean, LGTM! 👍" |
clang-tidy review says "All clean, LGTM! 👍" |
TeamCity be ut coverage result: |
run buildall |
clang-tidy review says "All clean, LGTM! 👍" |
TeamCity be ut coverage result: |
clang-tidy review says "All clean, LGTM! 👍" |
b63c5b7
to
cb7bba6
Compare
clang-tidy review says "All clean, LGTM! 👍" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
PR approved by at least one committer and no changes requested. |
PR approved by anyone and no changes requested. |
run buildall |
TPC-H: Total hot run time: 41718 ms
|
TPC-DS: Total hot run time: 185330 ms
|
TeamCity be ut coverage result: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice improvement
PR approved by anyone and no changes requested. |
Proposed changes
Add BE config
max_flush_thread_num_per_cpu
andmax_high_priority_flush_thread_num_per_cpu
.The default value is
8
.The max threads for flush thread pool will be:
This is for preventing the flush thread pool to be too large when the machine has a lot of disks.
Further comments
If this is a relatively large or complex change, kick off the discussion at dev@doris.apache.org by explaining why you chose the solution you did and what alternatives you considered, etc...