store/gc_worker: Consider a large number of TiKV instances when setting the default concurrency for the GC worker
- Dominant language
- Go
- Stars
- 40.5k
- Forks
- 6.2k
- PR merge metrics
- PR metrics pending
Description
## Enhancement
we use [tidb_gc_concurrency](https://docs.pingcap.com/tidb/stable/system-variables#tidb_gc_concurrency-new-in-v50) to control the number of threads in steps of GC, with the deafult value -1 means that TiDB will automatically use the number of tikv instances as the default value
https://github.com/pingcap/tidb/blob/821e491a20fbab36604b36b647b5bae26a2c1418/pkg/store/gcworker/gc_worker.go#L611
However, when the number of store instance is big, The TiDB where the gc worker is located will be very busy, causing resource hotspots(CPU/memory/..) and performance jitter in this TiDB.

Contributor guide
Assessment
This issue has not been assessed yet.