Skip to content
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

Disagg: Reduce the number of threads created for handling disaggregated requests #9335

Merged
merged 5 commits into from
Aug 22, 2024

Conversation

JinheLin
Copy link
Contributor

@JinheLin JinheLin commented Aug 20, 2024

What problem does this PR solve?

Issue Number: close #9334

Problem Summary:

In StorageDisaggregated, the call chain buildReadTaskForWriteNode => buildReadTaskForWriteNodeTable => buildRNReadSegmentTask will create a DynamicThreadManager in each functions.

The total number of threads used in StorageDisaggregated is about request_count * batch_cop_tasks.size() * resp.tables().size() * table.segments().size().

What is changed and how it works?

Use IOThreadPool to replace DynamicThreadManager.

If the number of tasks is greater than the number of threads, DynamicThreadManager will create new threads to handle these tasks, while IOThreadPool will make these tasks queue up.

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
  • No code

Side effects

  • Performance regression: Consumes more CPU
  • Performance regression: Consumes more Memory
  • Breaking backward compatibility

Documentation

  • Affects user behaviors
  • Contains syntax changes
  • Contains variable changes
  • Contains experimental features
  • Changes MySQL compatibility

Release note

Reduce the number of threads created for handling disaggregated requests

减少处理存算分离请求创建的线程数

@ti-chi-bot ti-chi-bot bot added do-not-merge/needs-triage-completed do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. release-note-none Denotes a PR that doesn't merit a release note. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Aug 20, 2024
@JinheLin
Copy link
Contributor Author

/retest

@JinheLin JinheLin changed the title WIP: Disagg: Fix the issue that creating too many threads in StorageDisaggregated WIP: Disagg: Reduce the number of threads created for handling disaggregated requests Aug 20, 2024
@ti-chi-bot ti-chi-bot bot added release-note Denotes a PR that will be considered when it comes time to generate release notes. and removed release-note-none Denotes a PR that doesn't merit a release note. labels Aug 20, 2024
@JinheLin JinheLin changed the title WIP: Disagg: Reduce the number of threads created for handling disaggregated requests Disagg: Reduce the number of threads created for handling disaggregated requests Aug 21, 2024
@ti-chi-bot ti-chi-bot bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Aug 21, 2024
@ti-chi-bot ti-chi-bot bot added needs-1-more-lgtm Indicates a PR needs 1 more LGTM. approved labels Aug 21, 2024
Copy link
Member

@CalvinNeo CalvinNeo left a comment

Choose a reason for hiding this comment

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

lgtm

Copy link
Contributor

ti-chi-bot bot commented Aug 22, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: CalvinNeo, Lloyd-Pottiger

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:
  • OWNERS [CalvinNeo,Lloyd-Pottiger]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ti-chi-bot ti-chi-bot bot added lgtm and removed needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Aug 22, 2024
Copy link
Contributor

ti-chi-bot bot commented Aug 22, 2024

[LGTM Timeline notifier]

Timeline:

  • 2024-08-21 07:17:05.613968162 +0000 UTC m=+336220.748418283: ☑️ agreed by Lloyd-Pottiger.
  • 2024-08-22 05:07:09.893567167 +0000 UTC m=+414825.028017284: ☑️ agreed by CalvinNeo.

Copy link
Contributor

ti-chi-bot bot commented Aug 22, 2024

@JinheLin: Your PR was out of date, I have automatically updated it for you.

At the same time I will also trigger all tests for you:

/run-all-tests

trigger some heavy tests which will not run always when PR updated.

If the CI test fails, you just re-trigger the test that failed and the bot will merge the PR for you after the CI passes.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the ti-community-infra/tichi repository.

@ti-chi-bot ti-chi-bot bot merged commit fe07443 into pingcap:master Aug 22, 2024
5 checks passed
@ti-chi-bot ti-chi-bot added the needs-cherry-pick-release-8.1 Should cherry pick this PR to release-8.1 branch. label Aug 23, 2024
@ti-chi-bot
Copy link
Member

In response to a cherrypick label: new pull request created to branch release-8.1: #9346.

JinheLin added a commit that referenced this pull request Sep 3, 2024
…ed requests (#9335)

close #9334

Use IOThreadPool to replace DynamicThreadManager.

Co-authored-by: ti-chi-bot[bot] <108142056+ti-chi-bot[bot]@users.noreply.github.com>
@ti-chi-bot ti-chi-bot bot removed the needs-cherry-pick-release-8.1 Should cherry pick this PR to release-8.1 branch. label Sep 4, 2024
@ti-chi-bot ti-chi-bot bot added the needs-cherry-pick-release-7.5 Should cherry pick this PR to release-7.5 branch. label Nov 29, 2024
@ti-chi-bot
Copy link
Member

In response to a cherrypick label: new pull request created to branch release-7.5: #9685.

ti-chi-bot pushed a commit to ti-chi-bot/tiflash that referenced this pull request Nov 29, 2024
@ti-chi-bot ti-chi-bot bot removed the needs-cherry-pick-release-7.5 Should cherry pick this PR to release-7.5 branch. label Nov 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved lgtm release-note Denotes a PR that will be considered when it comes time to generate release notes. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

disagg: too many request make tiflash compute node crash
4 participants