【问题标题】:spring cloud consul high cpu in a spring boot application春季启动应用程序中的春季云领事高cpu
【发布时间】: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


【解决方案1】:

作为一种解决方法,设置spring.cloud.consul.discovery.catalogServicesWatchDelay=30000

通过issue 94修复。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2017-01-27
    • 2018-06-15
    • 2018-05-20
    • 1970-01-01
    • 2015-11-11
    • 2018-09-04
    • 1970-01-01
    • 2017-10-06
    相关资源
    最近更新 更多