Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.Original topic: TiFlash做tpcc时,CPU利用率低,5个OLAP并发就查询特别慢
【TiDB Usage Environment】POC
【TiDB Version】6.1.1
【Encountered Problem】When using TiFlash for TPCC, CPU utilization is low, and queries become particularly slow with just 5 OLAP concurrent queries.
【Optimizations Done】
set @@tidb_distsql_scan_concurrency = 80;
set @@tidb_allow_batch_cop = 1;
set @@tidb_opt_agg_push_down = 1;
set @@tidb_opt_distinct_agg_push_down = 1;
SET GLOBAL tidb_max_tiflash_threads = 18;
set @@session.tidb_allow_mpp=1;
set @@session.tidb_enforce_mpp=1;
【Problem Phenomenon and Impact】
When not running TPCC, a single count query is very fast, but once TPCC is running, it becomes extremely slow (TPCC test is also very slow, and executing a single count query is also slow). CPU shows no pressure, and memory and disk utilization are also very low. I am purely executing OLAP, with OLTP threads at 0, so there is no interference from writes. It feels like some thread count setting is incorrect, and enabling MPP has no effect.
【Attachment】Execution Plan