Skip to content

Commit

Permalink
cherry pick pingcap#3003 to release-4.0
Browse files Browse the repository at this point in the history
Signed-off-by: ti-srebot <ti-srebot@pingcap.com>
  • Loading branch information
TomShawn authored and ti-srebot committed Jun 29, 2020
1 parent c442dac commit 7d953bf
Show file tree
Hide file tree
Showing 3 changed files with 62 additions and 20 deletions.
35 changes: 35 additions & 0 deletions command-line-flags-for-tidb-configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@ When you start the TiDB cluster, you can use command-line options or environment
- The TiDB server monitors this address.
- The "0.0.0.0" address monitors all network cards by default. If you have multiple network cards, specify the network card that provides service, such as `192.168.100.113`.

## `--enable-binlog`

+ Enables or disables TiDB binlog generation
+ Default: false

## `-L`

- The log level
Expand Down Expand Up @@ -151,3 +156,33 @@ When you start the TiDB cluster, you can use command-line options or environment

- Outputs the version of TiDB
- Default: ""

## `--plugin-dir`

+ The storage directory for plugins.
+ Default: "/data/deploy/plugin"

## `--plugin-load`

+ The names of the plugins to be loaded, each separated by a comma.
+ Default: ""

## `--affinity-cpus`

+ Sets the CPU affinity of TiDB servers, which is separated by commas. For example, "1,2,3".
+ Default: ""

## `--repair-mode`

+ Determines whether to enable the repair mode, which is only used in the data repair scenario.
+ Default: false

## `--repair-list`

+ The names of the tables to be repaired in the repair mode.
+ Default: ""

## `--require-secure-transport`

+ Determines whether to require the client to use the secure mode for data transport.
+ Default: false
41 changes: 21 additions & 20 deletions tidb-configuration-file.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,15 @@ The TiDB configuration file supports more options than command-line parameters.
- Default value: `true`
- It is recommended to set it to `false` if you need to create a large number of tables.

### `token-limit`

+ The number of sessions that can execute requests concurrently.
+ Default value: `1000`

### `mem-quota-query`

- The maximum memory available for a single SQL statement.
- Default value: `1073741824`
- Default value: `1073741824` (in bytes)
- Requests that require more memory than this value are handled based on the behavior defined by `oom-action`.
- This value is the initial value of the system variable [`tidb_mem_quota_query`](/tidb-specific-system-variables.md#tidb_mem_quota_query).

Expand Down Expand Up @@ -178,6 +183,12 @@ Configuration items related to log.
- Default value: `300ms`
- If the value in a query is larger than the default value, it is a slow query and is output to the slow log.

### `record-plan-in-slow-log`

+ Determines whether to record execution plans in the slow log.
+ Default value: `1`
+ `0` means to disable, and `1` (by default) means to enable. The value of this parameter is the initial value of the [`tidb_record_plan_in_slow_log`](/tidb-specific-system-variables.md#tidb_record_plan_in_slow_log) system variable.

### `expensive-threshold`

- Outputs the threshold value of the number of rows for the `expensive` operation.
Expand Down Expand Up @@ -218,12 +229,6 @@ Configuration items related to log files.
- Default value: `0`
- All the log files are retained by default. If you set it to `7`, seven log files are retained at maximum.

#### `log-rotate`

- Determines whether to create a new log file every day.
- Default value: `true`
- If you set the parameter to `true`, a new log file is created every day. If you set it to `false`, the log is output to a single log file.

## Security

Configuration items related to security.
Expand Down Expand Up @@ -263,11 +268,6 @@ Configuration items related to security.
- The path of the SSL private key file used to connect TiKV or PD with TLS.
- Default value: ""

### `skip-grant-table`

- Determines whether to skip permission check.
- Default value: `false`

## Performance

Configuration items related to performance.
Expand All @@ -292,9 +292,9 @@ Configuration items related to performance.

### `txn-total-size-limit`

- The size limit of a transaction.
- Default value: `104857600`
- The total size of all key-value entries in bytes should be less than this value. Note that if the `binlog` is enabled, this value should be less than `104857600` (which means 100MB), because of the limitation of the binlog component. If `binlog` is not enabled, the maximum value of this configuration is `10737418240` (which means 10GB).
- The size limit of a single transaction in TiDB.
- Default value: `104857600` (in bytes)
- In a single transaction, the total size of key-value records cannot exceed this value. The maximum value of this parameter is `10737418240` (10 GB). Note that if you have used the binlog to serve the downstream consumer Kafka (such as the `arbiter` cluster), the value of this parameter must be no more than `1073741824` (1 GB). This is because 1 GB is the upper limit of a single message size that Kafka can process. Otherwise, an error is returned if this limit is exceeded.

### `tcp-keep-alive`

Expand Down Expand Up @@ -398,11 +398,12 @@ The Plan Cache configuration of the `PREPARE` statement.
- Default value: `41s`
- It is required to set this value larger than twice of the Raft election timeout.

### `max-txn-time-use`
### `max-txn-ttl`

- The maximum execution time allowed for a single transaction.
- Default value: `590`
- unit: second
- The longest time that a single transaction can hold locks. If this time is exceeded, the locks of a transaction might be cleared by other transactions so that this transaction cannot be successfully committed.
- Default value: `600000`
- Unit: Millisecond
- The transaction that holds locks longer than this time can only be committed or rolled back. The commit might not be successful.

### `max-batch-size`

Expand Down Expand Up @@ -535,7 +536,7 @@ Configurations related to the `events_statement_summary_by_digest` table.

### max-retry-count

- The max number of retries of each statement in pessimistic transactions. Exceeding this limit results in error.
- The maximum number of retries of each statement in pessimistic transactions. If the number of retries exceeds this limit, an error occurs.
- Default value: `256`

## experimental
Expand Down
6 changes: 6 additions & 0 deletions tidb-specific-system-variables.md
Original file line number Diff line number Diff line change
Expand Up @@ -396,6 +396,12 @@ Usage of statements:
- If you upgrade from a TiDB version earlier than 4.0.0 to 4.0.0, the format version is not changed, and TiDB continues to use the old format of version `1` to write data to the table, which means that **only newly created clusters use the new data format by default**.
- Note that modifying this variable does not affect the old data that has been saved, but applies the corresponding version format only to the newly written data after modifying this variable.

### tidb_record_plan_in_slow_log

- Scope: SESSION
- Default value: `1`
- Controls whether to include the execution plan of slow queries in the slow log.

## tidb_slow_log_threshold

- Scope: SESSION
Expand Down

0 comments on commit 7d953bf

Please sign in to comment.