-
Notifications
You must be signed in to change notification settings - Fork 409
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
memory_usage_limit is deduced much less then expected #9745
memory_usage_limit is deduced much less then expected #9745
Comments
After the "memory_usage_high_water" is hit. And the memory usage of "raft_msg_usage + cached_entries + applying_entries" reaches reject_messages_on_memory_ratio. It may cause tiflash reject append msg. In such case, we may see logging as below in the tikv leader side "Raft raft: cannot step raft local message":
|
Also in #9743, will discuss the relationship between reject msgappend and evict cache |
The reject append logic lies
Note that only append msg will be rejected. A peer could be destroyed due to tombstone msg which could happen if the region is moved out of the memory-exhausted machine. |
close #9745 Signed-off-by: Calvin Neo <calvinneo1995@gmail.com> Signed-off-by: JaySon-Huang <tshent@qq.com> Co-authored-by: JaySon <tshent@qq.com>
close pingcap#9745 Signed-off-by: Calvin Neo <calvinneo1995@gmail.com> Signed-off-by: JaySon-Huang <tshent@qq.com> Co-authored-by: JaySon <tshent@qq.com>
/report customer |
close pingcap#9745 Signed-off-by: Calvin Neo <calvinneo1995@gmail.com> Signed-off-by: JaySon-Huang <tshent@qq.com> Co-authored-by: JaySon <tshent@qq.com>
Bug Report
Please answer these questions before submitting your issue. Thanks!
1. Minimal reproduce step (Required)
2. What did you expect to see? (Required)
3. What did you see instead (Required)
4. What is your TiFlash version? (Required)
If not set, memory_usage_limit is inferred by block_cache_cap
https://github.com/pingcap/tidb-engine-ext/blob/521fd9dbc55e58646045d88f91c3c35db50b5981/src/config/mod.rs#L3597-L3598
which is actually set by(I mean it's original value is not this, but the following code will adjust and take final effect)
https://github.com/pingcap/tidb-engine-ext/blob/521fd9dbc55e58646045d88f91c3c35db50b5981/src/config/mod.rs#L3795-L3805
and modified by
https://github.com/pingcap/tidb-engine-ext/blob/521fd9dbc55e58646045d88f91c3c35db50b5981/proxy_components/proxy_server/src/config.rs#L405-L408
See pingcap/tidb-engine-ext@2f2900a.
And tiflash proxy limit the memory for CF to a small number.
https://github.com/pingcap/tidb-engine-ext/blob/521fd9dbc55e58646045d88f91c3c35db50b5981/proxy_components/proxy_server/src/config.rs#L123-L134
The logic affects all released versions including LTS 6.1/6.5/7.1/7.5/8.1/8.5
As a result, consider an enough big memory, the limit could be:
So basicly, the memory limit is 0.05 * total available machine memory / 0.45 * 0.75.
Note, even if the raft-engine is used, we still take the raft_db memory size into account.
And because there is a memory high water machanism, the memory usage on proxy will time another 0.1 factor
So as a result,
The text was updated successfully, but these errors were encountered: