Skip to content

Commit

Permalink
remove deprecated worker-pool-size option from configuration (pingcap#58
Browse files Browse the repository at this point in the history
)

* remove deprecated worker-pool-size option from configuration

* address comment
  • Loading branch information
holys authored and kennytm committed Aug 23, 2018
1 parent f3f109f commit a21fc36
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 9 deletions.
15 changes: 10 additions & 5 deletions docs/tidb-lightning-user-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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

Expand Down Expand Up @@ -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"
Expand Down
2 changes: 0 additions & 2 deletions lightning/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
Expand Down Expand Up @@ -89,7 +88,6 @@ type TikvImporter struct {
func NewConfig() *Config {
return &Config{
App: Lightning{
WorkerPoolSize: runtime.NumCPU(),
RegionConcurrency: runtime.NumCPU(),
TableConcurrency: 8,
},
Expand Down
6 changes: 4 additions & 2 deletions tidb-lightning.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 =

Expand Down

0 comments on commit a21fc36

Please sign in to comment.