docs-cn icon indicating copy to clipboard operation
docs-cn copied to clipboard

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

Open x-ainger opened this issue 1 year ago • 3 comments

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 无法启动。建议限制该配置项的最大值

x-ainger avatar Apr 23 '24 08:04 x-ainger

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

Oreoxmt avatar Apr 23 '24 08:04 Oreoxmt

I have filed an issue for TiDB: https://github.com/pingcap/tidb/issues/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 avatar May 16 '24 02:05 djshow832

After discussion, we chose the 1st solution.

djshow832 avatar May 16 '24 03:05 djshow832