What is the difference between log.slow-threshold in TiDB configuration and slow-log-threshold in TiKV configuration, and do they need to be configured simultaneously?

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

Original topic: 请问TiDB配置中的log.slow-threshold和TiKV配置中的slow-log-threshold有何区别,是否需要同时配置?

| username: Kiwi

[TiDB Usage Environment] Production Environment
[TiDB Version] 7.5.0
[Reproduction Path] Initializing the production environment cluster
[Encountered Issue:]

What is the difference between log.slow-threshold: 3000 in TiDB configuration and slow-log-threshold: 3s in TiKV configuration? Do they need to be configured simultaneously?

Resource Configuration:
#10.28.1.150 Processor-1 Core-20 Thread-40 Memory-128G Hard Disk-2T RAID-1
#10.28.1.149 Processor-1 Core-20 Thread-40 Memory-256G Hard Disk-4T RAID-None
#10.28.1.148 Processor-1 Core-20 Thread-40 Memory-256G Hard Disk-4T RAID-None
#10.28.1.147 Processor-1 Core-20 Thread-40 Memory-256G Hard Disk-4T RAID-None
#10.28.1.146 Processor-1 Core-20 Thread-40 Memory-256G Hard Disk-4T RAID-None

Cluster Topology:
tiup 5 instances (occupying servers 149, 148, 147, 146, 150, does not store business data, can operate with 4 servers down, used for database deployment and scaling, default control server is 150)
TiDB 3 instances (occupying servers 149, 148, 150, does not store business data, can operate with 2 servers down, used as database access entry, default main server is 149)
#TiPD 3 instances (occupying servers 149, 148, 150, does not store business data, can operate with 2 servers down, used for database cluster task scheduling, default main server is 149)
ticdc 1 instance (occupying server 147, does not store business data, used for asynchronous backup to downstream MySQL database, can be rebuilt if damaged)
tikv 6 instances (occupying servers 149, 148, 147, stores business data, grouped using host tags, can operate with 1 server down, data loss if 2 servers are down)
tiflash 2 instances (occupying server 146, stores business data, can be rebuilt if 1 server is down, column storage function unavailable during rebuild, rebuild time may take several hours depending on data scale)

| username: 大飞哥online | Original post link

The log.slow-threshold is a TiDB configuration item used to set the threshold for slow query logs. When the execution time of a query exceeds this threshold, TiDB will record the query in the slow query log. By default, the value of log.slow-threshold is 300 milliseconds.

The slow-log-threshold is a TiKV configuration item used to set the threshold for slow logs. When the processing time of a request on TiKV exceeds this threshold, TiKV will record the request in the slow log. By default, the value of slow-log-threshold is 300 milliseconds. TiKV needs to be restarted for changes to take effect.

| username: 大飞哥online | Original post link

The log.slow-threshold in TiDB is mainly used to record slow query logs on TiDB, while the slow-log-threshold in TiKV is mainly used to record slow logs on TiKV. The meanings and functions of these two configuration items are different.

| username: Kiwi | Original post link

Thank you very much :yum:

| username: dba远航 | Original post link

Two parameters that act on different machine types

| username: system | Original post link

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