shardingsphere icon indicating copy to clipboard operation
shardingsphere copied to clipboard

Sudden CPU idle alarm caused by shardingshpere-proxy

Open xiaoyuge opened this issue 2 years ago • 2 comments

Question

Today I encountered a CPU idle alarm issue caused by shardingshpere-proxy. I suddenly received a CPU monitoring alarm in the production environment, and the CPU usage rate exceeded the threshold. So, I logged into the production environment machine and used the top command to view the results, which are as follows:

CPU Idle-2

From the graph, it can be seen that the CPU utilization rate of shardingshper proxy has reached 790.7%. So, I further examined which threads had higher CPU usage, as shown in the following figure:

cpu-thread-2

Then, based on this information, I further examined the thread stack information of these high CPU occupied threads, as follows:

thread-stack thread-stack-2 thread-stack-3

From the thread stack information, it seems that some kind of SQL optimization is being done. May I ask, what are these threads specifically doing? How to avoid high CPU usage caused by this type of thread?

ShardingShpere-proxy version is 5.3.2 Mysql version is 5.7.37

xiaoyuge avatar Jul 11 '24 05:07 xiaoyuge

@xiaoyuge Did you use the experimental SQL Federation feature?

strongduanmu avatar Jul 11 '24 05:07 strongduanmu

@strongduanmu I have checked my configuration files,i didn't use the SQL Federation feature.Is there any place to enable this feature?

xiaoyuge avatar Jul 11 '24 06:07 xiaoyuge