Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

What are the best practices for Spring Cloud Eureka production configuration

Shulou Source: shulou.com Published: 2022-06-02 02:14:24 09月28日 Update

In this issue, the editor will bring you about the best practices of Spring Cloud Eureka production configuration. The article is rich in content and analyzed and described from a professional point of view. I hope you can get something after reading this article.

Based on SpringCloud-Dalston.SR5

Faster service availability can be achieved:

EurekaServer configuration: # time when eureka server refreshes readCacheMap. Note that client reads readCacheMap, which determines how long the readWriteCacheMap cache will be updated to readCacheMap. # default 30seureka.server.responseCacheUpdateInvervalMs=3000#eureka server cache readWriteCacheMap expiration time, this cache will expire only after this time, and will not be updated before expiration. Re-read the registration service information from registry after expiration. Registry is a ConcurrentHashMap. # since evict is enabled, it is not necessary to change this configuration # default 180seureka.server.responseCacheAutoExpirationInSeconds=180# is enabled for active failure, and each active failure detection interval is the default 60seureka.server.eviction-interval-timer-in-ms=3000# service expiration time configuration for 3s#. If you do not receive a heartbeat beyond this time, EurekaServer will remove this instance # Note: EurekaServer must set eureka.server.eviction-interval-timer-in-ms, otherwise this configuration is invalid. This configuration is generally three times the configuration of service refresh time # default 90seureka.instance.lease-expiration-duration-in-seconds=15# service refresh time configuration Active heartbeat every other time # default 30seureka.instance.lease-renewal-interval-in-seconds=5#eureka client refresh local cache time # default 30seureka.client.registryFetchIntervalSeconds=5#eureka client ribbon refresh time # default 30sribbon.ServerListRefreshInterval=1000eureka.instance.preferIpAddress=true# off self-protection eureka.server.enable-self-preservation=falseeureka.client.serviceUrl.defaultZone= http://10.120.242.153:8211/eureka/, Http://10.120.242.154:8211/eureka/EurekaClient configuration: # Service expiration time configuration. If you do not receive a heartbeat within this time, EurekaServer will delete this instance # Note EurekaServer must set eureka.server.eviction-interval-timer-in-ms, otherwise this configuration is invalid, which is generally three times the configuration of service refresh time # default 90seureka.instance.lease-expiration-duration-in-seconds=15# service refresh time configuration Active heartbeat every other time # default 30seureka.instance.lease-renewal-interval-in-seconds=5#eureka client refresh local cache time # default 30seureka.client.registryFetchIntervalSeconds=5#eureka client ribbon refresh time # default 30sribbon.ServerListRefreshInterval=1000eureka.instance.preferIpAddress=true# off self-protection eureka.server.enable-self-preservation=falseeureka.client.serviceUrl.defaultZone= http://10.120.242.153:8211/eureka/, Http://10.120.242.154:8211/eureka/, these are the best practices of Spring Cloud Eureka production configuration shared by the editor. If you happen to have similar doubts, you might as well refer to the above analysis to understand. If you want to know more about it, you are welcome to follow the industry information channel.

Tags: Time configuration service cache practice production initiative conference host content instance customer client protection analysis update offline professional small and medium information rich content Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Xiaomi MySQL Linux OPPO Reno macOS