避免服务发现GC Overhead Limit Reached风险

我们在使用开源的Spring-Cloud-Netflix(Spring Cloud 1.2.3.RELEASE)的服务发现中发现了一个已知Bug, 会影响使用RestTemplate方式进行服务调用时,存在Servo监控对象分配过多,GC Overhead Limit Reached风险。

https://github.com/spring-cloud/spring-cloud-netflix/issues/947

推荐解决方案:

1. 在配置文件application.properties 中添加:
spring.metrics.servo.enabled=false

这个配置会禁止搜集servo metrics, 因为当前监控方案并没使用到netflix自带的servo。

2.修改REST Template的使用方式

 

https://github.com/spring-cloud/spring-cloud-netflix/blob/master/docs/src/main/asciidoc/spring-cloud-netflix.adoc

随着使用Eureka服务发现的服务大量增多,为了避免出现潜在不稳定风险,希望大家注意这个问题,最好两个方案都采用。


你可能感兴趣的:(微服务实践之路)