tidb_max_tiflash_threads=1,但CPU使用还是太多

【 TiDB 使用环境】Poc
【 TiDB 版本】v7.0.0

tidb_max_tiflash_threads参数设置

tidb_max_tiflash_threads 从 v6.1.0 版本开始引入

  • 作用域:SESSION | GLOBAL
  • 是否持久化到集群:是
  • 类型:整数型
  • 默认值:-1
  • 范围:[-1, 256]
  • 单位:线程
  • TiFlash 中 request 执行的最大并发度。默认值为 -1,表示该系统变量无效。0 表示由 TiFlash 系统自动设置该值。

做TPCH语句时,当该参数设置为1时候tiflash使用的CPU数远大于1,感觉并没有控制住CPU的使用。
测试方法如下:

[tidb@host0 ~]$ time tiup bench tpch -D tpch30 -H 192.168.31.201 -P 4000 -U root -p '' --sf=30 prepare -T 3  --tiflash-replica 1 --analyze --dropdata
tiup is checking updates for component bench ...
Starting component `bench`: /home/tidb/.tiup/components/bench/v1.12.0/tiup-bench tpch -D tpch30 -H 192.168.31.201 -P 4000 -U root -p  --sf=30 prepare -T 3 --tiflash-replica 1 --analyze --dropdata
DROP TABLE IF EXISTS lineitem
DROP TABLE IF EXISTS partsupp
DROP TABLE IF EXISTS supplier
DROP TABLE IF EXISTS part
DROP TABLE IF EXISTS orders
DROP TABLE IF EXISTS customer
DROP TABLE IF EXISTS region
DROP TABLE IF EXISTS nation
creating nation
creating tiflash replica for nation
creating region
creating tiflash replica for region
creating part
creating tiflash replica for part
creating supplier
creating tiflash replica for supplier
creating partsupp
creating tiflash replica for partsupp
creating customer
creating tiflash replica for customer
creating orders
creating tiflash replica for orders
creating lineitem
creating tiflash replica for lineitem
generating nation table
generate nation table done
generating region table
generate region table done
generating customers table
generate customers table done
generating suppliers table
generate suppliers table done
generating part/partsupplier tables
generate part/partsupplier tables done
generating orders/lineitem tables
generate orders/lineitem tables done
analyzing table lineitem
analyze table lineitem done
analyzing table partsupp
analyze table partsupp done
analyzing table supplier
analyze table supplier done
analyzing table part
analyze table part done
analyzing table orders
analyze table orders done
analyzing table customer
analyze table customer done
analyzing table region
analyze table region done
analyzing table nation
analyze table nation done
Finished

real    137m29.384s
user    20m56.294s
sys     5m57.781s

mysql> select * from information_schema.tiflash_replica;
+--------------+------------+----------+---------------+-----------------+-----------+----------+
| TABLE_SCHEMA | TABLE_NAME | TABLE_ID | REPLICA_COUNT | LOCATION_LABELS | AVAILABLE | PROGRESS |
+--------------+------------+----------+---------------+-----------------+-----------+----------+
| tpch30       | nation     |      102 |             1 |                 |         1 |        1 |
| tpch30       | customer   |      117 |             1 |                 |         1 |        1 |
| tpch30       | supplier   |      111 |             1 |                 |         1 |        1 |
| tpch30       | partsupp   |      114 |             1 |                 |         1 |        1 |
| tpch30       | region     |      105 |             1 |                 |         1 |        1 |
| tpch30       | part       |      108 |             1 |                 |         1 |        1 |
| tpch30       | orders     |      120 |             1 |                 |         1 |        1 |
| tpch30       | lineitem   |      124 |             1 |                 |         1 |        1 |
+--------------+------------+----------+---------------+-----------------+-----------+----------+
8 rows in set (0.01 sec)

#在tiflash中部署top抓取tiflash进程的top信息
nohup top -p `pidof tiflash` -d 1 -n 86400 -b >top.txt &

#解析top信息便于解析合并到语句执行信息中,方便查看语句执行时候tiflash进程消耗情况
cat top.txt |awk '$0 ~ /^top -/ {print time,tiflash_cpu_ratio,tiflash_mem_ratio;time=$3} $0 ~ /TiFlash/ {tiflash_cpu_ratio=$9;tiflash_mem_ratio=$10}'

#在tiflash(单节点)中部署top信息抓取tiflash的进行CPU使用情况
nohup top -p `pidof tiflash` -d 1 -n 86400 -b >top.txt &
nohup vmstat -tw 1 86400 >vmstat.txt &

对tpch的SQL1-22进行测试,测试方式:
从tidb_max_tiflash_threads、parallel(并发SQL数)角度做测试。
for eachSQL in [Q1,Q2....Q11]
  for eachTiflashThreads in [0,1,2]
    for parallel in [1,2]
	  分别对每一种类SQL做tidb_max_tiflash_threads参数递增调整,SQL并行数递增调整

session级别设置tidb_enforce_mpp=ON;

得出测试数据如下:
其中
SQLN:指的是tpch的测试语句。
query_start_time:语句的开始时间,如果parallel>1那么会挑选一条SQL并记录其开始时间,向数据库发起请求前记录的时间。
query_end_time:语句的结束时间,如果parallel>1那么会挑选已经记录开始时间的SQL,记录其结束时间,数据库返回结果后记录的时间。
tidb_max_tiflash_threads:单个SQL语句配置的在tiflash中执行的并发线程参数,0代表系统默认值(当前CPU=12,On-line CPU(s) list: 0-11,Thread(s) per core: 1)。
parallel:并发SQL数,比如parallel=2,那么会同时下发2个SQL请求,并等待一起结束。
timeSpend(seconds):query_end_time - query_start_time时间
cpuSlice:从tiflash操作系统通过top获取的tiflash进程的CPU使用率(每秒一次delta),从query_start_time开始每秒打印一个点直到query_end_time。

SQL1     query_start_time:2023-05-27-21:18:30  query_end_time:2023-05-27-21:18:40  tidb_max_tiflash_threads:0     parallel:1     timeSpend(seconds):10.716679  cpuSlice:[6,580,859,853,876,846,881,816,898,839]
SQL1     query_start_time:2023-05-27-21:18:40  query_end_time:2023-05-27-21:18:59  tidb_max_tiflash_threads:0     parallel:2     timeSpend(seconds):19.039483  cpuSlice:[831,717,854,907,1006,926,969,997,928,954,950,984,966,908,931,899,891,878,948]
SQL1     query_start_time:2023-05-27-21:18:59  query_end_time:2023-05-27-21:19:27  tidb_max_tiflash_threads:0     parallel:3     timeSpend(seconds):27.265477  cpuSlice:[884,786,858,945,915,946,996,982,951,916,939,960,946,888,946,937,914,928,926,939,953,939,876,1002,973,994,955]
SQL1     query_start_time:2023-05-27-21:19:27  query_end_time:2023-05-27-21:19:44  tidb_max_tiflash_threads:1     parallel:1     timeSpend(seconds):17.038484  cpuSlice:[894,607,237,235,236,231,217,223,230,225,218,217,186,207,225,231,221]
SQL1     query_start_time:2023-05-27-21:19:44  query_end_time:2023-05-27-21:20:05  tidb_max_tiflash_threads:1     parallel:2     timeSpend(seconds):20.997980  cpuSlice:[217,303,485,476,471,446,466,396,475,426,453,457,414,457,389,361,410,449,474,433,449]
SQL1     query_start_time:2023-05-27-21:20:05  query_end_time:2023-05-27-21:20:39  tidb_max_tiflash_threads:1     parallel:3     timeSpend(seconds):33.978577  cpuSlice:[436,454,565,540,546,568,587,555,546,574,579,560,591,600,548,588,553,539,568,573,577,587,566,537,515,584,560,565,587,548,576,579,575,610]
SQL1     query_start_time:2023-05-27-21:20:39  query_end_time:2023-05-27-21:20:49  tidb_max_tiflash_threads:2     parallel:1     timeSpend(seconds):10.312490  cpuSlice:[548,501,474,453,467,450,463,430,423,450]
SQL1     query_start_time:2023-05-27-21:20:49  query_end_time:2023-05-27-21:21:14  tidb_max_tiflash_threads:2     parallel:2     timeSpend(seconds):24.691146  cpuSlice:[450,435,531,524,546,548,568,553,528,556,550,550,533,509,528,541,561,585,491,531,526,555,582,526,556]
SQL1     query_start_time:2023-05-27-21:21:14  query_end_time:2023-05-27-21:21:49  tidb_max_tiflash_threads:2     parallel:3     timeSpend(seconds):34.911054  cpuSlice:[578,672,544,546,539,559,595,543,583,577,557,587,564,605,571,563,571,563,555,587,550,568,596,591,707,579,532,513,544,567,574,557,563,577,564]
SQL2     query_start_time:2023-05-27-21:21:49  query_end_time:2023-05-27-21:21:52  tidb_max_tiflash_threads:0     parallel:1     timeSpend(seconds):3.210497   cpuSlice:[535,846,1038]
SQL2     query_start_time:2023-05-27-21:21:52  query_end_time:2023-05-27-21:21:58  tidb_max_tiflash_threads:0     parallel:2     timeSpend(seconds):6.319045   cpuSlice:[886,730,971,1095,1055]
SQL2     query_start_time:2023-05-27-21:21:58  query_end_time:2023-05-27-21:22:07  tidb_max_tiflash_threads:0     parallel:3     timeSpend(seconds):9.322105   cpuSlice:[1018,901,529,816,925,1080,1143,1050,1032]
SQL2     query_start_time:2023-05-27-21:22:08  query_end_time:2023-05-27-21:22:12  tidb_max_tiflash_threads:1     parallel:1     timeSpend(seconds):4.223496   cpuSlice:[972,681,589,606]
SQL2     query_start_time:2023-05-27-21:22:12  query_end_time:2023-05-27-21:22:18  tidb_max_tiflash_threads:1     parallel:2     timeSpend(seconds):6.694010   cpuSlice:[414,274,831,809,893,926]
SQL2     query_start_time:2023-05-27-21:22:19  query_end_time:2023-05-27-21:22:28  tidb_max_tiflash_threads:1     parallel:3     timeSpend(seconds):9.434295   cpuSlice:[563,444,886,886,915,950,924,952,876]
SQL2     query_start_time:2023-05-27-21:22:28  query_end_time:2023-05-27-21:22:32  tidb_max_tiflash_threads:2     parallel:1     timeSpend(seconds):3.682497   cpuSlice:[763,490,594,783]
SQL2     query_start_time:2023-05-27-21:22:32  query_end_time:2023-05-27-21:22:39  tidb_max_tiflash_threads:2     parallel:2     timeSpend(seconds):6.624494   cpuSlice:[756,430,871,905,930,726,742]
SQL2     query_start_time:2023-05-27-21:22:39  query_end_time:2023-05-27-21:22:49  tidb_max_tiflash_threads:2     parallel:3     timeSpend(seconds):9.999767   cpuSlice:[567,646,972,883,968,838,765,716,741,745]
SQL3     query_start_time:2023-05-27-21:22:49  query_end_time:2023-05-27-21:23:00  tidb_max_tiflash_threads:0     parallel:1     timeSpend(seconds):11.033197  cpuSlice:[599,665,850,794,783,830,787,754,768,727,760]
SQL3     query_start_time:2023-05-27-21:23:00  query_end_time:2023-05-27-21:23:20  tidb_max_tiflash_threads:0     parallel:2     timeSpend(seconds):19.828656  cpuSlice:[346,618,945,921,992,882,915,855,895,850,790,890,825,830,838,823,821,852,916,825]
SQL3     query_start_time:2023-05-27-21:23:20  query_end_time:2023-05-27-21:23:48  tidb_max_tiflash_threads:0     parallel:3     timeSpend(seconds):27.750755  cpuSlice:[211,748,895,920,952,988,984,880,834,928,898,942,982,924,989,902,886,977,949,902,912,919,888,944,879,911,942]
SQL3     query_start_time:2023-05-27-21:23:48  query_end_time:2023-05-27-21:24:01  tidb_max_tiflash_threads:1     parallel:1     timeSpend(seconds):13.542488  cpuSlice:[638,134,213,195,203,206,315,460,420,439,444,375,440]
SQL3     query_start_time:2023-05-27-21:24:01  query_end_time:2023-05-27-21:24:24  tidb_max_tiflash_threads:1     parallel:2     timeSpend(seconds):23.071479  cpuSlice:[406,63,426,384,363,399,349,365,454,479,477,486,511,482,482,502,494,529,524,505,497,511,522]
SQL3     query_start_time:2023-05-27-21:24:24  query_end_time:2023-05-27-21:24:57  tidb_max_tiflash_threads:1     parallel:3     timeSpend(seconds):32.232471  cpuSlice:[492,184,495,567,600,530,592,552,532,542,693,503,531,515,527,536,532,483,506,529,519,499,520,477,550,630,520,479,503,511,533,513,526]
SQL3     query_start_time:2023-05-27-21:24:57  query_end_time:2023-05-27-21:25:09  tidb_max_tiflash_threads:2     parallel:1     timeSpend(seconds):12.274989  cpuSlice:[398,189,403,381,403,465,464,470,450,465,474,451]
SQL3     query_start_time:2023-05-27-21:25:09  query_end_time:2023-05-27-21:25:32  tidb_max_tiflash_threads:2     parallel:2     timeSpend(seconds):23.244982  cpuSlice:[467,127,712,742,666,674,670,675,542,470,469,510,489,442,484,504,500,513,567,446,474,483,483]
SQL3     query_start_time:2023-05-27-21:25:32  query_end_time:2023-05-27-21:26:06  tidb_max_tiflash_threads:2     parallel:3     timeSpend(seconds):33.342199  cpuSlice:[515,140,636,883,896,878,833,778,846,876,594,497,506,494,491,504,515,494,481,487,508,515,497,520,538,619,507,507,499,518,514,502,510,532]
SQL4     query_start_time:2023-05-27-21:26:06  query_end_time:2023-05-27-21:26:16  tidb_max_tiflash_threads:0     parallel:1     timeSpend(seconds):9.724091   cpuSlice:[349,446,826,867,872,800,768,554,820,821]
SQL4     query_start_time:2023-05-27-21:26:16  query_end_time:2023-05-27-21:26:34  tidb_max_tiflash_threads:0     parallel:2     timeSpend(seconds):17.953276  cpuSlice:[732,810,924,972,938,948,934,920,923,921,994,879,836,948,937,950,910]
SQL4     query_start_time:2023-05-27-21:26:34  query_end_time:2023-05-27-21:27:01  tidb_max_tiflash_threads:0     parallel:3     timeSpend(seconds):27.263772  cpuSlice:[907,726,880,966,956,1042,1003,1054,988,980,918,885,1030,995,974,1058,1035,1028,941,1004,1035,1050,1034,1013,975,859,790]
SQL4     query_start_time:2023-05-27-21:27:01  query_end_time:2023-05-27-21:27:12  tidb_max_tiflash_threads:1     parallel:1     timeSpend(seconds):11.401490  cpuSlice:[835,715,488,541,469,514,329,506,483,409,213]
SQL4     query_start_time:2023-05-27-21:27:12  query_end_time:2023-05-27-21:27:32  tidb_max_tiflash_threads:1     parallel:2     timeSpend(seconds):19.772627  cpuSlice:[432,360,598,554,475,468,506,498,498,321,482,483,522,530,568,500,347,396,553,594]
SQL4     query_start_time:2023-05-27-21:27:32  query_end_time:2023-05-27-21:28:01  tidb_max_tiflash_threads:1     parallel:3     timeSpend(seconds):28.833067  cpuSlice:[533,403,689,602,494,552,534,550,612,587,533,479,482,567,560,530,522,519,566,622,529,538,557,407,647,591,808,698,764]
SQL4     query_start_time:2023-05-27-21:28:01  query_end_time:2023-05-27-21:28:11  tidb_max_tiflash_threads:2     parallel:1     timeSpend(seconds):10.414491  cpuSlice:[584,461,523,522,525,504,397,490,458,389]
SQL4     query_start_time:2023-05-27-21:28:11  query_end_time:2023-05-27-21:28:33  tidb_max_tiflash_threads:2     parallel:2     timeSpend(seconds):21.072081  cpuSlice:[456,362,611,498,666,508,543,516,497,592,664,537,524,580,568,505,546,487,612,529,496,501]
SQL4     query_start_time:2023-05-27-21:28:33  query_end_time:2023-05-27-21:29:03  tidb_max_tiflash_threads:2     parallel:3     timeSpend(seconds):30.328259  cpuSlice:[415,792,556,523,777,593,597,527,548,577,546,515,780,771,570,536,534,555,599,681,544,521,625,726,777,716,541,546,541,406]
SQL5     query_start_time:2023-05-27-21:29:03  query_end_time:2023-05-27-21:29:18  tidb_max_tiflash_threads:0     parallel:1     timeSpend(seconds):15.351751  cpuSlice:[432,784,901,771,912,917,950,966,914,910,899,884,974,932]
SQL5     query_start_time:2023-05-27-21:29:18  query_end_time:2023-05-27-21:29:48  tidb_max_tiflash_threads:0     parallel:2     timeSpend(seconds):29.316658  cpuSlice:[861,913,812,996,906,1039,934,973,1107,1064,1109,1091,1074,1060,1021,1063,1045,1056,1040,1066,1100,1078,1069,1067,988,1009,1048,1059,1063,975]
SQL5     query_start_time:2023-05-27-21:29:48  query_end_time:2023-05-27-21:30:31  tidb_max_tiflash_threads:0     parallel:3     timeSpend(seconds):43.834961  cpuSlice:[991,866,820,1032,964,1093,889,997,1014,1077,1066,1042,1065,1082,1061,1105,1062,1042,1107,1073,1008,1045,1080,1102,1041,1011,967,1035,1038,1050,1064,1049,998,1011,1046,1010,1065,1070,1038,1037,1087,1028]
SQL5     query_start_time:2023-05-27-21:30:31  query_end_time:2023-05-27-21:30:53  tidb_max_tiflash_threads:1     parallel:1     timeSpend(seconds):21.495479  cpuSlice:[1047,1038,779,478,473,284,268,250,244,230,246,240,237,238,245,242,218,211,230,238,241,252]
SQL5     query_start_time:2023-05-27-21:30:53  query_end_time:2023-05-27-21:31:30  tidb_max_tiflash_threads:1     parallel:2     timeSpend(seconds):36.995967  cpuSlice:[235,233,897,741,550,525,495,461,456,486,469,484,467,435,461,458,490,511,487,479,476,510,487,502,436,446,450,466,473,457,473,513,454,480,481,500,440]
SQL5     query_start_time:2023-05-27-21:31:30  query_end_time:2023-05-27-21:32:19  tidb_max_tiflash_threads:1     parallel:3     timeSpend(seconds):49.177638  cpuSlice:[440,417,733,976,804,596,518,598,697,648,659,702,632,678,706,680,712,626,647,678,673,667,695,684,691,683,672,716,680,690,676,654,647,604,620,560,626,605,629,613,652,681,633,641,724,674,724,725,612]
SQL5     query_start_time:2023-05-27-21:32:20  query_end_time:2023-05-27-21:32:39  tidb_max_tiflash_threads:2     parallel:1     timeSpend(seconds):18.540296  cpuSlice:[630,387,693,567,519,628,589,583,555,570,582,576,554,543,531,554,589,548,590]
SQL5     query_start_time:2023-05-27-21:32:39  query_end_time:2023-05-27-21:33:15  tidb_max_tiflash_threads:2     parallel:2     timeSpend(seconds):36.419393  cpuSlice:[566,791,825,734,617,638,787,826,760,707,720,739,742,749,714,696,739,679,699,752,683,717,706,692,822,768,827,784,690,650,692,716,630,632,693]
SQL5     query_start_time:2023-05-27-21:33:15  query_end_time:2023-05-27-21:34:07  tidb_max_tiflash_threads:2     parallel:3     timeSpend(seconds):51.860714  cpuSlice:[746,765,868,1025,900,787,574,752,591,892,888,749,704,737,761,746,818,751,747,794,837,746,754,742,837,795,784,767,778,799,731,753,751,774,743,826,822,848,912,814,773,718,671,759,742,778,751,723,765,775,794,794]
SQL6     query_start_time:2023-05-27-21:34:07  query_end_time:2023-05-27-21:34:13  tidb_max_tiflash_threads:0     parallel:1     timeSpend(seconds):5.971251   cpuSlice:[770,725,691,725,689,695]
SQL6     query_start_time:2023-05-27-21:34:13  query_end_time:2023-05-27-21:34:23  tidb_max_tiflash_threads:0     parallel:2     timeSpend(seconds):9.862994   cpuSlice:[726,768,752,819,799,837,877,804,798,782]
SQL6     query_start_time:2023-05-27-21:34:23  query_end_time:2023-05-27-21:34:36  tidb_max_tiflash_threads:0     parallel:3     timeSpend(seconds):13.095711  cpuSlice:[825,767,946,900,846,835,806,848,876,863,818,867,860]
SQL6     query_start_time:2023-05-27-21:34:36  query_end_time:2023-05-27-21:34:42  tidb_max_tiflash_threads:1     parallel:1     timeSpend(seconds):5.698995   cpuSlice:[860,560,370,366,357,354]
SQL6     query_start_time:2023-05-27-21:34:42  query_end_time:2023-05-27-21:34:52  tidb_max_tiflash_threads:1     parallel:2     timeSpend(seconds):10.439989  cpuSlice:[357,381,359,362,366,367,359,365,377,364]
SQL6     query_start_time:2023-05-27-21:34:52  query_end_time:2023-05-27-21:35:08  tidb_max_tiflash_threads:1     parallel:3     timeSpend(seconds):15.789009  cpuSlice:[364,440,380,370,367,367,371,369,365,367,365,413,376,361,368,375]
SQL6     query_start_time:2023-05-27-21:35:08  query_end_time:2023-05-27-21:35:14  tidb_max_tiflash_threads:2     parallel:1     timeSpend(seconds):5.755995   cpuSlice:[374,365,362,362,354,383]
SQL6     query_start_time:2023-05-27-21:35:14  query_end_time:2023-05-27-21:35:25  tidb_max_tiflash_threads:2     parallel:2     timeSpend(seconds):10.849993  cpuSlice:[356,396,365,363,367,363,366,374,385,380,363]
SQL6     query_start_time:2023-05-27-21:35:25  query_end_time:2023-05-27-21:35:40  tidb_max_tiflash_threads:2     parallel:3     timeSpend(seconds):15.206990  cpuSlice:[372,410,368,367,365,375,375,370,375,373,378,401,365,383,361]
SQL7     query_start_time:2023-05-27-21:35:40  query_end_time:2023-05-27-21:35:50  tidb_max_tiflash_threads:0     parallel:1     timeSpend(seconds):10.050903  cpuSlice:[377,642,765,796,769,817,770,794,802,950]
SQL7     query_start_time:2023-05-27-21:35:50  query_end_time:2023-05-27-21:36:09  tidb_max_tiflash_threads:0     parallel:2     timeSpend(seconds):18.771869  cpuSlice:[1017,881,950,980,936,936,852,903,932,890,840,877,865,885,884,870,1043,1048]
SQL7     query_start_time:2023-05-27-21:36:09  query_end_time:2023-05-27-21:36:37  tidb_max_tiflash_threads:0     parallel:3     timeSpend(seconds):28.138975  cpuSlice:[989,948,789,907,916,934,891,936,941,939,974,986,1003,992,925,973,957,967,976,934,967,899,864,1000,1118,1067,1027,1120]
SQL7     query_start_time:2023-05-27-21:36:37  query_end_time:2023-05-27-21:36:51  tidb_max_tiflash_threads:1     parallel:1     timeSpend(seconds):14.297987  cpuSlice:[1104,989,570,445,452,482,458,348,411,411,202,157,157,156]
SQL7     query_start_time:2023-05-27-21:36:51  query_end_time:2023-05-27-21:37:14  tidb_max_tiflash_threads:1     parallel:2     timeSpend(seconds):23.022479  cpuSlice:[155,158,687,666,433,474,475,449,431,439,440,532,471,493,455,435,459,440,302,321,307,300,305]
SQL7     query_start_time:2023-05-27-21:37:14  query_end_time:2023-05-27-21:37:47  tidb_max_tiflash_threads:1     parallel:3     timeSpend(seconds):32.515971  cpuSlice:[293,296,840,838,523,463,518,458,499,501,465,453,482,462,468,469,598,600,556,513,471,467,448,456,494,483,482,454,470,460,479,474,474]
SQL7     query_start_time:2023-05-27-21:37:47  query_end_time:2023-05-27-21:37:59  tidb_max_tiflash_threads:2     parallel:1     timeSpend(seconds):12.193989  cpuSlice:[445,516,636,420,448,445,461,470,442,427,347,307]
SQL7     query_start_time:2023-05-27-21:37:59  query_end_time:2023-05-27-21:38:22  tidb_max_tiflash_threads:2     parallel:2     timeSpend(seconds):22.529210  cpuSlice:[302,399,845,657,444,448,482,538,455,469,476,438,516,497,454,446,462,474,572,620,610,575,573]
SQL7     query_start_time:2023-05-27-21:38:22  query_end_time:2023-05-27-21:38:54  tidb_max_tiflash_threads:2     parallel:3     timeSpend(seconds):32.051799  cpuSlice:[582,857,979,826,507,483,500,468,469,599,460,493,471,491,503,462,559,550,480,467,483,460,477,461,467,680,828,831,839,858,813,861]
SQL8     query_start_time:2023-05-27-21:38:54  query_end_time:2023-05-27-21:39:07  tidb_max_tiflash_threads:0     parallel:1     timeSpend(seconds):13.046462  cpuSlice:[787,736,848,787,955,849,872,869,894,833,853,831]
SQL8     query_start_time:2023-05-27-21:39:07  query_end_time:2023-05-27-21:39:31  tidb_max_tiflash_threads:0     parallel:2     timeSpend(seconds):24.500082  cpuSlice:[846,846,737,855,978,859,936,907,943,948,946,982,964,945,923,950,984,964,933,994,912,973,918,892]
SQL8     query_start_time:2023-05-27-21:39:31  query_end_time:2023-05-27-21:40:06  tidb_max_tiflash_threads:0     parallel:3     timeSpend(seconds):34.400391  cpuSlice:[917,875,678,838,911,1053,1007,950,994,856,1036,981,883,961,952,984,996,974,972,999,1070,955,982,1020,1015,952,987,1009,1003,999,1023,948,1015,1005]
SQL8     query_start_time:2023-05-27-21:40:06  query_end_time:2023-05-27-21:40:24  tidb_max_tiflash_threads:1     parallel:1     timeSpend(seconds):17.786986  cpuSlice:[944,932,446,276,272,237,285,255,250,245,254,251,258,246,213,241,263,259]
SQL8     query_start_time:2023-05-27-21:40:24  query_end_time:2023-05-27-21:40:52  tidb_max_tiflash_threads:1     parallel:2     timeSpend(seconds):28.598475  cpuSlice:[247,389,715,489,484,501,440,518,568,590,598,574,561,580,607,541,533,573,563,591,532,497,455,532,554,531,554,491]
SQL8     query_start_time:2023-05-27-21:40:52  query_end_time:2023-05-27-21:41:34  tidb_max_tiflash_threads:1     parallel:3     timeSpend(seconds):41.784062  cpuSlice:[476,503,533,823,708,656,678,661,607,629,779,744,747,672,642,603,657,593,646,650,609,652,607,585,607,619,622,642,637,617,630,685,635,645,605,588,636,618,581,621,614,631]
SQL8     query_start_time:2023-05-27-21:41:34  query_end_time:2023-05-27-21:41:49  tidb_max_tiflash_threads:2     parallel:1     timeSpend(seconds):14.728987  cpuSlice:[679,635,624,584,550,559,543,505,512,504,532,523,533,515,504]
SQL8     query_start_time:2023-05-27-21:41:49  query_end_time:2023-05-27-21:42:19  tidb_max_tiflash_threads:2     parallel:2     timeSpend(seconds):29.558811  cpuSlice:[526,513,913,731,717,640,648,669,563,541,579,580,524,553,579,538,562,558,542,543,571,616,676,630,595,571,565,574,583,645]
SQL8     query_start_time:2023-05-27-21:42:19  query_end_time:2023-05-27-21:43:00  tidb_max_tiflash_threads:2     parallel:3     timeSpend(seconds):41.209463  cpuSlice:[602,778,901,735,771,730,705,656,697,802,584,606,575,620,607,624,617,607,623,601,596,616,593,585,622,578,591,570,612,614,769,595,604,567,607,589,602,573,572,559]
SQL9     query_start_time:2023-05-27-21:43:00  query_end_time:2023-05-27-21:43:43  tidb_max_tiflash_threads:0     parallel:1     timeSpend(seconds):42.736033  cpuSlice:[598,597,811,1082,1051,1070,1062,905,909,1032,1012,1041,986,876,848,1021,1039,1011,1043,1008,1048,1023,1004,1043,1070,1059,1075,989,1009,988,984,1020,990,991,1004,1039,1062,1068,1063,1081,1053,1049,973]
SQL9     query_start_time:2023-05-27-21:43:43  query_end_time:2023-05-27-21:45:07  tidb_max_tiflash_threads:0     parallel:2     timeSpend(seconds):83.936407  cpuSlice:[1072,900,1025,1090,1050,1108,1087,1085,1072,1087,1115,1105,1122,1092,1065,1121,1074,1075,1101,1059,1087,1059,1060,956,902,1057,1085,1100,1047,1034,1038,1007,1072,1085,1087,1125,1059,1072,1049,1029,1069,1103,1088,1058,1085,1064,1049,1082,1109,1087,1069,1081,1046,1080,1106,1079,1122,1077,1075,1063,1093,1069,1117,1062,1072,1064,1083,1086,1072,1068,1110,1105,1073,1048,1070,1078,1039,1079,1036,1101,1088,1042]
SQL9     query_start_time:2023-05-27-21:45:07  query_end_time:2023-05-27-21:47:19  tidb_max_tiflash_threads:0     parallel:3     timeSpend(seconds):132.450731 cpuSlice:[1078,964,681,961,1012,979,1073,1082,1104,1068,1106,1097,1084,1079,1078,1076,1055,1048,1107,1113,1098,1098,1054,1097,1089,1119,1074,1112,1099,1100,1117,1106,1128,1118,1088,1063,1111,1053,1061,1031,863,915,974,1062,1067,1060,1069,1099,1078,1071,1083,1095,1065,1079,1094,1084,1088,1077,1075,1111,1086,1083,1070,1069,1055,1079,1064,1058,1086,1069,1066,1065,1034,1069,1041,1018,1055,1099,1096,1065,1036,1076,1048,1076,1102,1062,1069,1083,1050,1090,1096,1071,1071,1059,1076,1078,1022,1058,1074,1079,1058,1081,1101,1046,1000,1053,1080,1062,1034,1070,1098,1045,1147,1132,1100,1131,1101,1084,1104,1082,1090,1121,1126,1081,1095,1075,1047,1137,1086,1113]
SQL9     query_start_time:2023-05-27-21:47:21  query_end_time:2023-05-27-21:48:38  tidb_max_tiflash_threads:1     parallel:1     timeSpend(seconds):76.750431  cpuSlice:[1114,831,675,594,391,421,364,349,401,413,363,298,138,183,227,185,187,192,186,187,188,189,186,187,186,181,189,185,178,187,184,195,186,183,189,185,189,182,181,187,185,186,183,182,183,185,187,188,187,185,173,176,188,170,173,173,187,176,186,183,188,193,190,189,185,184,187,186,186,185,185,185,186,176,183,186,179]
SQL9     query_start_time:2023-05-27-21:48:38  query_end_time:2023-05-27-21:50:36  tidb_max_tiflash_threads:1     parallel:2     timeSpend(seconds):118.282457 cpuSlice:[201,729,1052,865,945,883,533,752,694,544,535,605,685,558,670,585,578,564,355,404,412,341,344,344,330,360,349,359,332,352,348,374,379,378,360,358,333,372,388,366,339,374,341,394,356,365,355,362,331,385,341,347,373,367,371,348,359,342,345,370,372,349,359,360,350,352,364,367,329,352,354,333,358,338,351,349,349,316,320,314,299,323,324,341,303,334,345,330,342,337,368,356,363,384,348,367,360,371,372,358,372,354,355,352,367,407,351,365,374,355,341,380,334,339,339,326,356,333]
SQL9     query_start_time:2023-05-27-21:50:36  query_end_time:2023-05-27-21:53:19  tidb_max_tiflash_threads:1     parallel:3     timeSpend(seconds):162.552839 cpuSlice:[354,371,1105,1102,1036,1048,933,961,930,854,921,918,754,707,828,829,796,822,835,811,880,740,814,779,758,597,557,581,588,608,559,567,538,531,572,572,599,590,580,616,581,613,560,603,572,552,546,555,528,567,554,569,548,559,588,588,546,522,558,568,556,561,526,536,572,535,559,548,574,561,534,529,537,526,554,551,566,532,535,567,553,545,581,548,554,559,568,571,561,560,561,566,555,605,582,562,608,603,571,574,602,575,623,518,551,509,545,555,559,522,528,544,529,512,542,564,575,567,568,533,558,571,561,555,551,546,547,534,551,554,534,531,568,550,527,548,542,533,537,537,551,534,544,534,534,542,550,542,536,574,546,562,538,544,595,575,569,598,592,571,552]
SQL9     query_start_time:2023-05-27-21:53:20  query_end_time:2023-05-27-21:54:17  tidb_max_tiflash_threads:2     parallel:1     timeSpend(seconds):56.885949  cpuSlice:[576,364,604,853,735,608,613,566,588,645,673,550,469,431,388,412,375,375,364,360,350,358,392,350,370,357,363,356,378,346,357,353,368,384,356,365,364,362,349,355,367,328,325,373,358,368,367,392,392,386,378,385,396,395,385,370,407]
SQL9     query_start_time:2023-05-27-21:54:17  query_end_time:2023-05-27-21:55:59  tidb_max_tiflash_threads:2     parallel:2     timeSpend(seconds):101.965121 cpuSlice:[350,359,1012,1034,1074,936,859,869,902,874,741,844,818,835,928,950,955,929,865,603,823,753,766,718,686,688,682,733,668,698,683,712,716,679,705,682,737,683,715,680,693,687,688,722,666,730,712,735,694,708,685,696,689,752,728,711,710,750,725,714,765,735,713,731,713,730,707,761,728,724,659,692,672,703,733,709,739,707,700,736,733,739,717,728,724,689,709,705,724,729,728,696,692,693,707,705,682,703,715,698,679]
SQL9     query_start_time:2023-05-27-21:56:00  query_end_time:2023-05-27-21:58:24  tidb_max_tiflash_threads:2     parallel:3     timeSpend(seconds):144.179171 cpuSlice:[648,522,1092,1105,1056,1019,1042,981,898,979,934,869,877,939,957,881,919,955,959,1050,1011,1033,972,1005,879,683,858,901,912,936,913,919,895,895,897,931,924,924,888,915,882,916,883,864,905,882,918,911,881,895,912,882,917,944,950,914,909,863,870,902,925,917,954,900,880,911,931,931,876,886,857,828,878,915,837,848,862,924,888,862,899,832,908,926,914,924,859,861,879,875,904,943,891,886,904,959,962,893,920,873,920,804,850,871,899,919,918,924,907,850,922,833,923,902,874,901,833,900,868,902,950,930,878,943,906,932,904,912,914,891,859,814,829,867,856,890,894,872,880,926,848,874]
SQL10    query_start_time:2023-05-27-21:58:24  query_end_time:2023-05-27-21:58:36  tidb_max_tiflash_threads:0     parallel:1     timeSpend(seconds):11.850118  cpuSlice:[918,907,732,634,935,822,801,870,845,831,808,798]
SQL10    query_start_time:2023-05-27-21:58:36  query_end_time:2023-05-27-21:58:57  tidb_max_tiflash_threads:0     parallel:2     timeSpend(seconds):21.089363  cpuSlice:[816,765,737,912,887,1093,957,797,865,890,971,871,937,880,910,892,904,924,914,931,788]
SQL10    query_start_time:2023-05-27-21:58:57  query_end_time:2023-05-27-21:59:27  tidb_max_tiflash_threads:0     parallel:3     timeSpend(seconds):29.443970  cpuSlice:[912,890,762,858,943,899,1091,1086,1021,919,954,973,923,943,908,915,895,952,920,928,924,929,1014,936,948,950,954,892,917,1058]
SQL10    query_start_time:2023-05-27-21:59:27  query_end_time:2023-05-27-21:59:45  tidb_max_tiflash_threads:1     parallel:1     timeSpend(seconds):18.407483  cpuSlice:[864,510,293,211,280,522,354,327,304,310,279,306,330,404,107,111,109,113]
SQL10    query_start_time:2023-05-27-21:59:45  query_end_time:2023-05-27-22:00:15  tidb_max_tiflash_threads:1     parallel:2     timeSpend(seconds):29.557474  cpuSlice:[114,365,421,430,419,357,458,528,560,497,548,530,513,519,518,515,509,528,539,554,486,498,541,554,531,329,214,210,218,231]
SQL10    query_start_time:2023-05-27-22:00:15  query_end_time:2023-05-27-22:00:54  tidb_max_tiflash_threads:1     parallel:3     timeSpend(seconds):39.633388  cpuSlice:[232,599,455,403,621,653,561,671,596,564,554,535,562,534,551,575,532,537,601,561,531,546,548,528,587,650,562,530,504,553,524,549,542,562,481,312,314,336]
SQL10    query_start_time:2023-05-27-22:00:55  query_end_time:2023-05-27-22:01:07  tidb_max_tiflash_threads:2     parallel:1     timeSpend(seconds):12.128489  cpuSlice:[340,310,354,384,425,497,466,470,460,460,484,463]
SQL10    query_start_time:2023-05-27-22:01:07  query_end_time:2023-05-27-22:01:31  tidb_max_tiflash_threads:2     parallel:2     timeSpend(seconds):24.054482  cpuSlice:[447,441,484,398,618,754,759,568,502,486,518,519,506,492,500,494,493,550,568,481,480,516,501,537]
SQL10    query_start_time:2023-05-27-22:01:31  query_end_time:2023-05-27-22:02:06  tidb_max_tiflash_threads:2     parallel:3     timeSpend(seconds):35.122468  cpuSlice:[582,648,675,425,486,735,918,942,876,587,534,528,560,560,538,540,525,537,512,533,548,524,536,533,552,677,542,502,548,567,516,514,558,542,653]
SQL11    query_start_time:2023-05-27-22:02:06  query_end_time:2023-05-27-22:02:08  tidb_max_tiflash_threads:0     parallel:1     timeSpend(seconds):1.938501   cpuSlice:[763,681]
SQL11    query_start_time:2023-05-27-22:02:08  query_end_time:2023-05-27-22:02:12  tidb_max_tiflash_threads:0     parallel:2     timeSpend(seconds):3.580996   cpuSlice:[637,702,706,797]
SQL11    query_start_time:2023-05-27-22:02:12  query_end_time:2023-05-27-22:02:17  tidb_max_tiflash_threads:0     parallel:3     timeSpend(seconds):4.896548   cpuSlice:[826,683,832,817,754]
SQL11    query_start_time:2023-05-27-22:02:17  query_end_time:2023-05-27-22:02:20  tidb_max_tiflash_threads:1     parallel:1     timeSpend(seconds):2.270498   cpuSlice:[816,763,390]
SQL11    query_start_time:2023-05-27-22:02:20  query_end_time:2023-05-27-22:02:23  tidb_max_tiflash_threads:1     parallel:2     timeSpend(seconds):3.545999   cpuSlice:[334,392,447]
SQL11    query_start_time:2023-05-27-22:02:23  query_end_time:2023-05-27-22:02:28  tidb_max_tiflash_threads:1     parallel:3     timeSpend(seconds):5.127497   cpuSlice:[497,348,538,425,518]
SQL11    query_start_time:2023-05-27-22:02:28  query_end_time:2023-05-27-22:02:30  tidb_max_tiflash_threads:2     parallel:1     timeSpend(seconds):1.675497   cpuSlice:[517,425]
SQL11    query_start_time:2023-05-27-22:02:30  query_end_time:2023-05-27-22:02:34  tidb_max_tiflash_threads:2     parallel:2     timeSpend(seconds):3.437997   cpuSlice:[362,399,439,493]
SQL11    query_start_time:2023-05-27-22:02:34  query_end_time:2023-05-27-22:02:39  tidb_max_tiflash_threads:2     parallel:3     timeSpend(seconds):5.138502   cpuSlice:[470,565,453,539,506]
SQL12    query_start_time:2023-05-27-22:02:39  query_end_time:2023-05-27-22:02:48  tidb_max_tiflash_threads:0     parallel:1     timeSpend(seconds):9.736729   cpuSlice:[474,679,787,754,781,780,749,749,736]
SQL12    query_start_time:2023-05-27-22:02:48  query_end_time:2023-05-27-22:03:05  tidb_max_tiflash_threads:0     parallel:2     timeSpend(seconds):16.267300  cpuSlice:[841,830,789,779,913,880,804,722,849,773,822,845,880,831,882,1059,922]
SQL12    query_start_time:2023-05-27-22:03:05  query_end_time:2023-05-27-22:03:27  tidb_max_tiflash_threads:0     parallel:3     timeSpend(seconds):22.184429  cpuSlice:[838,876,878,860,889,931,846,841,848,938,889,874,875,928,896,913,862,947,1074,977,974]
SQL12    query_start_time:2023-05-27-22:03:27  query_end_time:2023-05-27-22:03:41  tidb_max_tiflash_threads:1     parallel:1     timeSpend(seconds):13.637803  cpuSlice:[911,818,460,391,383,385,366,174,422,384,367,244,207,170]
SQL12    query_start_time:2023-05-27-22:03:41  query_end_time:2023-05-27-22:04:00  tidb_max_tiflash_threads:1     parallel:2     timeSpend(seconds):19.133729  cpuSlice:[276,362,398,378,378,278,488,417,392,377,384,426,416,383,382,384,462,457,466]
SQL12    query_start_time:2023-05-27-22:04:00  query_end_time:2023-05-27-22:04:25  tidb_max_tiflash_threads:1     parallel:3     timeSpend(seconds):24.696686  cpuSlice:[463,386,514,375,376,403,395,416,398,415,391,395,404,494,442,410,377,396,394,428,535,654,630,644,648]
SQL12    query_start_time:2023-05-27-22:04:25  query_end_time:2023-05-27-22:04:35  tidb_max_tiflash_threads:2     parallel:1     timeSpend(seconds):10.001491  cpuSlice:[613,497,363,373,377,406,401,378,384,423]
SQL12    query_start_time:2023-05-27-22:04:35  query_end_time:2023-05-27-22:04:52  tidb_max_tiflash_threads:2     parallel:2     timeSpend(seconds):17.599605  cpuSlice:[468,481,393,389,384,397,387,390,382,402,430,387,394,398,635,785,728]
SQL12    query_start_time:2023-05-27-22:04:52  query_end_time:2023-05-27-22:05:18  tidb_max_tiflash_threads:2     parallel:3     timeSpend(seconds):26.037078  cpuSlice:[731,739,593,373,403,406,391,402,396,396,390,389,390,404,458,410,412,397,386,394,408,654,812,722,740,739]
SQL13    query_start_time:2023-05-27-22:05:18  query_end_time:2023-05-27-22:05:28  tidb_max_tiflash_threads:0     parallel:1     timeSpend(seconds):9.658991   cpuSlice:[720,713,873,978,1001,1015,1022,1018,1048,1019]
SQL13    query_start_time:2023-05-27-22:05:28  query_end_time:2023-05-27-22:05:45  tidb_max_tiflash_threads:0     parallel:2     timeSpend(seconds):17.195985  cpuSlice:[799,740,1003,1030,1105,1077,1098,1114,1119,1112,1102,1125,1124,1076,1041,1062,852]
SQL13    query_start_time:2023-05-27-22:05:45  query_end_time:2023-05-27-22:06:10  tidb_max_tiflash_threads:0     parallel:3     timeSpend(seconds):24.625479  cpuSlice:[917,904,1076,1083,1114,1086,1093,1102,1100,1109,1105,1063,1104,1087,1090,1077,1068,1068,1082,1047,1050,1098,1052,961]
SQL13    query_start_time:2023-05-27-22:06:10  query_end_time:2023-05-27-22:06:27  tidb_max_tiflash_threads:1     parallel:1     timeSpend(seconds):16.748485  cpuSlice:[970,930,420,180,185,195,207,175,175,173,176,169,189,176,170,173,172]
SQL13    query_start_time:2023-05-27-22:06:27  query_end_time:2023-05-27-22:06:48  tidb_max_tiflash_threads:1     parallel:2     timeSpend(seconds):20.595481  cpuSlice:[166,117,537,338,331,346,334,338,331,339,326,352,341,330,310,331,311,324,336,316,318]
SQL13    query_start_time:2023-05-27-22:06:48  query_end_time:2023-05-27-22:07:15  tidb_max_tiflash_threads:1     parallel:3     timeSpend(seconds):27.550476  cpuSlice:[262,435,534,464,493,461,510,505,483,507,498,499,482,476,509,502,504,500,479,506,459,517,540,534,505,494,548]
SQL13    query_start_time:2023-05-27-22:07:16  query_end_time:2023-05-27-22:07:27  tidb_max_tiflash_threads:2     parallel:1     timeSpend(seconds):11.225490  cpuSlice:[317,368,315,338,351,348,355,344,357,335,352]
SQL13    query_start_time:2023-05-27-22:07:27  query_end_time:2023-05-27-22:07:45  tidb_max_tiflash_threads:2     parallel:2     timeSpend(seconds):18.066983  cpuSlice:[296,531,436,646,663,674,624,665,617,698,601,627,639,680,642,647,673,622]
SQL13    query_start_time:2023-05-27-22:07:45  query_end_time:2023-05-27-22:08:10  tidb_max_tiflash_threads:2     parallel:3     timeSpend(seconds):25.033478  cpuSlice:[506,689,751,753,826,882,895,811,846,910,915,880,859,802,843,840,859,852,882,860,837,888,843,869,724]
SQL14    query_start_time:2023-05-27-22:08:10  query_end_time:2023-05-27-22:08:16  tidb_max_tiflash_threads:0     parallel:1     timeSpend(seconds):6.290494   cpuSlice:[572,676,758,790,756,727]
SQL14    query_start_time:2023-05-27-22:08:16  query_end_time:2023-05-27-22:08:27  tidb_max_tiflash_threads:0     parallel:2     timeSpend(seconds):10.663822  cpuSlice:[754,818,891,852,847,827,879,882,844,826]
SQL14    query_start_time:2023-05-27-22:08:27  query_end_time:2023-05-27-22:08:41  tidb_max_tiflash_threads:0     parallel:3     timeSpend(seconds):14.156906  cpuSlice:[799,872,924,933,916,943,934,939,872,869,816,888,930,962]
SQL14    query_start_time:2023-05-27-22:08:41  query_end_time:2023-05-27-22:08:49  tidb_max_tiflash_threads:1     parallel:1     timeSpend(seconds):7.545993   cpuSlice:[896,1020,568,367,345,344,342,338]
SQL14    query_start_time:2023-05-27-22:08:49  query_end_time:2023-05-27-22:09:02  tidb_max_tiflash_threads:1     parallel:2     timeSpend(seconds):13.410988  cpuSlice:[174,237,393,343,350,362,345,341,363,354,352,342,350]
SQL14    query_start_time:2023-05-27-22:09:02  query_end_time:2023-05-27-22:09:20  tidb_max_tiflash_threads:1     parallel:3     timeSpend(seconds):18.028484  cpuSlice:[309,287,527,348,343,344,376,376,347,348,346,345,357,366,342,348,346,348]
SQL14    query_start_time:2023-05-27-22:09:21  query_end_time:2023-05-27-22:09:28  tidb_max_tiflash_threads:2     parallel:1     timeSpend(seconds):7.003993   cpuSlice:[423,359,357,344,343,352,341]
SQL14    query_start_time:2023-05-27-22:09:28  query_end_time:2023-05-27-22:09:40  tidb_max_tiflash_threads:2     parallel:2     timeSpend(seconds):12.325989  cpuSlice:[315,407,348,351,352,347,347,384,359,348,353,347]
SQL14    query_start_time:2023-05-27-22:09:40  query_end_time:2023-05-27-22:09:58  tidb_max_tiflash_threads:2     parallel:3     timeSpend(seconds):18.150082  cpuSlice:[419,509,545,351,364,354,350,348,349,348,349,398,359,374,348,348,346,359]
SQL16    query_start_time:2023-05-27-22:09:58  query_end_time:2023-05-27-22:10:01  tidb_max_tiflash_threads:0     parallel:1     timeSpend(seconds):2.559620   cpuSlice:[604,802,818]
SQL16    query_start_time:2023-05-27-22:10:01  query_end_time:2023-05-27-22:10:06  tidb_max_tiflash_threads:0     parallel:2     timeSpend(seconds):4.976386   cpuSlice:[1005,752,895,964,868]
SQL16    query_start_time:2023-05-27-22:10:06  query_end_time:2023-05-27-22:10:13  tidb_max_tiflash_threads:0     parallel:3     timeSpend(seconds):7.434103   cpuSlice:[995,772,807,873,895,978,922]
SQL16    query_start_time:2023-05-27-22:10:14  query_end_time:2023-05-27-22:10:20  tidb_max_tiflash_threads:1     parallel:1     timeSpend(seconds):6.497037   cpuSlice:[863,337,160,164,185,222]
SQL16    query_start_time:2023-05-27-22:10:20  query_end_time:2023-05-27-22:10:27  tidb_max_tiflash_threads:1     parallel:2     timeSpend(seconds):7.179994   cpuSlice:[157,219,491,310,321,373,323]
SQL16    query_start_time:2023-05-27-22:10:27  query_end_time:2023-05-27-22:10:36  tidb_max_tiflash_threads:1     parallel:3     timeSpend(seconds):8.797492   cpuSlice:[299,206,530,490,517,503,543,479,411]
SQL16    query_start_time:2023-05-27-22:10:37  query_end_time:2023-05-27-22:10:40  tidb_max_tiflash_threads:2     parallel:1     timeSpend(seconds):3.194497   cpuSlice:[308,257,323]
SQL16    query_start_time:2023-05-27-22:10:40  query_end_time:2023-05-27-22:10:46  tidb_max_tiflash_threads:2     parallel:2     timeSpend(seconds):6.331736   cpuSlice:[411,515,606,669,648,665]
SQL16    query_start_time:2023-05-27-22:10:46  query_end_time:2023-05-27-22:10:55  tidb_max_tiflash_threads:2     parallel:3     timeSpend(seconds):8.375367   cpuSlice:[738,665,698,822,854,800,778,797,826]
SQL17    query_start_time:2023-05-27-22:10:55  query_end_time:2023-05-27-22:11:17  tidb_max_tiflash_threads:0     parallel:1     timeSpend(seconds):21.795439  cpuSlice:[813,699,889,887,955,1038,875,946,923,885,922,885,837,960,937,916,850,705,860,832,898,892]
SQL17    query_start_time:2023-05-27-22:11:17  query_end_time:2023-05-27-22:11:56  tidb_max_tiflash_threads:0     parallel:2     timeSpend(seconds):39.009465  cpuSlice:[813,990,1085,1009,1009,942,1035,1091,1106,1012,972,999,1033,1008,946,988,1026,1000,1015,1036,941,1016,1025,997,944,1007,963,973,1062,984,886,1052,1055,1036,968,992,1048,1031]
SQL17    query_start_time:2023-05-27-22:11:56  query_end_time:2023-05-27-22:12:52  tidb_max_tiflash_threads:0     parallel:3     timeSpend(seconds):56.096449  cpuSlice:[906,813,1018,976,1017,1009,1001,969,1096,1065,1108,1098,1039,1023,1054,967,1031,1003,1011,958,998,1006,993,996,1012,1032,990,1032,1025,1058,1004,988,1030,938,973,1001,1035,1002,976,1021,1006,1074,1016,912,1042,1060,1021,1031,1074,1064,1068,1051,1084,1059,1122]
SQL17    query_start_time:2023-05-27-22:12:52  query_end_time:2023-05-27-22:13:22  tidb_max_tiflash_threads:1     parallel:1     timeSpend(seconds):30.244473  cpuSlice:[960,902,551,557,543,572,569,559,568,557,490,482,492,498,371,175,172,196,182,227,171,183,183,182,179,178,171,185,207,171]
SQL17    query_start_time:2023-05-27-22:13:22  query_end_time:2023-05-27-22:14:03  tidb_max_tiflash_threads:1     parallel:2     timeSpend(seconds):40.622963  cpuSlice:[106,114,684,660,668,657,617,630,603,639,638,669,646,657,748,670,654,685,718,685,648,672,632,669,689,652,619,330,326,361,338,358,319,303,300,371,371,306,308,307,268]
SQL17    query_start_time:2023-05-27-22:14:03  query_end_time:2023-05-27-22:15:03  tidb_max_tiflash_threads:1     parallel:3     timeSpend(seconds):59.821038  cpuSlice:[211,222,870,828,782,738,732,627,594,575,580,594,567,570,590,577,586,670,597,589,621,569,581,566,602,563,590,549,566,548,562,580,566,560,585,539,691,665,650,709,728,754,737,692,637,565,563,566,568,529,577,543,553,621,624,559,638,427,415,354]
SQL17    query_start_time:2023-05-27-22:15:03  query_end_time:2023-05-27-22:15:25  tidb_max_tiflash_threads:2     parallel:1     timeSpend(seconds):21.220804  cpuSlice:[314,317,588,633,664,650,594,621,580,610,581,592,591,574,575,603,562,571,593,571,379,342]
SQL17    query_start_time:2023-05-27-22:15:25  query_end_time:2023-05-27-22:16:06  tidb_max_tiflash_threads:2     parallel:2     timeSpend(seconds):41.388554  cpuSlice:[346,831,785,613,612,557,613,603,559,553,556,593,591,542,566,582,509,553,572,587,578,555,575,552,671,685,764,692,533,573,564,542,554,563,559,544,628,593,604,536]
SQL17    query_start_time:2023-05-27-22:16:06  query_end_time:2023-05-27-22:17:08  tidb_max_tiflash_threads:2     parallel:3     timeSpend(seconds):62.121073  cpuSlice:[592,578,764,980,923,650,565,563,570,580,545,588,582,567,565,580,609,587,682,569,577,557,545,553,580,569,551,603,560,582,559,602,586,563,567,550,577,624,619,681,853,578,651,554,563,536,558,568,561,546,543,562,558,557,552,588,678,524,649,687,697,670]
SQL18    query_start_time:2023-05-27-22:17:08  query_end_time:2023-05-27-22:17:35  tidb_max_tiflash_threads:0     parallel:1     timeSpend(seconds):26.291676  cpuSlice:[686,704,751,956,958,743,773,759,797,730,664,774,930,909,948,909,777,822,986,1027,1016,934,941,888,723,709,734]
SQL18    query_start_time:2023-05-27-22:17:35  query_end_time:2023-05-27-22:18:22  tidb_max_tiflash_threads:0     parallel:2     timeSpend(seconds):47.767957  cpuSlice:[724,724,1003,1072,1120,1105,1038,877,843,813,929,1020,905,864,848,827,932,1062,1030,1072,1053,972,1020,1030,1027,812,846,991,1127,1086,1082,1083,1072,1041,1042,1045,1047,1035,1051,826,829,817,798,838,835,839]
SQL18    query_start_time:2023-05-27-22:18:22  query_end_time:2023-05-27-22:19:32  tidb_max_tiflash_threads:0     parallel:3     timeSpend(seconds):69.420437  cpuSlice:[809,854,758,853,1019,1091,1059,1031,1043,1056,880,895,926,899,919,942,985,1056,1049,1002,823,884,880,861,927,1054,1074,1064,1117,1092,1057,1061,1078,1110,1077,1058,1040,987,964,926,971,1070,1055,1053,1070,1121,1119,1103,1112,1042,1079,1054,1067,1076,1086,1098,1082,1116,1029,884,887,912,887,908,915,844,870,885,890]
SQL18    query_start_time:2023-05-27-22:19:32  query_end_time:2023-05-27-22:20:25  tidb_max_tiflash_threads:1     parallel:1     timeSpend(seconds):52.994692  cpuSlice:[898,819,492,458,312,283,218,241,321,215,220,118,219,234,211,205,206,204,204,202,198,206,205,151,125,116,108,108,106,109,150,132,137,142,136,131,137,138,135,135,133,159,134,134,143,134,134,135,154,153,405,515,473]
SQL18    query_start_time:2023-05-27-22:20:25  query_end_time:2023-05-27-22:21:32  tidb_max_tiflash_threads:1     parallel:2     timeSpend(seconds):67.386939  cpuSlice:[377,395,847,686,719,567,415,518,497,424,506,520,493,355,423,408,448,460,392,308,302,305,304,304,303,300,303,305,307,263,238,223,239,212,262,236,262,265,255,258,245,248,253,255,260,248,256,258,256,256,255,250,253,247,256,260,251,271,325,421,611,493,598,662,463,448,435]
SQL18    query_start_time:2023-05-27-22:21:33  query_end_time:2023-05-27-22:23:01  tidb_max_tiflash_threads:1     parallel:3     timeSpend(seconds):88.215661  cpuSlice:[395,417,890,785,790,852,548,628,514,582,593,622,423,632,605,597,616,566,542,526,397,606,636,608,579,550,455,403,406,406,409,404,402,399,406,410,428,411,485,398,365,338,395,314,378,362,411,468,450,430,437,401,402,376,410,388,405,406,379,393,411,403,379,376,386,381,400,380,397,380,382,380,392,429,548,628,734,664,714,644,536,511,395,435,460,398,386,381]
SQL18    query_start_time:2023-05-27-22:23:02  query_end_time:2023-05-27-22:23:33  tidb_max_tiflash_threads:2     parallel:1     timeSpend(seconds):31.017069  cpuSlice:[408,641,606,652,438,501,386,420,331,376,440,408,410,396,394,213,268,267,266,275,259,255,254,254,256,255,252,261,691,655,449]
SQL18    query_start_time:2023-05-27-22:23:33  query_end_time:2023-05-27-22:24:30  tidb_max_tiflash_threads:2     parallel:2     timeSpend(seconds):57.150449  cpuSlice:[391,735,841,853,816,463,684,712,578,693,667,648,621,570,611,674,688,655,669,690,704,674,681,627,653,678,644,568,416,549,563,575,561,522,527,508,525,531,568,549,512,539,531,541,534,517,532,544,648,790,442,397,401,419,469,393]
SQL18    query_start_time:2023-05-27-22:24:30  query_end_time:2023-05-27-22:25:52  tidb_max_tiflash_threads:2     parallel:3     timeSpend(seconds):82.293926  cpuSlice:[387,394,867,1029,940,952,822,788,863,878,818,820,733,812,810,804,795,786,772,689,794,838,846,802,782,804,800,824,796,824,826,857,818,824,851,785,801,784,735,552,556,622,790,813,759,761,821,808,777,828,847,802,752,718,742,807,768,739,752,712,714,748,755,759,728,729,764,805,771,867,528,419,443,435,394,400,397,412,447,400,392,388]
SQL19    query_start_time:2023-05-27-22:25:52  query_end_time:2023-05-27-22:26:01  tidb_max_tiflash_threads:0     parallel:1     timeSpend(seconds):9.093860   cpuSlice:[420,473,736,772,731,752,769,759]
SQL19    query_start_time:2023-05-27-22:26:01  query_end_time:2023-05-27-22:26:17  tidb_max_tiflash_threads:0     parallel:2     timeSpend(seconds):15.888105  cpuSlice:[731,805,731,883,944,845,839,854,829,833,853,834,828,780,859,844]
SQL19    query_start_time:2023-05-27-22:26:17  query_end_time:2023-05-27-22:26:39  tidb_max_tiflash_threads:0     parallel:3     timeSpend(seconds):21.486692  cpuSlice:[818,868,824,809,906,874,943,893,942,968,954,887,913,898,918,923,919,944,907,938,964,928]
SQL19    query_start_time:2023-05-27-22:26:39  query_end_time:2023-05-27-22:26:51  tidb_max_tiflash_threads:1     parallel:1     timeSpend(seconds):12.487490  cpuSlice:[940,684,266,277,276,275,280,280,267,246,246,264]
SQL19    query_start_time:2023-05-27-22:26:51  query_end_time:2023-05-27-22:27:09  tidb_max_tiflash_threads:1     parallel:2     timeSpend(seconds):17.540485  cpuSlice:[273,259,436,495,429,440,470,458,458,451,451,451,446,403,471,454,453,460]
SQL19    query_start_time:2023-05-27-22:27:09  query_end_time:2023-05-27-22:27:35  tidb_max_tiflash_threads:1     parallel:3     timeSpend(seconds):25.662575  cpuSlice:[462,435,643,494,455,450,470,468,489,481,459,498,460,485,503,445,452,477,489,525,493,475,462,459,475,481]
SQL19    query_start_time:2023-05-27-22:27:35  query_end_time:2023-05-27-22:27:43  tidb_max_tiflash_threads:2     parallel:1     timeSpend(seconds):8.470492   cpuSlice:[493,452,426,447,421,417,422,418]
SQL19    query_start_time:2023-05-27-22:27:43  query_end_time:2023-05-27-22:28:01  tidb_max_tiflash_threads:2     parallel:2     timeSpend(seconds):17.491989  cpuSlice:[417,438,555,440,440,458,466,454,440,454,452,444,472,505,458,439,442,448]
SQL19    query_start_time:2023-05-27-22:28:01  query_end_time:2023-05-27-22:28:27  tidb_max_tiflash_threads:2     parallel:3     timeSpend(seconds):25.888114  cpuSlice:[475,646,552,461,458,457,466,456,492,458,486,483,483,456,459,473,487,507,573,471,451,458,481,466,467,478]
SQL20    query_start_time:2023-05-27-22:28:27  query_end_time:2023-05-27-22:28:34  tidb_max_tiflash_threads:0     parallel:1     timeSpend(seconds):7.351218   cpuSlice:[460,660,751,819,737,762,744]
SQL20    query_start_time:2023-05-27-22:28:34  query_end_time:2023-05-27-22:28:48  tidb_max_tiflash_threads:0     parallel:2     timeSpend(seconds):13.547415  cpuSlice:[769,736,815,782,845,875,962,863,829,826,785,868,857]
SQL20    query_start_time:2023-05-27-22:28:48  query_end_time:2023-05-27-22:29:07  tidb_max_tiflash_threads:0     parallel:3     timeSpend(seconds):19.483388  cpuSlice:[849,796,870,886,812,959,912,838,855,837,956,832,872,952,868,886,903,881,912]
SQL20    query_start_time:2023-05-27-22:29:07  query_end_time:2023-05-27-22:29:16  tidb_max_tiflash_threads:1     parallel:1     timeSpend(seconds):8.501492   cpuSlice:[878,796,495,434,429,422,423,386,420]
SQL20    query_start_time:2023-05-27-22:29:16  query_end_time:2023-05-27-22:29:32  tidb_max_tiflash_threads:1     parallel:2     timeSpend(seconds):15.866987  cpuSlice:[392,385,500,470,440,434,407,427,409,418,427,435,464,425,396,426]
SQL20    query_start_time:2023-05-27-22:29:32  query_end_time:2023-05-27-22:29:54  tidb_max_tiflash_threads:1     parallel:3     timeSpend(seconds):21.989480  cpuSlice:[402,472,619,460,511,416,428,399,429,435,430,419,411,430,415,417,500,440,420,420,428,422]
SQL20    query_start_time:2023-05-27-22:29:54  query_end_time:2023-05-27-22:30:03  tidb_max_tiflash_threads:2     parallel:1     timeSpend(seconds):8.756992   cpuSlice:[419,413,423,412,404,413,390,414,408]
SQL20    query_start_time:2023-05-27-22:30:03  query_end_time:2023-05-27-22:30:19  tidb_max_tiflash_threads:2     parallel:2     timeSpend(seconds):16.576485  cpuSlice:[407,492,455,498,437,483,436,460,429,434,422,418,474,473,428,434]
SQL20    query_start_time:2023-05-27-22:30:19  query_end_time:2023-05-27-22:30:45  tidb_max_tiflash_threads:2     parallel:3     timeSpend(seconds):25.552974  cpuSlice:[422,472,650,528,447,579,470,467,433,434,441,438,458,430,425,439,447,424,459,534,466,441,420,426,427,438]
SQL21    query_start_time:2023-05-27-22:30:45  query_end_time:2023-05-27-22:31:13  tidb_max_tiflash_threads:0     parallel:1     timeSpend(seconds):28.033427  cpuSlice:[444,578,909,1021,1021,969,1018,928,1001,967,1011,967,1004,976,980,1023,953,967,981,946,926,962,970,930,863,777,672,918]
Error 1105 (HY000): rpc error: code = Unavailable desc = error reading from server: read tcp 192.168.31.201:47660->192.168.31.201:3930: read: connection reset by peer;tiflash_threads:0,parallel:2,SQL:21
SQL22    query_start_time:2023-05-27-22:31:13  query_end_time:2023-05-27-22:32:52  tidb_max_tiflash_threads:0     parallel:2     timeSpend(seconds):98.800936  cpuSlice:[904,697,1002,1016,988,989,1034,1001,1044,946,1020,1014,1007,1023,986,1033,1014,1015,1039,1032,1019,1065,1036,1060,1019,1113,943,1107,1052,1080,1085,1094,993,1055,1075,1076,1050,1124,1056,1076,1099,651,934,862,267,1122,1069,1108,893,1042,940,966,1035,1035,1016,1014,997,823,948,922,937,1008,1068,999,1047,979,911,938,715,568,563,584,542,947,200]
Error 1105 (HY000): rpc error: code = Unavailable desc = error reading from server: read tcp 192.168.31.201:47658->192.168.31.201:3930: read: connection reset by peer;tiflash_threads:0,parallel:2,SQL:21
Error 1105 (HY000): rpc error: code = Unavailable desc = connection error: desc = "transport: Error while dialing dial tcp 192.168.31.201:3930: connect: connection refused";tiflash_threads:0,parallel:3,SQL:21
SQL22    query_start_time:2023-05-27-22:32:52  query_end_time:2023-05-27-22:33:09  tidb_max_tiflash_threads:0     parallel:3     timeSpend(seconds):17.027919  cpuSlice:[100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100]
SQL21    query_start_time:2023-05-27-22:35:24  query_end_time:2023-05-27-22:36:01  tidb_max_tiflash_threads:1     parallel:1     timeSpend(seconds):37.504757  cpuSlice:[100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100]
SQL21    query_start_time:2023-05-27-22:36:01  query_end_time:2023-05-27-22:37:04  tidb_max_tiflash_threads:1     parallel:2     timeSpend(seconds):62.396944  cpuSlice:[100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100]
Error 1105 (HY000): rpc error: code = Unavailable desc = error reading from server: read tcp 192.168.31.201:54382->192.168.31.201:3930: read: connection reset by peer;tiflash_threads:1,parallel:3,SQL:21
SQL22    query_start_time:2023-05-27-22:37:04  query_end_time:2023-05-27-22:38:48  tidb_max_tiflash_threads:1     parallel:3     timeSpend(seconds):103.867961 cpuSlice:[100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100]
Error 1105 (HY000): rpc error: code = Unavailable desc = error reading from server: read tcp 192.168.31.201:54450->192.168.31.201:3930: read: connection reset by peer;tiflash_threads:1,parallel:3,SQL:21
Error 1105 (HY000): rpc error: code = Unavailable desc = error reading from server: read tcp 192.168.31.201:54722->192.168.31.201:3930: read: connection reset by peer;tiflash_threads:1,parallel:3,SQL:21
Error 1105 (HY000): rpc error: code = Unavailable desc = connection error: desc = "transport: Error while dialing dial tcp 192.168.31.201:3930: connect: connection refused";tiflash_threads:2,parallel:1,SQL:21
SQL22    query_start_time:2023-05-27-22:38:48  query_end_time:2023-05-27-22:39:06  tidb_max_tiflash_threads:2     parallel:1     timeSpend(seconds):18.299031  cpuSlice:[100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100]
SQL21    query_start_time:2023-05-27-22:39:06  query_end_time:2023-05-27-22:40:41  tidb_max_tiflash_threads:2     parallel:2     timeSpend(seconds):94.958876  cpuSlice:[100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100]

在很多场景下,当tidb_max_tiflash_threads=1时候并没有很好的控制住CPU的线程数,上面的典型测试数据样例:

SQL2     query_start_time:2023-05-27-21:22:08  query_end_time:2023-05-27-21:22:12  tidb_max_tiflash_threads:1     parallel:1     timeSpend(seconds):4.223496   cpuSlice:[972,681,589,606]

请问这是work in design吗? 还是说待改进?

这个指的是单个request的并行度吧

TiFlash 在跑 query 的时候,如果走了 mpp 的话,query 会被切分为多个mpp task,而每个 mpp task 最多用的线程数量是 max_threads 来控制的。

但是我这个集群上只有一个tiflash节点。在一个tiflash节点上应该只有一个mppTask吧?

一个 query 具体有多少 mpp task 是取决于 query 的复杂程度和 tiflash 节点数量。mpp query 根据执行计划被分为一些 stage(fragment),然后每个 fragment 被分为多个 mpp task(每个 tiflash 节点一个)。

但是我这个tidb集群中只有一个tiflash节点。

此话题已在最后回复的 60 天后被自动关闭。不再允许新回复。