pingcap / pingcap/tidb

store/gc_worker: Consider a large number of TiKV instances when setting the default concurrency for the GC worker

Open
#55,075 0 comments 0 reactions 1 assignee Claimed by @MyonKeminta View on GitHub
component/GC sig/transaction type/enhancement
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.
![image](https://github.com/user-attachments/assets/db5e1aa7-1223-4582-8f5c-d311000cf730)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.