-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Deprecate config item max-memory
and add items server-memory-quota
and memory-usage-alarm-ratio
#4706
Conversation
Co-authored-by: Keke Yi <40977455+yikeke@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@wshwsh12 Please help request a tech review. |
tidb-configuration-file.md
Outdated
|
||
+ TiDB 内存使用报警阈值。 | ||
+ 默认值:0.8 | ||
+ 该配置项的有效范围为 0 到 1。 如果配置该选项为 0 或 1,则表示关闭内存阈值报警功能。否则,当 TiDB 检测到内存使用超过了阈值,则会将相关信息记录到目录 `tmp-storage-path/record` 中。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- 这个太简单了,得写下会记录哪些信息, 日志中可能会打印什么内容。
- 此外,关于tmp-storage-path 得加个链接到对应的文档项上去
- server-memory-quota 也需要加个链接到对应的文档项上
- system memory size 换成中文
Please resolve the conflicts. @wshwsh12 |
tidb-configuration-file.md
Outdated
+ TiDB 内存使用报警阈值。 | ||
+ 默认值:0.8 | ||
+ 该配置项的有效范围为 0 到 1。 如果配置该选项为 0 或 1,则表示关闭内存阈值报警功能。否则,当 TiDB 检测到内存使用超过了阈值,我们认为 TiDB 目前存在 OOM 的风险,会将当前正在执行的所有 SQLs 中内存使用最高的 10 条 SQL 和运行时间最长的 10 条 SQL 以及 heap profile 记录到目录 [`tmp-storage-path/record`](/tidb-configuration-file.md#tmp-storage-path) 中,并输出一条包含关键子 `the Tidb instance has the risk of OOM` 的日志。 | ||
+ 注意:如果配置项 [`server-memory-quota`](/tidb-configuration-file.md#server-memory-quota) 被设置且大于 0,则内存报警阈值将为 `memory-usage-alarm-ratio * server-memory-quota`;否则,内存报警阈值将为 `memory-usage-alarm-ratio * 系统内存大小`。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
此处提到内存报警阈值为 memory-usage-alarm-ratio
与 server-memory-quota
两个配置项的值的乘积,但第 294 行对 memory-usage-alarm-ratio
这个配置项的解释也是“TiDB 内存使用报警阈值”,前后有点矛盾。而从配置项名称中的“ratio”来看,应该这个配置项的值规定的是内存使用达到何种比例时报警,是否考虑修改一下第 294 行对配置项的说明?
@yikeke, @XuHuaiyu, @CharLotteiu, PTAL. |
1 similar comment
@yikeke, @XuHuaiyu, @CharLotteiu, PTAL. |
Co-authored-by: Keke Yi <40977455+yikeke@users.noreply.github.com>
LGTM. @yikeke PTAL. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@wshwsh12 PTAL. 我重新组织了下这三段的逻辑,希望这样更清楚些:
Co-authored-by: Keke Yi <40977455+yikeke@users.noreply.github.com>
Co-authored-by: Keke Yi <40977455+yikeke@users.noreply.github.com>
Co-authored-by: Keke Yi <40977455+yikeke@users.noreply.github.com>
Note: After pingcap/tidb#20473 is merged, we need a 4.0 cherry-pick of this PR. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@wshwsh12, please update your pull request. |
@yikeke, @XuHuaiyu, @CharLotteiu, PTAL. |
@wshwsh12, please update your pull request. |
@yikeke, @XuHuaiyu, @CharLotteiu, PTAL. |
@wshwsh12, please update your pull request. |
No updates for a long time, close PR. |
@yikeke, @XuHuaiyu, @CharLotteiu, PTAL. |
Why closed it? @wshwsh12 |
It needs more information(eg. independent page in troubleshooting) to introduce all memory config. |
What is changed, added or deleted? (Required)
Deprecate config item
max-memory
and add itemsserver-memory-quota
andmemory-usage-alarm-ratio
max-memory
has been deprecated and useserver-memory-quota
instead now.memory-usage-alarm-ratio
is introduced in this pr pingcap/tidb#18858.Which TiDB version(s) do your changes apply to? (Required)
What is the related PR or file link(s)?
Do your changes match any of the following descriptions?