What does cop high mean?

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

Original topic: 请问下cop高是什么意思

| username: TiDBer_Y2d2kiJh

【TiDB Usage Environment】Production Environment
【TiDB Version】v5.4.0
【Reproduction Path】
【Encountered Problem: Problem Phenomenon and Impact】Seeing high cop in the monitoring, what does high cop indicate?
【Resource Configuration】
【Attachments: Screenshots/Logs/Monitoring】

| username: TiDBer_jYQINSnf | Original post link

The coprocessor is responsible for handling some of the computation that is pushed down, and high cop means high latency. Generally, operations like scanning and limit can be pushed down. If the SQL cannot be optimized, then the latency will be high. If it can be optimized, try to minimize scanning as much as possible.

| username: cassblanca | Original post link

The role of the coprocessor is to filter and aggregate data based on the request operators after receiving the request, and then return it to TiDB to provide query acceleration. If the acceleration effect is not obvious after analyzing the business scenario, it can be canceled.

From version v5.0.0 and above, the Coprocessor cache function is enabled by default. After enabling this function, TiDB will cache the results of operators pushed down to the tikv-server for calculation in the tidb-server, reducing the latency of reading data. To disable the Coprocessor cache function, you can set the ​​tikv-client.copr-cache​​ configuration item ​​capacity-mb​​ to 0.0.

| username: redgame | Original post link

Increased response time: Due to high Coprocessor load, the processing speed of query requests may slow down, leading to longer user wait times and increased response times.

Increased system resource consumption: Coprocessor requires CPU, memory, and other system resources for query processing. When the Coprocessor load is high, it increases system resource consumption, which may lead to a decline in the overall performance of the cluster.

Blocking other operations: If the Coprocessor load is too high, it may block the processing of other query requests, affecting other tasks or operations.

| username: Jellybean | Original post link

COP is the abbreviation for coprocessor. It refers to the operation of querying and scanning data in TiKV. A high COP indicates that the time spent scanning data (key-value pairs) in TiKV is relatively long.

As for why it takes a long time, further analysis is needed to determine whether it is due to the large amount of data being scanned, tight resource usage in the TiKV storage layer (usually IO), or because other large tasks are competing for resources. Further investigation is required.