Skip to content

in_memory_engine: adjust the default config#17751

Merged
ti-chi-bot[bot] merged 12 commits intotikv:masterfrom
glorv:ime-default-cfg
Nov 5, 2024
Merged

in_memory_engine: adjust the default config#17751
ti-chi-bot[bot] merged 12 commits intotikv:masterfrom
glorv:ime-default-cfg

Conversation

@glorv
Copy link
Contributor

@glorv glorv commented Oct 31, 2024

What is changed and how it works?

Issue Number: ref #16141, close #17762

What's Changed:

Let in_memory_engine's config`evict-threshold` and `stop-load-threshold`
default value generated from `capacity`.
  • in_memory_engine config default value:
    • evict-threshold: default value set to capacity - min(capacity * 0.1, 200MiB)
    • stop-load-threshold: default value set to: evict_threshold - min(capacity * 0.15, region_split_size * 2 + 200MiB)
    • set the minimal value of load-evict-interval to 120s as the background task will skip the check if the interval is small than 90s.
  • Demote some logs in LoadEvictObserver from info to debug as RegionManager will also output these logs.
  • Change 2 IME load/evcit metrics expression from rate to delta as the rate is too small and we care the actual event number than its rate.

Related changes

  • PR to update pingcap/docs/pingcap/docs-cn:
  • Need to cherry-pick to the release branch

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

Release note

None

Signed-off-by: glorv <glorvs@163.com>
@ti-chi-bot ti-chi-bot bot added release-note-none Denotes a PR that doesn't merit a release note. dco-signoff: yes Indicates the PR's author has signed the dco. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Oct 31, 2024
Copy link
Member

@overvenus overvenus 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

// The maximum interval for GC run is 10 minutes which equals to the minimum
// value of TiDB GC lifetime.
const MAX_GC_RUN_INTERVAL: Duration = Duration::from_secs(600);
// the maximum write kv throughput(20MiB), this is an empiracal value.
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
// the maximum write kv throughput(20MiB), this is an empiracal value.
// the maximum write kv throughput(20MiB), this is an empirical value.

const MAX_GC_RUN_INTERVAL: Duration = Duration::from_secs(600);
// the maximum write kv throughput(20MiB), this is an empiracal value.
const MAX_WRITE_KV_SPEED: u64 = 20 * 1024 * 1024;
// The maximun duration in seconds we expect IME to release enough memory after
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
// The maximun duration in seconds we expect IME to release enough memory after
// The maximum duration in seconds we expect IME to release enough memory after

// We use this value to determine the default value of `evict_threshold` based
// on `capacity`.
const MAX_RESERVED_DURATION_FOR_WRITE: u64 = 10;
// Regions' mvcc read amplificatoin statistics is updated every 1min, so we set
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
// Regions' mvcc read amplificatoin statistics is updated every 1min, so we set
// Regions' mvcc read amplification statistics is updated every 1min, so we set

@glorv glorv requested a review from zhangjinpeng87 November 1, 2024 06:25
@ti-chi-bot ti-chi-bot bot added the needs-1-more-lgtm Indicates a PR needs 1 more LGTM. label Nov 1, 2024
@glorv
Copy link
Contributor Author

glorv commented Nov 1, 2024

/retest

Copy link
Member

@overvenus overvenus 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

// the maximum write kv throughput(20MiB), this is an empirical value.
const MAX_WRITE_KV_SPEED: u64 = 20 * 1024 * 1024;
// The maximum duration in seconds we expect IME to release enough memory after
// memory usage reaches `evict_threshold`. This is an empiracal value.
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
// memory usage reaches `evict_threshold`. This is an empiracal value.
// memory usage reaches `evict_threshold`. This is an empirical value.

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

ti-chi-bot bot commented Nov 1, 2024

[LGTM Timeline notifier]

Timeline:

  • 2024-11-01 06:31:06.186804684 +0000 UTC m=+590579.025960222: ☑️ agreed by SpadeA-Tang.
  • 2024-11-01 09:36:27.538416544 +0000 UTC m=+601700.377572085: ☑️ agreed by overvenus.

glorv and others added 4 commits November 1, 2024 17:41
@glorv
Copy link
Contributor Author

glorv commented Nov 3, 2024

/retest

@glorv glorv added the needs-cherry-pick-release-8.5 Should cherry pick this PR to release-8.5 branch. label Nov 4, 2024
@glorv
Copy link
Contributor Author

glorv commented Nov 4, 2024

/retest

@glorv
Copy link
Contributor Author

glorv commented Nov 4, 2024

@zhangjinpeng87 PTAL

@ti-chi-bot
Copy link
Contributor

ti-chi-bot bot commented Nov 5, 2024

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

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.

Details

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.

Copy link
Member

@zhangjinpeng87 zhangjinpeng87 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
Copy link
Contributor

ti-chi-bot bot commented Nov 5, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: overvenus, SpadeA-Tang, zhangjinpeng87

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

The pull request process is described here

Details Needs approval from an approver in each of these files:

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 the approved label Nov 5, 2024
@ti-chi-bot ti-chi-bot bot merged commit 601f34d into tikv:master Nov 5, 2024
@ti-chi-bot ti-chi-bot bot added this to the Pool milestone Nov 5, 2024
@ti-chi-bot
Copy link
Member

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

@glorv glorv deleted the ime-default-cfg branch November 5, 2024 03:29
glorv added a commit to ti-chi-bot/tikv that referenced this pull request Nov 5, 2024
ref tikv#16141, close tikv#17762

Let in_memory_engine's config`evict-threshold` and `stop-load-threshold`
default value generated from `capacity`.

Signed-off-by: glorv <glorvs@163.com>
ti-chi-bot bot pushed a commit that referenced this pull request Nov 5, 2024
ref #16141, close #17762

Let in_memory_engine's config`evict-threshold` and `stop-load-threshold`
default value generated from `capacity`.

Signed-off-by: glorv <glorvs@163.com>

Co-authored-by: glorv <glorvs@163.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved dco-signoff: yes Indicates the PR's author has signed the dco. lgtm needs-cherry-pick-release-8.5 Should cherry pick this PR to release-8.5 branch. 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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

In-Memory-Engine's default configuration is not accurate

5 participants