【发布时间】:2015-12-23 02:01:24
【问题描述】:
我使用 @EnableDiscoveryClient 设置了一个 Spring Boot 应用程序,并使用 Consul 作为云提供商。我注意到由于ConsulCatalogWatch.catalogServicesWatch,这会产生高 CPU 消耗。查看代码,我注意到注释
@Scheduled(fixedDelayString = "${spring.cloud.consul.discovery.catalogServicesWatchDelay:10}")
将导致此方法以非常高的速率被调用。 有没有人遇到过这个,我错过了什么?
【问题讨论】:
-
那么为什么不简单地将该属性重新配置为另一个值...
-
这是Spring Cloud consul代码的一部分,我只是想知道默认值10ms
-
是的,这个数字很小,我会解决的。
-
好消息是您可以更改该值作为解决方法。
标签: java spring-boot cpu-usage spring-cloud consul