Which parameters need to be modified in the production environment of TiDB?

Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.

Original topic: 生产环境tidb 的哪些参数是需要修改的。

| username: cheng

【TiDB Usage Environment】Production Environment
【TiDB Version】v5.4.1
【Encountered Problem】

【Problem Phenomenon and Impact】TiDB was installed using tiup, and all parameter values are default. Which parameters need to be modified and optimized? Could you provide a list of parameters?

【Attachment】Machines: 24 cores, 32GB RAM, 3 TiKV nodes, 3 PD nodes, 1 TiDB server

| username: ddhe9527 | Original post link

If it is not a mixed deployment, the default configuration can generally be used directly. Tuning is mainly based on specific needs and scenarios. You can refer to the content in the official documentation under “Performance Tuning → Configuration Tuning” for modifications.

Here are a few commonly adjusted configurations:

  • tidb.performance.txn-total-size-limit: Limits the size of all KV data in a single transaction. The default value is 100MB, which can be increased as needed.
  • tidb.prepared-plan-cache.enabled: Enables the execution plan cache feature for PREPARE/EXECUTE statements.
  • tidb.tikv-client.copr-cache.capacity-mb: The size of the Coprocessor Cache on the TiDB instance. The default value is 1000.0MB, which can be appropriately increased based on the TiDB instance memory.
  • tidb.new_collations_enabled_on_first_bootstrap: Enables support for collation rules such as utf8mb4_unicode_ci in MySQL. This must be configured during cluster initialization and cannot be modified later. It is recommended to change this if migrating from a MySQL database.
  • pd.replication.location-labels: Configures labels for PD.
| username: cheng | Original post link

The parameters you listed, I checked and found that only tidb.new_collations_enabled_on_first_bootstrap is in the disabled state. Do I need to add the others manually?

| username: Kongdom | Original post link

There are dedicated courses in the curriculum
https://learn.pingcap.com/learner/course/120005

You can also refer to the official documentation

| username: ddhe9527 | Original post link

These configurations are set as needed, and the current values can be queried in the INFORMATION_SCHEMA.CLUSTER_CONFIG table. The default values for prepared-plan-cache.enabled and new_collations_enabled_on_first_bootstrap are both false, and the latter can only be configured during cluster initialization; modifying it later is ineffective.

| username: system | Original post link

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.