TiFlash 负载不均衡,导致tidb-server响应变慢

  1. 发现最慢的查询都是同一个 sql。请问这条 sql 平时查询性能如何?是一直这么慢还是只有出问题的时间段才慢?

select DATE_FORMAT(policy_time,’%Y-%m’) as task_create_date, agent_id, agent_name, team_id, team_name, round(count(case when refund_order_no is null then order_no end),2) order_num, round(sum(case when refund_order_no is null then origin end),2) origin, round(sum(case when refund_order_no is null then origin end)/count(case when refund_order_no is null then order_no end),2) avg_amt_rates, round(sum(case when refund_order_no is not null then origin end)/sum(case when refund_order_no is null then origin end),4) refund_rates from rpt_sdb_crm_order_stat_history_d where valid = 1 and is_long = 1 and daTe_foRmat(policy_time,’%y-%m-%d’) >= ‘2021-08-01’ and daTe_foRmat(policy_time,’%y-%m-%d’) <= ‘2021-08-31’ and agent_id in (‘BDFZGJQDWXZC_202009061053401’ ) and team_id in (1239, 729, 730, 731, 732, 733, 1231, 735 ) and group_id in (2816, 2817, 2818, 2819, 2820, 2821, 2822, 2823, 5255, 2824, 2825, 6218, 5258, 2826, 6219, 5387, 5259, 2827, 5388, 2828, 5260, 6349, 2829, 5261, 2830, 2831, 2832, 2833, 2834, 2835, 5268, 5269, 3608, 6115, 5484, 5485, 3310, 2807, 2808, 2809, 2810, 5051, 5052, 2813, 2814, 5375, 2815 ) group by agent_id, agent_name, team_id, team_name, DATE_FORMAT(policy_time,’%Y-%m’) order by task_create_date asc, agent_id asc;

  1. 看看这台机器的 cpu mode 与其他节点的差异:

cat /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor


日志 (1.2 KB) 日志

请问这个问题是否仍然存在,如果的是话,麻烦参考楼上提供的命令,分别抓取下问题时间段和正常时间段的 tiflash 火焰图,谢谢!

TiDB 集群诊断报告.zip (938.1 KB)
一天的诊断报告

请问老师,你的问题解决了吗?

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