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: improve cgroup to support Vertical Pod Autoscaler #36901

Merged
merged 13 commits into from
Sep 21, 2022

Conversation

hawkingrei
Copy link
Member

@hawkingrei hawkingrei commented Aug 4, 2022

Signed-off-by: Weizhen Wang wangweizhen@pingcap.com

What problem does this PR solve?

Issue Number: ref #37707

close #36894

Problem Summary:

What is changed and how it works?

support CGroup v1/v2 to read CPU/memory info.

Check List

Tests

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

You can try it in the k8s and change CPU core by VPA

[root@172 gogctuner]# curl http://10.0.2.204:10080/metrics |grep tidb_server_maxprocs
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0# HELP tidb_server_maxprocs The value of GOMAXPROCS.
# TYPE tidb_server_maxprocs gauge
tidb_server_maxprocs 8
100  516k    0  516k    0     0  36.8M      0 --:--:-- --:--:-- --:--:-- 38.7M

Release note

Please refer to Release Notes Language Style Guide to write a quality release note.

None

@ti-chi-bot
Copy link
Member

ti-chi-bot commented Aug 4, 2022

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • Benjamin2037
  • Defined2014

To complete the pull request process, please ask the reviewers in the list to review by filling /cc @reviewer in the comment.
After your PR has acquired the required number of LGTMs, you can assign this pull request to the committer in the list by filling /assign @committer in the comment to help you merge this pull request.

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

Reviewer can indicate their review by submitting an approval review.
Reviewer can cancel approval by submitting a request changes review.

@ti-chi-bot ti-chi-bot added do-not-merge/needs-linked-issue release-note-none Denotes a PR that doesn't merit a release note. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Aug 4, 2022
@hawkingrei hawkingrei added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Aug 4, 2022
@ti-chi-bot ti-chi-bot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. and removed size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Aug 9, 2022
@ti-chi-bot ti-chi-bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Aug 9, 2022
@hawkingrei hawkingrei changed the title util: get cpu core from cgroup to support Vertical Pod Autoscaler util: get cpu/memory info from cgroup to support Vertical Pod Autoscaler Aug 10, 2022
@ti-chi-bot ti-chi-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 10, 2022
@hawkingrei hawkingrei force-pushed the cgroup branch 2 times, most recently from db2d61b to 7c9d543 Compare August 11, 2022 09:15
@hawkingrei hawkingrei removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Aug 11, 2022
@hawkingrei
Copy link
Member Author

/gray-debug

@ti-chi-bot
Copy link
Member

Build triggered for merge commit.

4 similar comments
@ti-chi-bot
Copy link
Member

Build triggered for merge commit.

@ti-chi-bot
Copy link
Member

Build triggered for merge commit.

@ti-chi-bot
Copy link
Member

Build triggered for merge commit.

@ti-chi-bot
Copy link
Member

Build triggered for merge commit.

@sre-bot
Copy link
Contributor

sre-bot commented Aug 11, 2022

@hawkingrei hawkingrei requested a review from a team as a code owner August 12, 2022 03:38
@hawkingrei hawkingrei changed the title util: get cpu/memory info from cgroup to support Vertical Pod Autoscaler util: support Vertical Pod Autoscaler Aug 12, 2022
@hawkingrei
Copy link
Member Author

/run-unit-test

@hawkingrei
Copy link
Member Author

/run-build

@ti-chi-bot ti-chi-bot added needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. and removed needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. labels Aug 27, 2022
hawkingrei and others added 3 commits September 20, 2022 19:12
Co-authored-by: Hangjie Mo <mohangjie1995@gmail.com>
Co-authored-by: Hangjie Mo <mohangjie1995@gmail.com>
Signed-off-by: Weizhen Wang <wangweizhen@pingcap.com>
Signed-off-by: Weizhen Wang <wangweizhen@pingcap.com>
@hawkingrei
Copy link
Member Author

@tangenta PTAL

@ti-chi-bot ti-chi-bot added release-note-none Denotes a PR that doesn't merit a release note. and removed release-note Denotes a PR that will be considered when it comes time to generate release notes. labels Sep 21, 2022
@hawkingrei hawkingrei changed the title util: support Vertical Pod Autoscaler for CPU util: improve cgroup to support Vertical Pod Autoscaler Sep 21, 2022
Copy link
Collaborator

@Benjamin2037 Benjamin2037 left a comment

Choose a reason for hiding this comment

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

LGTM

@ti-chi-bot ti-chi-bot added status/LGT2 Indicates that a PR has LGTM 2. and removed status/LGT1 Indicates that a PR has LGTM 1. labels Sep 21, 2022
@hawkingrei
Copy link
Member Author

/merge

@ti-chi-bot
Copy link
Member

This pull request has been accepted and is ready to merge.

Commit hash: 29ec80a

@ti-chi-bot ti-chi-bot added the status/can-merge Indicates a PR has been approved by a committer. label Sep 21, 2022
@hawkingrei
Copy link
Member Author

/run-build

@ti-chi-bot
Copy link
Member

@hawkingrei: 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

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.

@hawkingrei
Copy link
Member Author

/run-unit-test

@ti-chi-bot ti-chi-bot merged commit e016a7d into pingcap:master Sep 21, 2022
@hawkingrei hawkingrei deleted the cgroup branch September 21, 2022 13:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release-note-none Denotes a PR that doesn't merit a release note. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. status/can-merge Indicates a PR has been approved by a committer. status/LGT2 Indicates that a PR has LGTM 2.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

use cgroup to get cpu core
7 participants