Issue with TiDB Executing Certain Statements Every 5 Minutes

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

Original topic: tidb的每5分钟会执行一些语句的问题

| username: zhanggame1

【TiDB Usage Environment】
【TiDB Version】7.1
【Encountered Problem: Phenomenon and Impact】

From the topsql monitoring, it can be seen that there is a TiDB node executing some statements every 5 minutes. Does anyone know what is being done every 5 minutes? It looks a bit like collecting statistics. Is there a parameter to control the interval?

| username: tidb菜鸟一只 | Original post link

The processing of statistical information, this kind of SQL should be very fast, it shouldn’t appear in TopSQL, right?

| username: zhanggame1 | Original post link

Test database, currently not accessible.

Can the 5-minute interval be adjusted?

| username: 胡杨树旁 | Original post link

I also want to connect the MySQL database to the monitoring tools Dashboard and Grafana. Has anyone tried this?

| username: tidb菜鸟一只 | Original post link

Grafana is very simple, just configure the MySQL data source, and then configure the monitoring items.

| username: 胡杨树旁 | Original post link

Are there any references for monitoring items?

| username: tidb菜鸟一只 | Original post link

A long time ago, I configured some settings, basically to monitor some common MySQL statuses.

| username: redgame | Original post link

I remember it is this parameter, stats-lease = 300

| username: zhanggame1 | Original post link

Default value: 3s

  • Every stats-lease interval, TiDB checks if there are updates to the statistics. If there are, it updates them in memory.
  • Every 20 * stats-lease interval, TiDB updates the total number of rows generated by DML and the changes in the number of modified rows to the system table.
| username: system | Original post link

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