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

util: support float cgroup cpu quota (#8425) #8427

Merged
merged 5 commits into from
Sep 8, 2020

Conversation

ti-srebot
Copy link
Contributor

cherry-pick #8425 to release-4.0


What problem does this PR solve?

Issue Number: close #8423

Problem Summary:

The CPU quota set in cgroup can be an arbitrary float but we don't handle it. TiKV considers the CPU quota is 0 if the quota is less than 1.

What is changed and how it works?

What's Changed:

Let cpu_cores_quota just return an f64 and change calculations just use the float cpu quota.

Coprocessor max_concurrency is also set to not less than 4. Such a number should not cause OOM.

Related changes

  • Need to cherry-pick to the release branch

Check List

Tests

  • Manual test (add detailed scripts or steps below)

    • Set cgroup cpu quota to a float and see the calculated thread number. For example, set cgroup cpu quota to 6.5 cores, then the default coprocessor pool should have 5 threads (previously 4).
    • Set cgroup cpu quota to a very small number, end_point_max_concurrency will be at least 4.

Release note

Support float CPU quota in cgroup.

Signed-off-by: ti-srebot <ti-srebot@pingcap.com>
@ti-srebot
Copy link
Contributor Author

/run-all-tests

@ti-srebot ti-srebot added component/configuration Component: Configuration type/cherry-pick Type: PR - Cherry pick labels Aug 11, 2020
@ti-srebot ti-srebot requested a review from BusyJay August 11, 2020 05:26
@sticnarf sticnarf added this to the Pool milestone Aug 11, 2020
@ti-srebot ti-srebot added the status/LGT1 Indicates that a PR has LGTM 1. label Aug 11, 2020
@ti-srebot ti-srebot added status/LGT2 Indicates that a PR has LGTM 2. and removed status/LGT1 Indicates that a PR has LGTM 1. labels Aug 31, 2020
Signed-off-by: Yilin Chen <sticnarf@gmail.com>
@sticnarf
Copy link
Contributor

sticnarf commented Sep 8, 2020

/merge

@ti-srebot ti-srebot added the status/can-merge Indicates a PR has been approved by a committer. label Sep 8, 2020
@ti-srebot
Copy link
Contributor Author

Your auto merge job has been accepted, waiting for:

  • 8524
  • 8560
  • 8393

@ti-srebot
Copy link
Contributor Author

/run-all-tests

@ti-srebot
Copy link
Contributor Author

@ti-srebot merge failed.

@sticnarf
Copy link
Contributor

sticnarf commented Sep 8, 2020

/merge

@sticnarf
Copy link
Contributor

sticnarf commented Sep 8, 2020

/run-integration-common-test

@ti-srebot
Copy link
Contributor Author

/run-all-tests

@ti-srebot
Copy link
Contributor Author

@ti-srebot merge failed.

@sticnarf
Copy link
Contributor

sticnarf commented Sep 8, 2020

/test

1 similar comment
@sticnarf
Copy link
Contributor

sticnarf commented Sep 8, 2020

/test

@sticnarf sticnarf modified the milestones: Pool, v4.0.6 Sep 8, 2020
@sticnarf sticnarf added the priority/release-blocker This issue blocks a release. Please solve it ASAP. label Sep 8, 2020
@Connor1996
Copy link
Member

/merge

@ti-srebot
Copy link
Contributor Author

Your auto merge job has been accepted, waiting for:

  • 8460
  • 8497
  • 8446
  • 8524
  • 8560
  • 8463
  • 8620

@ti-srebot
Copy link
Contributor Author

/run-all-tests

@ti-srebot
Copy link
Contributor Author

@ti-srebot merge failed.

@sticnarf
Copy link
Contributor

sticnarf commented Sep 8, 2020

/merge

@ti-srebot
Copy link
Contributor Author

/run-all-tests

@sticnarf
Copy link
Contributor

sticnarf commented Sep 8, 2020

/merge

@ti-srebot
Copy link
Contributor Author

Your auto merge job has been accepted, waiting for:

  • 8618

@ti-srebot ti-srebot merged commit d29ad11 into tikv:release-4.0 Sep 8, 2020
baurine added a commit to ti-srebot/tikv that referenced this pull request Sep 21, 2020
baurine added a commit to ti-srebot/tikv that referenced this pull request Sep 21, 2020
- related PRs: tikv#8425, tikv#8427

Signed-off-by: baurine <2008.hbl@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/configuration Component: Configuration priority/release-blocker This issue blocks a release. Please solve it ASAP. status/can-merge Indicates a PR has been approved by a committer. status/LGT2 Indicates that a PR has LGTM 2. type/cherry-pick Type: PR - Cherry pick
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants