Nacos version:1.1.3
client version:1.0.0

dependency: 'org.springframework.cloud:spring-cloud-alibaba-nacos-config:0.9.0.RELEASE'

description as below:

NacosConfigService will be rebuilt every time the configuration file is changed in the console. After hundreds of configuration changes, the CPU will burst due to too many ClientWorker threads created.The NacosConfigService classe is not manually created。

Nacos client 客户端cpu占用100% 问题排查和解决方案

Maybe problem is in the class org.springframework.cloud.alibaba.nacos.NacosConfigProperties,because springcloud will refresh class with annotation @ConfigurationProperties,this class will be rebuilt after every refresh phase.

Nacos client 客户端cpu占用100% 问题排查和解决方案

Nacos client 客户端cpu占用100% 问题排查和解决方案

 

详情可参考 issue :https://github.com/alibaba/spring-cloud-alibaba/issues/912

问题简单点描述为:使用了org.springframework.cloud:spring-cloud-alibaba-nacos-config:0.9.0.RELEASE 客户端,在持续刷新配置文件的情况下会造成cpu 100%。

原因是因为在springcloud refresh environment的时候,NacosConfigService 会重复创建,NacosConfigService中包含了几个定时任务的线程(名为:com.alibaba.nacos.client.Workder.fixed-***),在多次修改(线上慢慢积累)配置文件后,积累的的Worker线程会耗费掉cpu资源。

 

解决办法:hold住 NacosConfigService实例,在刷新的时候不去创建新的类。注意:naming模块也有相同的问题,解决办法相同。

 

相关文章:

  • 2021-08-28
  • 2021-05-27
  • 2022-12-23
  • 2021-12-31
  • 2022-12-23
  • 2021-12-11
  • 2022-01-16
  • 2021-07-30
猜你喜欢
  • 2021-04-27
  • 2022-12-23
  • 2021-12-08
  • 2021-05-22
  • 2022-02-22
相关资源
相似解决方案