【 TiDB 使用环境】测试
【 TiDB 版本】v8.1.1
【遇到的问题:问题现象及影响】
test.news1结构:
CREATE TABLE news1
(
id
int(10) unsigned NOT NULL AUTO_INCREMENT,
title
varchar(250) COLLATE utf8mb4_general_ci DEFAULT NULL,
content
longtext COLLATE utf8mb4_general_ci NOT NULL,
PRIMARY KEY (id
)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
数据:
Row_count: 75177
Avg_row_length:3144
Data_length: 238541732
test.news2: 从 test.news1复制两次,Row_count: 150354,Data_length: 472332520
test.news3: 从 test.news1复制三次,Row_count: 225531,Data_length: 708498780
test.news4: 从 test.news1复制四次,Row_count: 300708,Data_length: 944665040
test.news5: 从 test.news1复制五次,Row_count: 375885,Data_length: 1180831300
test.pros: 结构与test.news1相同,数据:
Row_count: 336886
Avg_row_length:1676
Data_length: 564705714
每个表连续执行10次查询,$i=0 to 9
0 or title like ‘%品%’ or content like ‘%品%’ or title like ‘%出口%’ or content like ‘%出口%’ or title like ‘%产品%’ or content like ‘%产品%’ or title like ‘%的%’ or content like ‘%的%’ or title like ‘%出%’ or content like ‘%出%’ or title like ‘%$i%’ or content like ‘%$i%’
耗时如下:(单位为秒)
test.news1: 0.5545, 0.4413, 0.3931, 0.4755, 0.4108, 0.3864, 0.4391, 0.3794, 0.4256, 0.3949, 平均耗时: 0.4301
test.news2: 0.7900, 0.6125, 0.6246, 0.6020, 0.5843, 0.6068, 0.5807, 0.6158, 0.5789, 0.5948, 平均耗时: 0.6191
test.news3: 1.1054, 0.7687, 0.8514, 1.0047, 0.9091, 0.8092, 0.8003, 0.7621, 0.7961, 0.7915, 平均耗时: 0.8599
test.news4: 1.3177, 1.1293, 1.0311, 1.0302, 1.1234, 1.0062, 1.0345, 1.1596, 1.1279, 0.9928, 平均耗时: 1.0953
test.news5: 1.4909, 1.1778, 1.0859, 1.1331, 1.1504, 1.2957, 1.0915, 1.1303, 1.1098, 1.1392, 平均耗时: 1.1805
test.pros: 1.0613, 0.5713, 0.6237, 0.5955, 0.6363, 0.5706, 0.6131, 0.6092, 0.6220, 0.6219, 平均耗时: 0.6526
运行时资源管理器截图(不含test.pros的查询)
似乎是32万记录以上才能跑满CPU。
tiup cluster edit-config 已设置 profiles.default.max_threads: 32
修改以下两项参数后,也不能实现查询news1-news4时跑满CPU:
SET GLOBAL tiflash_fine_grained_shuffle_batch_size = 4096;
SET GLOBAL tiflash_fine_grained_shuffle_stream_count = 64;
请问要如何设置,使得5-10万行数据也能在TiFlash中跑满所有核心?现在测试8核心16线程,后期生产环境会是32-64核心,或者96-128核心。
【资源配置】进入到 TiDB Dashboard -集群信息 (Cluster Info) -主机(Hosts) 截图此页面
物理机:AMD Ryzen 7 7700-8 Core,内存 96GB, Windowns 11
虚拟机:16Core,32GB内存,OpenEuler-24.03
TiDB v8.1.1单机部署,1 TiKV, 1 TiFlash
【附件:截图/日志/监控】