Skip to content

Conversation

@chenlinzhong
Copy link
Contributor

Proposed changes

Issue Number: close #16634

Problem summary

mainly include:

  1. brpc service adds two types of thread pools. The number of "light" and "heavy" thread pools is different
  2. Classify the interfaces of be. Those related to data transmission are classified as heavy interfaces and others as light interfaces
  3. Add some monitoring to the thread pool, including the queue size and the number of active threads. Use these indicators to guide the configuration of the number of threads

主要包括

  • 1.brpc服务增加2类线程池,"轻","重" 不同线程池的数量配置不一样
  • 2.对be的接口进行分类,跟数据传输有关的归类为重接口,其他为轻接口
  • 3.增加一些监控,包括be每个接口qps和线程池队列大小、活跃线程个数,根据这些指标来指导线程数的配置

image

Checklist(Required)

  1. Does it affect the original behavior:
    • Yes
    • No
    • I don't know
  2. Has unit tests been added:
    • Yes
    • No
    • No Need
  3. Has document been added or modified:
    • Yes
    • No
    • No Need
  4. Does it need to update dependencies:
    • Yes
    • No
  5. Are there any changes that cannot be rolled back:
    • Yes (If Yes, please explain WHY)
    • No

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...

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clang-tidy made some suggestions

chenlinzhong and others added 8 commits February 11, 2023 23:32
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clang-tidy made some suggestions

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clang-tidy made some suggestions

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clang-tidy made some suggestions

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clang-tidy made some suggestions

@github-actions
Copy link
Contributor

clang-tidy review says "All clean, LGTM! 👍"

@hello-stephen
Copy link
Contributor

hello-stephen commented Feb 11, 2023

TeamCity pipeline, clickbench performance test result:
the sum of best hot time: 34.62 seconds
stream load tsv: 472 seconds loaded 74807831229 Bytes, about 151 MB/s
stream load json: 38 seconds loaded 2358488459 Bytes, about 59 MB/s
stream load orc: 68 seconds loaded 1101869774 Bytes, about 15 MB/s
stream load parquet: 29 seconds loaded 861443392 Bytes, about 28 MB/s
https://doris-community-test-1308700295.cos.ap-hongkong.myqcloud.com/tmp/20230220102018_clickbench_pr_100139.html

@morningman
Copy link
Contributor

@yangzhg yangzhg changed the title [Improvement](brpc) replace brpc bthread with pthread [Improvement](brpc) Using a thread pool for RPC service avoiding std::mutex block brpc::bthread Feb 13, 2023
@github-actions
Copy link
Contributor

clang-tidy review says "All clean, LGTM! 👍"

@github-actions github-actions bot added the kind/docs Categorizes issue or PR as related to documentation. label Feb 13, 2023
@chenlinzhong
Copy link
Contributor Author

@github-actions
Copy link
Contributor

clang-tidy review says "All clean, LGTM! 👍"

@chenlinzhong
Copy link
Contributor Author

run p0

3 similar comments
@chenlinzhong
Copy link
Contributor Author

run p0

@chenlinzhong
Copy link
Contributor Author

run p0

@chenlinzhong
Copy link
Contributor Author

run p0

@chenlinzhong chenlinzhong merged commit 0e3be4e into apache:master Feb 22, 2023
@morningman morningman added usercase Important user case type label dev/1.2.3 and removed dev/1.2.2 labels Feb 23, 2023
morningman pushed a commit to morningman/doris that referenced this pull request Feb 23, 2023
…:mutex block brpc::bthread (apache#16639)

mainly include:
- brpc service adds two types of thread pools. The number of "light" and "heavy" thread pools is different
Classify the interfaces of be. Those related to data transmission are classified as heavy interfaces and others as light interfaces
- Add some monitoring to the thread pool, including the queue size and the number of active threads. Use these
- indicators to guide the configuration of the number of threads
morningman pushed a commit that referenced this pull request Feb 23, 2023
…:mutex block brpc::bthread (#16639)

mainly include:
- brpc service adds two types of thread pools. The number of "light" and "heavy" thread pools is different
Classify the interfaces of be. Those related to data transmission are classified as heavy interfaces and others as light interfaces
- Add some monitoring to the thread pool, including the queue size and the number of active threads. Use these
- indicators to guide the configuration of the number of threads
morningman added a commit to morningman/doris that referenced this pull request Feb 27, 2023
…ing std::mutex block brpc::bthread (apache#16639)"

This reverts commit 8534abc.
morningman added a commit that referenced this pull request Feb 27, 2023
…ing std::mutex block brpc::bthread (#16639)" (#17198)

This reverts commit 8534abc.
This PR has some potential dead lock issue, so revert it from 1.2 branch.
yagagagaga pushed a commit to yagagagaga/doris that referenced this pull request Mar 9, 2023
…:mutex block brpc::bthread (apache#16639)

mainly include:
- brpc service adds two types of thread pools. The number of "light" and "heavy" thread pools is different
Classify the interfaces of be. Those related to data transmission are classified as heavy interfaces and others as light interfaces
- Add some monitoring to the thread pool, including the queue size and the number of active threads. Use these 
- indicators to guide the configuration of the number of threads
morningman added a commit to morningman/doris that referenced this pull request Apr 10, 2023
1. cherry-pick [Improvement](brpc) Using a thread pool for RPC service avoiding std::mutex block brpc::bthread (apache#16639)
2. cherry-pick [fix](brpc) solve bthread hang problem (apache#17206)
3. cherry-pick [deps](libhdfs) add official hadoop libhdfs for x86 (apache#17435)
morningman added a commit to morningman/doris that referenced this pull request Apr 13, 2023
1. cherry-pick [Improvement](brpc) Using a thread pool for RPC service avoiding std::mutex block brpc::bthread (apache#16639)
2. cherry-pick [fix](brpc) solve bthread hang problem (apache#17206)
3. cherry-pick [deps](libhdfs) add official hadoop libhdfs for x86 (apache#17435)
morningman added a commit to morningman/doris that referenced this pull request Apr 19, 2023
1. cherry-pick [Improvement](brpc) Using a thread pool for RPC service avoiding std::mutex block brpc::bthread (apache#16639)
2. cherry-pick [fix](brpc) solve bthread hang problem (apache#17206)
3. cherry-pick [deps](libhdfs) add official hadoop libhdfs for x86 (apache#17435)
morningman added a commit to morningman/doris that referenced this pull request Apr 19, 2023
1. cherry-pick [Improvement](brpc) Using a thread pool for RPC service avoiding std::mutex block brpc::bthread (apache#16639)
2. cherry-pick [fix](brpc) solve bthread hang problem (apache#17206)
3. cherry-pick [deps](libhdfs) add official hadoop libhdfs for x86 (apache#17435)
morningman added a commit to morningman/doris that referenced this pull request Apr 21, 2023
1. cherry-pick [Improvement](brpc) Using a thread pool for RPC service avoiding std::mutex block brpc::bthread (apache#16639)
2. cherry-pick [fix](brpc) solve bthread hang problem (apache#17206)
3. cherry-pick [deps](libhdfs) add official hadoop libhdfs for x86 (apache#17435)
morningman added a commit to morningman/doris that referenced this pull request Apr 21, 2023
1. cherry-pick [Improvement](brpc) Using a thread pool for RPC service avoiding std::mutex block brpc::bthread (apache#16639)
2. cherry-pick [fix](brpc) solve bthread hang problem (apache#17206)
3. cherry-pick [deps](libhdfs) add official hadoop libhdfs for x86 (apache#17435)
morningman added a commit to morningman/doris that referenced this pull request Apr 21, 2023
1. cherry-pick [Improvement](brpc) Using a thread pool for RPC service avoiding std::mutex block brpc::bthread (apache#16639)
2. cherry-pick [fix](brpc) solve bthread hang problem (apache#17206)
3. cherry-pick [deps](libhdfs) add official hadoop libhdfs for x86 (apache#17435)
morningman added a commit to morningman/doris that referenced this pull request Apr 21, 2023
1. cherry-pick [Improvement](brpc) Using a thread pool for RPC service avoiding std::mutex block brpc::bthread (apache#16639)
2. cherry-pick [fix](brpc) solve bthread hang problem (apache#17206)
3. cherry-pick [deps](libhdfs) add official hadoop libhdfs for x86 (apache#17435)
morningman added a commit that referenced this pull request Apr 21, 2023
1. cherry-pick [Improvement](brpc) Using a thread pool for RPC service avoiding std::mutex block brpc::bthread (#16639)
2. cherry-pick [fix](brpc) solve bthread hang problem (#17206)
3. cherry-pick [deps](libhdfs) add official hadoop libhdfs for x86 (#17435)
mongo360 pushed a commit to mongo360/doris that referenced this pull request Jul 12, 2023
1. cherry-pick [Improvement](brpc) Using a thread pool for RPC service avoiding std::mutex block brpc::bthread (apache#16639)
2. cherry-pick [fix](brpc) solve bthread hang problem (apache#17206)
3. cherry-pick [deps](libhdfs) add official hadoop libhdfs for x86 (apache#17435)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by one committer. dev/1.2.5-merged kind/docs Categorizes issue or PR as related to documentation. kind/test reviewed usercase Important user case type label

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Enhancement] replace brpc bthread with pthead

6 participants