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

Add pd global memory limiter and gctuner #5848

Merged
merged 38 commits into from
Feb 9, 2023
Merged

Conversation

hnes
Copy link
Contributor

@hnes hnes commented Jan 10, 2023

What problem does this PR solve?

Issue Number: Close #5827

What is changed and how does it work?

This PR is mainly based on the former support GC tuner PR from @rleungx and the gctuner implementation in TiDB

Add pd global memory limiter and gctuner

Check List

Tests

  • Unit test

Code changes

  • Has configuration change

Related changes

Release note

None

@ti-chi-bot
Copy link
Member

ti-chi-bot commented Jan 10, 2023

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • nolouch
  • rleungx

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/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. needs-ok-to-test Indicates a PR created by contributors and need ORG member send '/ok-to-test' to start testing. labels Jan 10, 2023
@ti-chi-bot
Copy link
Member

Hi @hnes. Thanks for your PR.

I'm waiting for a tikv member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

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 kubernetes/test-infra repository.

@ti-chi-bot ti-chi-bot requested review from rleungx and Yisaer January 10, 2023 08:44
go.mod Outdated Show resolved Hide resolved
pkg/cgroup/cgroup.go Outdated Show resolved Hide resolved
pkg/gctuner/memory_limit_tuner.go Outdated Show resolved Hide resolved
@ti-chi-bot ti-chi-bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jan 10, 2023
@ti-chi-bot ti-chi-bot added release-note-none Denotes a PR that doesn't merit a release note. and removed do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. labels Jan 12, 2023
pkg/cgroup/cgroup_cpu.go Outdated Show resolved Hide resolved
server/config/config.go Outdated Show resolved Hide resolved
@rleungx
Copy link
Member

rleungx commented Feb 8, 2023

/ok-to-test

@ti-chi-bot ti-chi-bot added ok-to-test Indicates a PR is ready to be tested. and removed needs-ok-to-test Indicates a PR created by contributors and need ORG member send '/ok-to-test' to start testing. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. labels Feb 8, 2023
@codecov
Copy link

codecov bot commented Feb 9, 2023

Codecov Report

Base: 75.35% // Head: 75.12% // Decreases project coverage by -0.23% ⚠️

Coverage data is based on head (e8f6755) compared to base (28a95cd).
Patch coverage: 66.05% of modified lines in pull request are covered.

❗ Current head e8f6755 differs from pull request most recent head 9312795. Consider uploading reports for the commit 9312795 to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #5848      +/-   ##
==========================================
- Coverage   75.35%   75.12%   -0.23%     
==========================================
  Files         348      358      +10     
  Lines       35486    36085     +599     
==========================================
+ Hits        26741    27110     +369     
- Misses       6414     6593     +179     
- Partials     2331     2382      +51     
Flag Coverage Δ
unittests 75.12% <66.05%> (-0.23%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
server/config/persist_options.go 91.98% <0.00%> (-1.20%) ⬇️
server/config/config.go 75.92% <29.62%> (-1.69%) ⬇️
pkg/memory/meminfo.go 35.36% <35.36%> (ø)
pkg/memory/memstats.go 35.71% <35.71%> (ø)
pkg/cgroup/cgroup_cpu_linux.go 38.88% <38.88%> (ø)
pkg/gogc/gogc.go 63.63% <63.63%> (ø)
pkg/cgroup/cgroup.go 67.77% <67.77%> (ø)
pkg/gctuner/tuner.go 72.00% <72.00%> (ø)
pkg/cgroup/cgroup_cpu.go 78.12% <78.12%> (ø)
server/cluster/cluster.go 81.49% <78.84%> (-0.14%) ⬇️
... and 34 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

server/cluster/cluster.go Outdated Show resolved Hide resolved
server/cluster/cluster.go Outdated Show resolved Hide resolved
server/cluster/cluster.go Outdated Show resolved Hide resolved
Copy link
Member

@rleungx rleungx left a comment

Choose a reason for hiding this comment

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

The rest LGTM

@ti-chi-bot ti-chi-bot added the status/LGT1 Indicates that a PR has LGTM 1. label Feb 9, 2023
Signed-off-by: Sen Han <[email protected]>
defer tick.Stop()
totalMem, err := memory.MemTotal()
if err != nil {
log.Fatal("fail to get total-mem:%s", zap.Error(err))
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
log.Fatal("fail to get total-mem:%s", zap.Error(err))
log.Fatal("fail to get total memory", zap.Error(err))

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks a lot.

Copy link
Contributor

@nolouch nolouch left a comment

Choose a reason for hiding this comment

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

rest lgtm

defer logutil.LogPanic()
defer c.wg.Done()

tick := time.NewTicker(10 * time.Second)
Copy link
Contributor

Choose a reason for hiding this comment

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

better to be a const.

@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 Feb 9, 2023
@nolouch
Copy link
Contributor

nolouch commented Feb 9, 2023

/merge

@ti-chi-bot
Copy link
Member

@nolouch: It seems you want to merge this PR, I will help you trigger all the tests:

/run-all-tests

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
Copy link
Member

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

Commit hash: 9312795

@ti-chi-bot ti-chi-bot added the status/can-merge Indicates a PR has been approved by a committer. label Feb 9, 2023
@ti-chi-bot ti-chi-bot merged commit 0e08a5e into tikv:master Feb 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ok-to-test Indicates a PR is ready to be tested. release-note-none Denotes a PR that doesn't merit a release note. 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.

PD Global Memory Limiter
4 participants