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

token-limit 配置项最大值不合理 #17195

Open
x-ainger opened this issue Apr 23, 2024 · 3 comments · May be fixed by #17365 or pingcap/docs#17860
Open

token-limit 配置项最大值不合理 #17195

x-ainger opened this issue Apr 23, 2024 · 3 comments · May be fixed by #17365 or pingcap/docs#17860
Assignees

Comments

@x-ainger
Copy link

File: /release-7.5/tidb-configuration-file.md

最大值(64 位平台):18446744073709551615
最大值(32 位平台):4294967295

相关代码:
func NewTokenLimiter(count uint) *TokenLimiter {
tl := &TokenLimiter{count: count, ch: make(chan *Token, count)}
for i := uint(0); i < count; i++ {
tl.ch <- &Token{}
}

return tl

}

TiDB运行时,会初始化指定长度的 channel,若设置过大,会导致 TiDB OOM 无法启动。建议限制该配置项的最大值

@Oreoxmt
Copy link
Collaborator

Oreoxmt commented Apr 23, 2024

@djshow832 Could you please take a look at this issue? Thanks!

@djshow832
Copy link
Contributor

I have filed an issue for TiDB: pingcap/tidb#53312

Currently, we have 2 ways to fix the doc:

  1. Fix the issue on TiDB and then update the value in docs for branch dev (I don't think this bugfix needs to be cherry-picked into previous versions)
  2. Recommend the users to set the value according to the memory of the machine and warn them

@djshow832
Copy link
Contributor

After discussion, we chose the 1st solution.

@djshow832 djshow832 linked a pull request May 20, 2024 that will close this issue
16 tasks
@qiancai qiancai linked a pull request Jun 11, 2024 that will close this issue
16 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants