What does the number of coprocessor requests on the dashboard panel represent?

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

Original topic: dashboard面版coprocessor请求数代表什么

| username: 胡杨树旁

The dashboard panel shows the number of coprocessor requests. I don’t quite understand what this number represents. Does a higher number indicate that more data is being fetched from TiKV?

| username: 普罗米修斯 | Original post link

The coprocessor in TiKV takes on part of the computational work from the TiDB server, reducing the memory and IO resource consumption on the TiDB server.

| username: swino | Original post link

In TiDB, the Coprocessor is the module responsible for executing TiKV endpoint tasks (EndPoint Task). Each TiKV instance has one or more Coprocessor threads used to execute TiDB queries. The Coprocessor handles requests for various stages of data from TiDB queries. Therefore, an increase in the number of Coprocessor requests indicates that TiDB is performing more query operations and requires more Coprocessor resources to process these queries, leading to increased CPU and memory utilization in the TiKV instance.

In the TiDB Dashboard panel, the number of Coprocessor requests refers to the number of requests attempting to access the TiKV Coprocessor per second. Hence, when this number increases, it indicates that the TiDB cluster is accelerating the processing of query requests. However, if this number continues to rise, it suggests that the Coprocessor resources in TiKV may become a bottleneck, resulting in degraded query performance. In such cases, you might need to consider adding more TiKV instances or upgrading the hardware configuration of TiKV instances to increase Coprocessor resources.

| username: forever | Original post link

I suggest you take a look at the execution plan interpretation, it might help you understand more clearly. Using EXPLAIN to Interpret Execution Plans | PingCAP Documentation Center

| username: 小龙虾爱大龙虾 | Original post link

The number of cop tasks sent by TiDB to TiKV

| username: Jellybean | Original post link

The Coprocessor is the query module that the tidb-server uses to access data from the tikv server. You can understand the number of its requests as the number of threads querying the data. When there is a large amount of data to query, the number of threads may increase, which to some extent reflects the busy level of data retrieval.

| username: 春风十里 | Original post link

Coprocessor, a collaborative processor, handles the physical operator pushdown from TiDB. For example, count(*) can be directly calculated in TiKV, and the final result can be aggregated by TiDB. It can also be used for analyzing statistical information. As shown in the figure below, as long as the three TiKVs each calculate the count value and finally hand it over to TiDB, it reduces network traffic and alleviates the computational and memory pressure on TiDB.