diff --git a/docs/tidb-lightning-user-guide.md b/docs/tidb-lightning-user-guide.md index 072510ef270dc..09f591b1da4d7 100644 --- a/docs/tidb-lightning-user-guide.md +++ b/docs/tidb-lightning-user-guide.md @@ -57,7 +57,7 @@ The following are the hardware requirements for deploying one set of TiDB Lighti - 16 GB+ memory - 1 TB+ SSD - 10 Gigabit network card - - Need to be deployed separately from the online business because TiDB Lighting fully consumes the CPU during runtime. Under certain circumstances, you can deploy it along with another component (like `tidb-server`) on one machine and configure to limit the CPU usage of `tidb-lightning`. See the `worker-pool-size` part in the first step of [Deploy `tidb-lightning`](#deploy-tidb-lightning). + - Need to be deployed separately from the online business because TiDB Lighting fully consumes the CPU during runtime. Under certain circumstances, you can deploy it along with another component (like `tidb-server`) on one machine and configure to limit the CPU usage of `tidb-lightning`. See the `region-concurrency` part in the first step of [Deploy `tidb-lightning`](#deploy-tidb-lightning). - tikv-importer @@ -76,9 +76,9 @@ Under certain circumstances, you can deploy `tidb-lightning` and `tikv-importer` - 1 TB+ SSD - 10 Gigabit network card -> **Note:** `tidb-lightning` is CPU intensive. If you use mixed deployment for it, you need to configure `worker-pool-size` to limit the number of occupied CPU cores of `tidb-lightning`. Otherwise other applications may be affected. +> **Note:** `tidb-lightning` is CPU intensive. If you use mixed deployment for it, you need to configure `region-concurrency` to limit the number of occupied CPU cores of `tidb-lightning`. Otherwise other applications may be affected. -> You can configure the `worker-pool-size` parameter of `tidb-lightning` to allocate 75% of CPU resources to `tidb-lightning`. For example, if CPU has 32 logical cores, you can set `worker-pool-size` to 24. +> You can configure the `region-concurrency` parameter of `tidb-lightning` to allocate 75% of CPU resources to `tidb-lightning`. For example, if CPU has 32 logical cores, you can set `region-concurrency` to 24. ### Prepare @@ -168,9 +168,14 @@ For details, see [Deploy TiDB Using Ansible](https://pingcap.com/docs/op-guide/a # background profile for debugging ( 0 to disable ) pprof-port = 10089 - # change the concurrency number of data. It is set to the number of logical CPU cores by default and needs no configuration. + + # table-concurrency controls the maximum handled tables concurrently while reading Mydumper SQL files. It can affect the tikv-importer memory usage amount. + table-concurrency = 8 + # region-concurrency changes the concurrency number of data. It is set to the number of logical CPU cores by default and needs no configuration. # in mixed configuration, you can set it to 75% of the size of logical CPU cores. - # worker-pool-size = + # region-concurrency default to runtime.NumCPU() + # region-concurrency = + # logging level = "info" diff --git a/lightning/config/config.go b/lightning/config/config.go index 5f0c032d36982..8e393c623891f 100644 --- a/lightning/config/config.go +++ b/lightning/config/config.go @@ -61,7 +61,6 @@ func (c *Config) String() string { type Lightning struct { common.LogConfig - WorkerPoolSize int `toml:"worker-pool-size" json:"worker-pool-size"` TableConcurrency int `toml:"table-concurrency" json:"table-concurrency"` RegionConcurrency int `toml:"region-concurrency" json:"region-concurrency"` ProfilePort int `toml:"pprof-port" json:"pprof-port"` @@ -89,7 +88,6 @@ type TikvImporter struct { func NewConfig() *Config { return &Config{ App: Lightning{ - WorkerPoolSize: runtime.NumCPU(), RegionConcurrency: runtime.NumCPU(), TableConcurrency: 8, }, diff --git a/tidb-lightning.toml b/tidb-lightning.toml index 6bc3babaeb4c3..8930ed5619087 100644 --- a/tidb-lightning.toml +++ b/tidb-lightning.toml @@ -4,9 +4,11 @@ # background profile for debuging ( 0 to disable ) pprof-port = 10089 -# number of workers to restore tables (default to `runtime.NumCPU()`). -# worker-pool-size = + +# table-concurrency controls the maximum handled tables concurrently while reading Mydumper SQL files. It can affect the tikv-importer memory usage. table-concurrency = 8 +# region-concurrency changes the concurrency number of data. It is set to the number of logical CPU cores by default and needs no configuration. +# In mixed configuration, you can set it to 75% of the size of logical CPU cores. # region-concurrency default to runtime.NumCPU() # region-concurrency =