I am trying for a use case where I have 3 instance there are registering eureka server. I made my eureka server up and 3 instance up in client. All 3 registered with eureka server properly. After running 2 mins I stopped one instance in eclipse. My expectation was after 90 sec it should evict the client, that is not happening.Almost after 5 mins its evicting the client.
My requirement is after the instance went down within 30 sec the server needs evict that particular instance. Can you please suggest @spencergibb @ryanjbaxter @fahimfarookme I have followed below link also but looks like something wrong with my configuration. eureka server configuration
spring.application.name=my-eureka-server
server.address=localhost
server.port=8761
logging.level.com.netflix.eureka=ON
logging.level.com.netflix.discovery=OFF
eureka.client.register-with-eureka=false
eureka.client.fetch-registry=false
eureka.server.eviction-interval-timer-in-ms = 9000
eureka.server.renewalPercentThreshold=0.33
eureka.server.enable-self-preservation=false
eureka.instance.hostname=localhost
eureka instance configuration
spring.application.name=my-data-processing
management.endpoints.web.exposure.include=*
management.endpoint.health.show-details=always
eureka.client.service-url.defaultZone=http://localhost:8761/eureka/
eureka.client.healthcheck.enabled=true
eureka.client.eurekaServiceUrlPollIntervalSeconds=60
eureka.instance.lease-renewal-interval-in-seconds = 30
eureka.instance.lease-expiration-duration-in-seconds = 90
eureka.instance.leaseRenewalIntervalInSeconds=30
eureka.instance.leaseExpirationDurationInSeconds=90
eureka.instance.status-page-url-path=/actuator/info
eureka.instance.health-check-url-path=/actuator/health
eureka.instance.hostname=localhost
eureka.instance.instance-id=${eureka.instance.hostname}:${spring.application.name}:${spring.application.instance_id}:${server.port}
jetty.threadPool.maxThreads=10
jetty.threadPool.minThreads=2
jetty.threadPool.idleTimeout=60000
At 12:59:40PM I stopped my instance .
Eureka Server Log :-
2019-09-14 12:58:40.919 INFO 1116 --- [a-EvictionTimer] c.n.e.registry.AbstractInstanceRegistry : Running the evict task with compensationTime 3ms
2019-09-14 12:58:49.925 INFO 1116 --- [a-EvictionTimer] c.n.e.registry.AbstractInstanceRegistry : Running the evict task with compensationTime 5ms
2019-09-14 12:58:50.876 INFO 1116 --- [tp1370709582-22] c.n.e.registry.AbstractInstanceRegistry : Registered instance MY-DATA-PROCESSING/localhost:my-data-processing:1:8081 with status UP (replication=false)
2019-09-14 12:58:58.932 INFO 1116 --- [a-EvictionTimer] c.n.e.registry.AbstractInstanceRegistry : Running the evict task with compensationTime 7ms
2019-09-14 12:59:07.938 INFO 1116 --- [a-EvictionTimer] c.n.e.registry.AbstractInstanceRegistry : Running the evict task with compensationTime 6ms
_**Every 10 secs it prints the same**_
2019-09-14 13:02:26.125 INFO 1116 --- [a-EvictionTimer] c.n.e.registry.AbstractInstanceRegistry : Running the evict task with compensationTime 8ms
2019-09-14 13:02:26.125 INFO 1116 --- [a-EvictionTimer] c.n.e.registry.AbstractInstanceRegistry : Evicting 1 items (expired=1, evictionLimit=1)
2019-09-14 13:02:26.126 WARN 1116 --- [a-EvictionTimer] c.n.e.registry.AbstractInstanceRegistry : DS: Registry: expired lease for MY-DATA-PROCESSING/localhost:my-data-processing:1:8081
2019-09-14 13:02:26.128 INFO 1116 --- [a-EvictionTimer] c.n.e.registry.AbstractInstanceRegistry : Cancelled instance MY-DATA-PROCESSING/localhost:my-data-processing:1:8081 (replication=false)
Comment From: ryanjbaxter
I assume this is the instance you are expecting to be evicted MY-DATA-PROCESSING/localhost:my-data-processing:1:8081?
You said _**Every 10 secs it prints the same**_, so is it printing this but still returning the instance?
Comment From: bmpattanaik
I assume this is the instance you are expecting to be evicted MY-DATA-PROCESSING/localhost:my-data-processing:1:8081? Yes This instance need to evicted after 90 sec.
so is it printing this but still returning the instance? Yes http://localhost:8761/eureka/apps/MY-DATA-PROCESSING/localhost:my-data-processing:1:8081 It returns values with status Up.
<instance>
<instanceId>localhost:my-data-processing:1:8081</instanceId>
<hostName>localhost</hostName>
<app>MY-DATA-PROCESSING</app>
<ipAddr>192.168.1.239</ipAddr>
<status>UP</status>
<overriddenstatus>UNKNOWN</overriddenstatus>
<port enabled="true">8081</port>
<securePort enabled="false">443</securePort>
<countryId>1</countryId>
<dataCenterInfo class="com.netflix.appinfo.InstanceInfo$DefaultDataCenterInfo">
<name>MyOwn</name>
</dataCenterInfo>
<leaseInfo>
<renewalIntervalInSecs>30</renewalIntervalInSecs>
<durationInSecs>90</durationInSecs>
<registrationTimestamp>1568657445387</registrationTimestamp>
<lastRenewalTimestamp>1568657595087</lastRenewalTimestamp>
<evictionTimestamp>0</evictionTimestamp>
<serviceUpTimestamp>1568657445389</serviceUpTimestamp>
</leaseInfo>
<metadata>
<management.port>8081</management.port>
</metadata>
<homePageUrl>http://localhost:8081/</homePageUrl>
<statusPageUrl>http://localhost:8081/actuator/info</statusPageUrl>
<healthCheckUrl>http://localhost:8081/actuator/health</healthCheckUrl>
<vipAddress>my-data-processing</vipAddress>
<secureVipAddress>my-data-processing</secureVipAddress>
<isCoordinatingDiscoveryServer>false</isCoordinatingDiscoveryServer>
<lastUpdatedTimestamp>1568657445391</lastUpdatedTimestamp>
<lastDirtyTimestamp>1568657445069</lastDirtyTimestamp>
<actionType>ADDED</actionType>
</instance>
Comment From: spencergibb
Please learn how to properly format code and logs.
Comment From: spencergibb
maybe set loggin.level.com.netflix.eureka.registry=DEBUG on the eureka server?
Comment From: bmpattanaik
2019-09-16 19:32:00.004 I made my node down It took near 3 to 4 mins to cancel the instance. Attached the log.
2019-09-16 19:34:46.272 INFO 12732 --- [a-EvictionTimer] c.n.e.registry.AbstractInstanceRegistry : Cancelled instance MY-DATA-PROCESSING/localhost:my-data-processing:1:8081 (replication=false)
2019-09-16 19:35:00.007 DEBUG 12732 --- [-CacheFillTimer] c.n.eureka.registry.ResponseCacheImpl : Updating the client cache from response cache
2019-09-16 19:35:00.007 DEBUG 12732 --- [-CacheFillTimer] c.n.eureka.registry.ResponseCacheImpl : Updating the client cache from response cache for key : Application ALL_APPS_DELTA V2 JSON
2019-09-16 19:35:00.008 DEBUG 12732 --- [-CacheFillTimer] c.n.e.registry.AbstractInstanceRegistry : The number of elements in the delta queue is : 1
2019-09-16 19:35:00.008 DEBUG 12732 --- [-CacheFillTimer] c.n.e.registry.AbstractInstanceRegistry : The instance id localhost:my-data-processing:1:8081 is found with status UP and actiontype DELETED
2019-09-16 19:29:41.199 INFO 12732 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.cloud.autoconfigure.ConfigurationPropertiesRebinderAutoConfiguration' of type [org.springframework.cloud.autoconfigure.ConfigurationPropertiesRebinderAutoConfiguration$$EnhancerBySpringCGLIB$$fbbb2d45] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
. ____ _ __ _ _
/\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
\\/ ___)| |_)| | | | | || (_| | ) ) ) )
' |____| .__|_| |_|_| |_\__, | / / / /
=========|_|==============|___/=/_/_/_/
:: Spring Boot :: (v2.1.4.RELEASE)
2019-09-16 19:29:41.576 INFO 12732 --- [ main] c.b.m.r.s.MyRegistryServiceApplication : No active profile set, falling back to default profiles: default
2019-09-16 19:29:42.345 WARN 12732 --- [ main] o.s.boot.actuate.endpoint.EndpointId : Endpoint ID 'service-registry' contains invalid characters, please migrate to a valid format.
2019-09-16 19:29:42.645 INFO 12732 --- [ main] o.s.cloud.context.scope.GenericScope : BeanFactory id=248fb24a-fdae-3277-a19a-405c847874eb
2019-09-16 19:29:42.743 INFO 12732 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.cloud.autoconfigure.ConfigurationPropertiesRebinderAutoConfiguration' of type [org.springframework.cloud.autoconfigure.ConfigurationPropertiesRebinderAutoConfiguration$$EnhancerBySpringCGLIB$$fbbb2d45] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2019-09-16 19:29:42.922 INFO 12732 --- [ main] org.eclipse.jetty.util.log : Logging initialized @3381ms to org.eclipse.jetty.util.log.Slf4jLog
2019-09-16 19:29:43.031 INFO 12732 --- [ main] o.s.b.w.e.j.JettyServletWebServerFactory : Server initialized with port: 8761
2019-09-16 19:29:43.035 INFO 12732 --- [ main] org.eclipse.jetty.server.Server : jetty-9.4.15.v20190215; built: 2019-02-15T16:53:49.381Z; git: eb70b240169fcf1abbd86af36482d1c49826fa0b; jvm 1.8.0_211-b12
2019-09-16 19:29:43.172 INFO 12732 --- [ main] o.e.j.s.h.ContextHandler.application : Initializing Spring embedded WebApplicationContext
2019-09-16 19:29:43.173 INFO 12732 --- [ main] o.s.web.context.ContextLoader : Root WebApplicationContext: initialization completed in 1583 ms
2019-09-16 19:29:43.290 WARN 12732 --- [ main] c.n.c.sources.URLConfigurationSource : No URLs will be polled as dynamic configuration sources.
2019-09-16 19:29:43.290 INFO 12732 --- [ main] c.n.c.sources.URLConfigurationSource : To enable URLs as dynamic configuration sources, define System property archaius.configurationSource.additionalUrls or make config.properties available on classpath.
2019-09-16 19:29:43.316 INFO 12732 --- [ main] c.netflix.config.DynamicPropertyFactory : DynamicPropertyFactory is initialized with configuration sources: com.netflix.config.ConcurrentCompositeConfiguration@3fe46690
2019-09-16 19:29:44.328 INFO 12732 --- [ main] org.eclipse.jetty.server.session : DefaultSessionIdManager workerName=node0
2019-09-16 19:29:44.328 INFO 12732 --- [ main] org.eclipse.jetty.server.session : No SessionScavenger set, using defaults
2019-09-16 19:29:44.329 INFO 12732 --- [ main] org.eclipse.jetty.server.session : node0 Scavenging every 600000ms
2019-09-16 19:29:44.337 INFO 12732 --- [ main] o.e.jetty.server.handler.ContextHandler : Started o.s.b.w.e.j.JettyEmbeddedWebAppContext@93824eb{application,/,[file:///C:/Users/biswo/AppData/Local/Temp/jetty-docbase.8857424335590350031.8761/],AVAILABLE}
2019-09-16 19:29:44.338 INFO 12732 --- [ main] org.eclipse.jetty.server.Server : Started @4800ms
2019-09-16 19:29:44.357 WARN 12732 --- [ main] c.n.c.sources.URLConfigurationSource : No URLs will be polled as dynamic configuration sources.
2019-09-16 19:29:44.358 INFO 12732 --- [ main] c.n.c.sources.URLConfigurationSource : To enable URLs as dynamic configuration sources, define System property archaius.configurationSource.additionalUrls or make config.properties available on classpath.
2019-09-16 19:29:44.573 INFO 12732 --- [ main] o.s.s.concurrent.ThreadPoolTaskExecutor : Initializing ExecutorService 'applicationTaskExecutor'
2019-09-16 19:29:45.792 INFO 12732 --- [ main] o.s.c.n.eureka.InstanceInfoFactory : Setting initial instance status as: STARTING
2019-09-16 19:29:46.007 INFO 12732 --- [ main] c.n.e.registry.AbstractInstanceRegistry : Finished initializing remote region registries. All known remote regions: []
2019-09-16 19:29:46.028 INFO 12732 --- [ main] o.s.b.a.e.web.EndpointLinksResolver : Exposing 2 endpoint(s) beneath base path '/actuator'
2019-09-16 19:29:46.173 INFO 12732 --- [ main] o.s.c.n.e.s.EurekaServiceRegistry : Registering application MY-EUREKA-SERVER with eureka with status UP
2019-09-16 19:29:46.182 INFO 12732 --- [ Thread-21] o.s.c.n.e.server.EurekaServerBootstrap : Setting the eureka configuration..
2019-09-16 19:29:46.202 INFO 12732 --- [ Thread-21] o.s.c.n.e.server.EurekaServerBootstrap : Eureka data center value eureka.datacenter is not set, defaulting to default
2019-09-16 19:29:46.206 INFO 12732 --- [ Thread-21] o.s.c.n.e.server.EurekaServerBootstrap : Eureka environment value eureka.environment is not set, defaulting to test
2019-09-16 19:29:46.258 INFO 12732 --- [ Thread-21] o.s.c.n.e.server.EurekaServerBootstrap : isAws returned false
2019-09-16 19:29:46.259 INFO 12732 --- [ Thread-21] o.s.c.n.e.server.EurekaServerBootstrap : Initialized server context
2019-09-16 19:29:46.260 INFO 12732 --- [ Thread-21] c.n.e.r.PeerAwareInstanceRegistryImpl : Got 1 instances from neighboring DS node
2019-09-16 19:29:46.260 INFO 12732 --- [ Thread-21] c.n.e.r.PeerAwareInstanceRegistryImpl : Renew threshold is: 0
2019-09-16 19:29:46.260 INFO 12732 --- [ Thread-21] c.n.e.r.PeerAwareInstanceRegistryImpl : Changing status to UP
2019-09-16 19:29:46.279 INFO 12732 --- [ Thread-21] e.s.EurekaServerInitializerConfiguration : Started Eureka Server
2019-09-16 19:29:46.366 INFO 12732 --- [ main] c.s.j.s.i.a.WebApplicationImpl : Initiating Jersey application, version 'Jersey: 1.19.1 03/11/2016 02:08 PM'
2019-09-16 19:29:46.888 INFO 12732 --- [ main] o.e.j.s.h.ContextHandler.application : Initializing Spring DispatcherServlet 'dispatcherServlet'
2019-09-16 19:29:46.889 INFO 12732 --- [ main] o.s.web.servlet.DispatcherServlet : Initializing Servlet 'dispatcherServlet'
2019-09-16 19:29:46.897 INFO 12732 --- [ main] o.s.web.servlet.DispatcherServlet : Completed initialization in 8 ms
2019-09-16 19:29:46.926 INFO 12732 --- [ main] o.e.jetty.server.AbstractConnector : Started ServerConnector@7ed7ae{HTTP/1.1,[http/1.1]}{localhost:8761}
2019-09-16 19:29:46.929 INFO 12732 --- [ main] o.s.b.web.embedded.jetty.JettyWebServer : Jetty started on port(s) 8761 (http/1.1) with context path '/'
2019-09-16 19:29:46.930 INFO 12732 --- [ main] .s.c.n.e.s.EurekaAutoServiceRegistration : Updating port to 8761
2019-09-16 19:29:46.932 INFO 12732 --- [ main] c.b.m.r.s.MyRegistryServiceApplication : Started MyRegistryServiceApplication in 6.868 seconds (JVM running for 7.394)
2019-09-16 19:30:00.001 DEBUG 12732 --- [-CacheFillTimer] c.n.eureka.registry.ResponseCacheImpl : Updating the client cache from response cache
2019-09-16 19:30:11.740 DEBUG 12732 --- [tp1181947538-27] c.n.e.registry.AbstractInstanceRegistry : Fetching applications registry with remote regions: false, Regions argument []
2019-09-16 19:30:11.747 DEBUG 12732 --- [tp1181947538-27] c.n.eureka.registry.ResponseCacheImpl : New application cache entry {name=ALL_APPS, type=Application, format=JSON} with apps hashcode
2019-09-16 19:30:12.012 DEBUG 12732 --- [tp1181947538-21] c.n.e.registry.AbstractInstanceRegistry : No previous lease information found; it is new registration
2019-09-16 19:30:12.013 DEBUG 12732 --- [tp1181947538-21] c.n.e.registry.AbstractInstanceRegistry : Processing override status using rule: [com.netflix.eureka.registry.rule.DownOrStartingRule, com.netflix.eureka.registry.rule.OverrideExistsRule, com.netflix.eureka.registry.rule.LeaseExistsRule, com.netflix.eureka.registry.rule.AlwaysMatchInstanceStatusRule]
2019-09-16 19:30:12.014 DEBUG 12732 --- [tp1181947538-21] c.n.e.r.r.AlwaysMatchInstanceStatusRule : Returning the default instance status UP for instance localhost:my-data-processing:1:8081
2019-09-16 19:30:12.015 DEBUG 12732 --- [tp1181947538-21] c.n.eureka.registry.ResponseCacheImpl : Invalidating the response cache key : Application MY-DATA-PROCESSING V1 JSON, full
2019-09-16 19:30:12.016 DEBUG 12732 --- [tp1181947538-21] c.n.eureka.registry.ResponseCacheImpl : Invalidating the response cache key : Application MY-DATA-PROCESSING V1 JSON, compact
2019-09-16 19:30:12.016 DEBUG 12732 --- [tp1181947538-21] c.n.eureka.registry.ResponseCacheImpl : Invalidating the response cache key : Application ALL_APPS V1 JSON, full
2019-09-16 19:30:12.016 DEBUG 12732 --- [tp1181947538-21] c.n.eureka.registry.ResponseCacheImpl : Invalidating the response cache key : Application ALL_APPS V1 JSON, compact
2019-09-16 19:30:12.017 DEBUG 12732 --- [tp1181947538-21] c.n.eureka.registry.ResponseCacheImpl : Invalidating the response cache key : Application ALL_APPS_DELTA V1 JSON, full
2019-09-16 19:30:12.017 DEBUG 12732 --- [tp1181947538-21] c.n.eureka.registry.ResponseCacheImpl : Invalidating the response cache key : Application ALL_APPS_DELTA V1 JSON, compact
2019-09-16 19:30:12.017 DEBUG 12732 --- [tp1181947538-21] c.n.eureka.registry.ResponseCacheImpl : Invalidating the response cache key : VIP my-data-processing V1 JSON, full
2019-09-16 19:30:12.026 DEBUG 12732 --- [tp1181947538-21] c.n.eureka.registry.ResponseCacheImpl : Invalidating the response cache key : SVIP my-data-processing V1 JSON, full
2019-09-16 19:30:12.027 DEBUG 12732 --- [tp1181947538-21] c.n.eureka.registry.ResponseCacheImpl : Invalidating the response cache key : Application MY-DATA-PROCESSING V2 JSON, full
2019-09-16 19:30:12.027 DEBUG 12732 --- [tp1181947538-21] c.n.eureka.registry.ResponseCacheImpl : Invalidating the response cache key : Application MY-DATA-PROCESSING V2 JSON, compact
2019-09-16 19:30:12.027 DEBUG 12732 --- [tp1181947538-21] c.n.eureka.registry.ResponseCacheImpl : Invalidating the response cache key : Application ALL_APPS V2 JSON, full
2019-09-16 19:30:12.058 DEBUG 12732 --- [tp1181947538-21] c.n.eureka.registry.ResponseCacheImpl : Invalidating the response cache key : Application ALL_APPS V2 JSON, compact
2019-09-16 19:30:12.058 DEBUG 12732 --- [tp1181947538-21] c.n.eureka.registry.ResponseCacheImpl : Invalidating the response cache key : Application ALL_APPS_DELTA V2 JSON, full
2019-09-16 19:30:12.059 DEBUG 12732 --- [tp1181947538-21] c.n.eureka.registry.ResponseCacheImpl : Invalidating the response cache key : Application ALL_APPS_DELTA V2 JSON, compact
2019-09-16 19:30:12.059 DEBUG 12732 --- [tp1181947538-21] c.n.eureka.registry.ResponseCacheImpl : Invalidating the response cache key : VIP my-data-processing V2 JSON, full
2019-09-16 19:30:12.059 DEBUG 12732 --- [tp1181947538-21] c.n.eureka.registry.ResponseCacheImpl : Invalidating the response cache key : SVIP my-data-processing V2 JSON, full
2019-09-16 19:30:12.059 DEBUG 12732 --- [tp1181947538-21] c.n.eureka.registry.ResponseCacheImpl : Invalidating the response cache key : Application MY-DATA-PROCESSING V1 XML, full
2019-09-16 19:30:12.059 DEBUG 12732 --- [tp1181947538-21] c.n.eureka.registry.ResponseCacheImpl : Invalidating the response cache key : Application MY-DATA-PROCESSING V1 XML, compact
2019-09-16 19:30:12.059 DEBUG 12732 --- [tp1181947538-21] c.n.eureka.registry.ResponseCacheImpl : Invalidating the response cache key : Application ALL_APPS V1 XML, full
2019-09-16 19:30:12.059 DEBUG 12732 --- [tp1181947538-21] c.n.eureka.registry.ResponseCacheImpl : Invalidating the response cache key : Application ALL_APPS V1 XML, compact
2019-09-16 19:30:12.059 DEBUG 12732 --- [tp1181947538-21] c.n.eureka.registry.ResponseCacheImpl : Invalidating the response cache key : Application ALL_APPS_DELTA V1 XML, full
2019-09-16 19:30:12.059 DEBUG 12732 --- [tp1181947538-21] c.n.eureka.registry.ResponseCacheImpl : Invalidating the response cache key : Application ALL_APPS_DELTA V1 XML, compact
2019-09-16 19:30:12.059 DEBUG 12732 --- [tp1181947538-21] c.n.eureka.registry.ResponseCacheImpl : Invalidating the response cache key : VIP my-data-processing V1 XML, full
2019-09-16 19:30:12.059 DEBUG 12732 --- [tp1181947538-21] c.n.eureka.registry.ResponseCacheImpl : Invalidating the response cache key : SVIP my-data-processing V1 XML, full
2019-09-16 19:30:12.060 DEBUG 12732 --- [tp1181947538-21] c.n.eureka.registry.ResponseCacheImpl : Invalidating the response cache key : Application MY-DATA-PROCESSING V2 XML, full
2019-09-16 19:30:12.060 DEBUG 12732 --- [tp1181947538-21] c.n.eureka.registry.ResponseCacheImpl : Invalidating the response cache key : Application MY-DATA-PROCESSING V2 XML, compact
2019-09-16 19:30:12.060 DEBUG 12732 --- [tp1181947538-21] c.n.eureka.registry.ResponseCacheImpl : Invalidating the response cache key : Application ALL_APPS V2 XML, full
2019-09-16 19:30:12.060 DEBUG 12732 --- [tp1181947538-21] c.n.eureka.registry.ResponseCacheImpl : Invalidating the response cache key : Application ALL_APPS V2 XML, compact
2019-09-16 19:30:12.060 DEBUG 12732 --- [tp1181947538-21] c.n.eureka.registry.ResponseCacheImpl : Invalidating the response cache key : Application ALL_APPS_DELTA V2 XML, full
2019-09-16 19:30:12.060 DEBUG 12732 --- [tp1181947538-21] c.n.eureka.registry.ResponseCacheImpl : Invalidating the response cache key : Application ALL_APPS_DELTA V2 XML, compact
2019-09-16 19:30:12.060 DEBUG 12732 --- [tp1181947538-21] c.n.eureka.registry.ResponseCacheImpl : Invalidating the response cache key : VIP my-data-processing V2 XML, full
2019-09-16 19:30:12.060 DEBUG 12732 --- [tp1181947538-21] c.n.eureka.registry.ResponseCacheImpl : Invalidating the response cache key : SVIP my-data-processing V2 XML, full
2019-09-16 19:30:12.060 INFO 12732 --- [tp1181947538-21] c.n.e.registry.AbstractInstanceRegistry : Registered instance MY-DATA-PROCESSING/localhost:my-data-processing:1:8081 with status UP (replication=false)
2019-09-16 19:30:30.001 DEBUG 12732 --- [-CacheFillTimer] c.n.eureka.registry.ResponseCacheImpl : Updating the client cache from response cache
2019-09-16 19:30:30.001 DEBUG 12732 --- [-CacheFillTimer] c.n.eureka.registry.ResponseCacheImpl : Updating the client cache from response cache for key : Application ALL_APPS V2 JSON
2019-09-16 19:30:30.002 DEBUG 12732 --- [-CacheFillTimer] c.n.e.registry.AbstractInstanceRegistry : Fetching applications registry with remote regions: false, Regions argument []
2019-09-16 19:30:30.024 DEBUG 12732 --- [-CacheFillTimer] c.n.eureka.registry.ResponseCacheImpl : New application cache entry {name=ALL_APPS, type=Application, format=JSON} with apps hashcode UP_1_
2019-09-16 19:30:41.848 DEBUG 12732 --- [tp1181947538-22] c.n.e.registry.AbstractInstanceRegistry : Fetching applications registry with remote regions: false, Regions argument []
2019-09-16 19:30:41.851 DEBUG 12732 --- [tp1181947538-22] c.n.e.registry.AbstractInstanceRegistry : Processing override status using rule: [com.netflix.eureka.registry.rule.DownOrStartingRule, com.netflix.eureka.registry.rule.OverrideExistsRule, com.netflix.eureka.registry.rule.LeaseExistsRule, com.netflix.eureka.registry.rule.AlwaysMatchInstanceStatusRule]
2019-09-16 19:30:41.852 DEBUG 12732 --- [tp1181947538-22] c.n.e.registry.rule.LeaseExistsRule : There is already an existing lease with status UP for instance localhost:my-data-processing:1:8081
2019-09-16 19:30:46.008 INFO 12732 --- [hresholdUpdater] c.n.e.r.PeerAwareInstanceRegistryImpl : Current renewal threshold is : 0
2019-09-16 19:30:46.263 INFO 12732 --- [a-EvictionTimer] c.n.e.registry.AbstractInstanceRegistry : Running the evict task with compensationTime 0ms
2019-09-16 19:30:46.263 DEBUG 12732 --- [a-EvictionTimer] c.n.e.registry.AbstractInstanceRegistry : Running the evict task
2019-09-16 19:31:00.002 DEBUG 12732 --- [-CacheFillTimer] c.n.eureka.registry.ResponseCacheImpl : Updating the client cache from response cache
2019-09-16 19:31:00.002 DEBUG 12732 --- [-CacheFillTimer] c.n.eureka.registry.ResponseCacheImpl : Updating the client cache from response cache for key : Application ALL_APPS V2 JSON
2019-09-16 19:31:11.875 DEBUG 12732 --- [tp1181947538-23] c.n.e.registry.AbstractInstanceRegistry : Fetching applications registry with remote regions: false, Regions argument []
2019-09-16 19:31:11.876 DEBUG 12732 --- [tp1181947538-23] c.n.e.registry.AbstractInstanceRegistry : Processing override status using rule: [com.netflix.eureka.registry.rule.DownOrStartingRule, com.netflix.eureka.registry.rule.OverrideExistsRule, com.netflix.eureka.registry.rule.LeaseExistsRule, com.netflix.eureka.registry.rule.AlwaysMatchInstanceStatusRule]
2019-09-16 19:31:11.877 DEBUG 12732 --- [tp1181947538-23] c.n.e.registry.rule.LeaseExistsRule : There is already an existing lease with status UP for instance localhost:my-data-processing:1:8081
2019-09-16 19:31:11.922 DEBUG 12732 --- [tp1181947538-25] c.n.e.registry.AbstractInstanceRegistry : The number of elements in the delta queue is : 1
2019-09-16 19:31:11.923 DEBUG 12732 --- [tp1181947538-25] c.n.e.registry.AbstractInstanceRegistry : The instance id localhost:my-data-processing:1:8081 is found with status UP and actiontype ADDED
2019-09-16 19:31:11.927 DEBUG 12732 --- [tp1181947538-25] c.n.eureka.registry.ResponseCacheImpl : New application cache entry {name=ALL_APPS_DELTA, type=Application, format=JSON} with apps hashcode UP_1_
2019-09-16 19:31:30.003 DEBUG 12732 --- [-CacheFillTimer] c.n.eureka.registry.ResponseCacheImpl : Updating the client cache from response cache
2019-09-16 19:31:30.003 DEBUG 12732 --- [-CacheFillTimer] c.n.eureka.registry.ResponseCacheImpl : Updating the client cache from response cache for key : Application ALL_APPS_DELTA V2 JSON
2019-09-16 19:31:30.003 DEBUG 12732 --- [-CacheFillTimer] c.n.eureka.registry.ResponseCacheImpl : Updating the client cache from response cache for key : Application ALL_APPS V2 JSON
2019-09-16 19:31:46.008 INFO 12732 --- [hresholdUpdater] c.n.e.r.PeerAwareInstanceRegistryImpl : Current renewal threshold is : 0
2019-09-16 19:31:46.263 INFO 12732 --- [a-EvictionTimer] c.n.e.registry.AbstractInstanceRegistry : Running the evict task with compensationTime 0ms
2019-09-16 19:31:46.264 DEBUG 12732 --- [a-EvictionTimer] c.n.e.registry.AbstractInstanceRegistry : Running the evict task
2019-09-16 19:32:00.003 DEBUG 12732 --- [-CacheFillTimer] c.n.eureka.registry.ResponseCacheImpl : Updating the client cache from response cache
2019-09-16 19:32:00.003 DEBUG 12732 --- [-CacheFillTimer] c.n.eureka.registry.ResponseCacheImpl : Updating the client cache from response cache for key : Application ALL_APPS_DELTA V2 JSON
2019-09-16 19:32:00.004 DEBUG 12732 --- [-CacheFillTimer] c.n.eureka.registry.ResponseCacheImpl : Updating the client cache from response cache for key : Application ALL_APPS V2 JSON
2019-09-16 19:32:30.004 DEBUG 12732 --- [-CacheFillTimer] c.n.eureka.registry.ResponseCacheImpl : Updating the client cache from response cache
2019-09-16 19:32:30.004 DEBUG 12732 --- [-CacheFillTimer] c.n.eureka.registry.ResponseCacheImpl : Updating the client cache from response cache for key : Application ALL_APPS_DELTA V2 JSON
2019-09-16 19:32:30.005 DEBUG 12732 --- [-CacheFillTimer] c.n.eureka.registry.ResponseCacheImpl : Updating the client cache from response cache for key : Application ALL_APPS V2 JSON
2019-09-16 19:32:46.008 INFO 12732 --- [hresholdUpdater] c.n.e.r.PeerAwareInstanceRegistryImpl : Current renewal threshold is : 0
2019-09-16 19:32:46.264 INFO 12732 --- [a-EvictionTimer] c.n.e.registry.AbstractInstanceRegistry : Running the evict task with compensationTime 0ms
2019-09-16 19:32:46.264 DEBUG 12732 --- [a-EvictionTimer] c.n.e.registry.AbstractInstanceRegistry : Running the evict task
2019-09-16 19:33:00.004 DEBUG 12732 --- [-CacheFillTimer] c.n.eureka.registry.ResponseCacheImpl : Updating the client cache from response cache
2019-09-16 19:33:00.004 DEBUG 12732 --- [-CacheFillTimer] c.n.eureka.registry.ResponseCacheImpl : Updating the client cache from response cache for key : Application ALL_APPS_DELTA V2 JSON
2019-09-16 19:33:00.005 DEBUG 12732 --- [-CacheFillTimer] c.n.eureka.registry.ResponseCacheImpl : Updating the client cache from response cache for key : Application ALL_APPS V2 JSON
2019-09-16 19:33:30.004 DEBUG 12732 --- [-CacheFillTimer] c.n.eureka.registry.ResponseCacheImpl : Updating the client cache from response cache
2019-09-16 19:33:30.004 DEBUG 12732 --- [-CacheFillTimer] c.n.eureka.registry.ResponseCacheImpl : Updating the client cache from response cache for key : Application ALL_APPS_DELTA V2 JSON
2019-09-16 19:33:30.004 DEBUG 12732 --- [-CacheFillTimer] c.n.eureka.registry.ResponseCacheImpl : Updating the client cache from response cache for key : Application ALL_APPS V2 JSON
2019-09-16 19:33:46.010 INFO 12732 --- [hresholdUpdater] c.n.e.r.PeerAwareInstanceRegistryImpl : Current renewal threshold is : 0
2019-09-16 19:33:46.264 INFO 12732 --- [a-EvictionTimer] c.n.e.registry.AbstractInstanceRegistry : Running the evict task with compensationTime 0ms
2019-09-16 19:33:46.264 DEBUG 12732 --- [a-EvictionTimer] c.n.e.registry.AbstractInstanceRegistry : Running the evict task
2019-09-16 19:34:00.005 DEBUG 12732 --- [-CacheFillTimer] c.n.eureka.registry.ResponseCacheImpl : Updating the client cache from response cache
2019-09-16 19:34:00.005 DEBUG 12732 --- [-CacheFillTimer] c.n.eureka.registry.ResponseCacheImpl : Updating the client cache from response cache for key : Application ALL_APPS_DELTA V2 JSON
2019-09-16 19:34:00.006 DEBUG 12732 --- [-CacheFillTimer] c.n.eureka.registry.ResponseCacheImpl : Updating the client cache from response cache for key : Application ALL_APPS V2 JSON
2019-09-16 19:34:00.006 DEBUG 12732 --- [-CacheFillTimer] c.n.e.registry.AbstractInstanceRegistry : Fetching applications registry with remote regions: false, Regions argument []
2019-09-16 19:34:00.006 DEBUG 12732 --- [-CacheFillTimer] c.n.eureka.registry.ResponseCacheImpl : New application cache entry {name=ALL_APPS, type=Application, format=JSON} with apps hashcode UP_1_
2019-09-16 19:34:30.006 DEBUG 12732 --- [-CacheFillTimer] c.n.eureka.registry.ResponseCacheImpl : Updating the client cache from response cache
2019-09-16 19:34:30.006 DEBUG 12732 --- [-CacheFillTimer] c.n.eureka.registry.ResponseCacheImpl : Updating the client cache from response cache for key : Application ALL_APPS_DELTA V2 JSON
2019-09-16 19:34:30.006 DEBUG 12732 --- [-CacheFillTimer] c.n.e.registry.AbstractInstanceRegistry : The number of elements in the delta queue is : 0
2019-09-16 19:34:30.008 DEBUG 12732 --- [-CacheFillTimer] c.n.eureka.registry.ResponseCacheImpl : New application cache entry {name=ALL_APPS_DELTA, type=Application, format=JSON} with apps hashcode UP_1_
2019-09-16 19:34:30.009 DEBUG 12732 --- [-CacheFillTimer] c.n.eureka.registry.ResponseCacheImpl : Updating the client cache from response cache for key : Application ALL_APPS V2 JSON
2019-09-16 19:34:46.010 INFO 12732 --- [hresholdUpdater] c.n.e.r.PeerAwareInstanceRegistryImpl : Current renewal threshold is : 0
2019-09-16 19:34:46.264 INFO 12732 --- [a-EvictionTimer] c.n.e.registry.AbstractInstanceRegistry : Running the evict task with compensationTime 0ms
2019-09-16 19:34:46.264 DEBUG 12732 --- [a-EvictionTimer] c.n.e.registry.AbstractInstanceRegistry : Running the evict task
2019-09-16 19:34:46.264 INFO 12732 --- [a-EvictionTimer] c.n.e.registry.AbstractInstanceRegistry : Evicting 1 items (expired=1, evictionLimit=1)
2019-09-16 19:34:46.265 WARN 12732 --- [a-EvictionTimer] c.n.e.registry.AbstractInstanceRegistry : DS: Registry: expired lease for MY-DATA-PROCESSING/localhost:my-data-processing:1:8081
2019-09-16 19:34:46.266 DEBUG 12732 --- [a-EvictionTimer] c.n.eureka.registry.ResponseCacheImpl : Invalidating the response cache key : Application MY-DATA-PROCESSING V1 JSON, full
2019-09-16 19:34:46.267 DEBUG 12732 --- [a-EvictionTimer] c.n.eureka.registry.ResponseCacheImpl : Invalidating the response cache key : Application MY-DATA-PROCESSING V1 JSON, compact
2019-09-16 19:34:46.267 DEBUG 12732 --- [a-EvictionTimer] c.n.eureka.registry.ResponseCacheImpl : Invalidating the response cache key : Application ALL_APPS V1 JSON, full
2019-09-16 19:34:46.267 DEBUG 12732 --- [a-EvictionTimer] c.n.eureka.registry.ResponseCacheImpl : Invalidating the response cache key : Application ALL_APPS V1 JSON, compact
2019-09-16 19:34:46.267 DEBUG 12732 --- [a-EvictionTimer] c.n.eureka.registry.ResponseCacheImpl : Invalidating the response cache key : Application ALL_APPS_DELTA V1 JSON, full
2019-09-16 19:34:46.267 DEBUG 12732 --- [a-EvictionTimer] c.n.eureka.registry.ResponseCacheImpl : Invalidating the response cache key : Application ALL_APPS_DELTA V1 JSON, compact
2019-09-16 19:34:46.267 DEBUG 12732 --- [a-EvictionTimer] c.n.eureka.registry.ResponseCacheImpl : Invalidating the response cache key : VIP my-data-processing V1 JSON, full
2019-09-16 19:34:46.268 DEBUG 12732 --- [a-EvictionTimer] c.n.eureka.registry.ResponseCacheImpl : Invalidating the response cache key : SVIP my-data-processing V1 JSON, full
2019-09-16 19:34:46.268 DEBUG 12732 --- [a-EvictionTimer] c.n.eureka.registry.ResponseCacheImpl : Invalidating the response cache key : Application MY-DATA-PROCESSING V2 JSON, full
2019-09-16 19:34:46.268 DEBUG 12732 --- [a-EvictionTimer] c.n.eureka.registry.ResponseCacheImpl : Invalidating the response cache key : Application MY-DATA-PROCESSING V2 JSON, compact
2019-09-16 19:34:46.268 DEBUG 12732 --- [a-EvictionTimer] c.n.eureka.registry.ResponseCacheImpl : Invalidating the response cache key : Application ALL_APPS V2 JSON, full
2019-09-16 19:34:46.268 DEBUG 12732 --- [a-EvictionTimer] c.n.eureka.registry.ResponseCacheImpl : Invalidating the response cache key : Application ALL_APPS V2 JSON, compact
2019-09-16 19:34:46.268 DEBUG 12732 --- [a-EvictionTimer] c.n.eureka.registry.ResponseCacheImpl : Invalidating the response cache key : Application ALL_APPS_DELTA V2 JSON, full
2019-09-16 19:34:46.269 DEBUG 12732 --- [a-EvictionTimer] c.n.eureka.registry.ResponseCacheImpl : Invalidating the response cache key : Application ALL_APPS_DELTA V2 JSON, compact
2019-09-16 19:34:46.269 DEBUG 12732 --- [a-EvictionTimer] c.n.eureka.registry.ResponseCacheImpl : Invalidating the response cache key : VIP my-data-processing V2 JSON, full
2019-09-16 19:34:46.269 DEBUG 12732 --- [a-EvictionTimer] c.n.eureka.registry.ResponseCacheImpl : Invalidating the response cache key : SVIP my-data-processing V2 JSON, full
2019-09-16 19:34:46.269 DEBUG 12732 --- [a-EvictionTimer] c.n.eureka.registry.ResponseCacheImpl : Invalidating the response cache key : Application MY-DATA-PROCESSING V1 XML, full
2019-09-16 19:34:46.269 DEBUG 12732 --- [a-EvictionTimer] c.n.eureka.registry.ResponseCacheImpl : Invalidating the response cache key : Application MY-DATA-PROCESSING V1 XML, compact
2019-09-16 19:34:46.269 DEBUG 12732 --- [a-EvictionTimer] c.n.eureka.registry.ResponseCacheImpl : Invalidating the response cache key : Application ALL_APPS V1 XML, full
2019-09-16 19:34:46.270 DEBUG 12732 --- [a-EvictionTimer] c.n.eureka.registry.ResponseCacheImpl : Invalidating the response cache key : Application ALL_APPS V1 XML, compact
2019-09-16 19:34:46.270 DEBUG 12732 --- [a-EvictionTimer] c.n.eureka.registry.ResponseCacheImpl : Invalidating the response cache key : Application ALL_APPS_DELTA V1 XML, full
2019-09-16 19:34:46.270 DEBUG 12732 --- [a-EvictionTimer] c.n.eureka.registry.ResponseCacheImpl : Invalidating the response cache key : Application ALL_APPS_DELTA V1 XML, compact
2019-09-16 19:34:46.271 DEBUG 12732 --- [a-EvictionTimer] c.n.eureka.registry.ResponseCacheImpl : Invalidating the response cache key : VIP my-data-processing V1 XML, full
2019-09-16 19:34:46.271 DEBUG 12732 --- [a-EvictionTimer] c.n.eureka.registry.ResponseCacheImpl : Invalidating the response cache key : SVIP my-data-processing V1 XML, full
2019-09-16 19:34:46.271 DEBUG 12732 --- [a-EvictionTimer] c.n.eureka.registry.ResponseCacheImpl : Invalidating the response cache key : Application MY-DATA-PROCESSING V2 XML, full
2019-09-16 19:34:46.271 DEBUG 12732 --- [a-EvictionTimer] c.n.eureka.registry.ResponseCacheImpl : Invalidating the response cache key : Application MY-DATA-PROCESSING V2 XML, compact
2019-09-16 19:34:46.271 DEBUG 12732 --- [a-EvictionTimer] c.n.eureka.registry.ResponseCacheImpl : Invalidating the response cache key : Application ALL_APPS V2 XML, full
2019-09-16 19:34:46.272 DEBUG 12732 --- [a-EvictionTimer] c.n.eureka.registry.ResponseCacheImpl : Invalidating the response cache key : Application ALL_APPS V2 XML, compact
2019-09-16 19:34:46.272 DEBUG 12732 --- [a-EvictionTimer] c.n.eureka.registry.ResponseCacheImpl : Invalidating the response cache key : Application ALL_APPS_DELTA V2 XML, full
2019-09-16 19:34:46.272 DEBUG 12732 --- [a-EvictionTimer] c.n.eureka.registry.ResponseCacheImpl : Invalidating the response cache key : Application ALL_APPS_DELTA V2 XML, compact
2019-09-16 19:34:46.272 DEBUG 12732 --- [a-EvictionTimer] c.n.eureka.registry.ResponseCacheImpl : Invalidating the response cache key : VIP my-data-processing V2 XML, full
2019-09-16 19:34:46.272 DEBUG 12732 --- [a-EvictionTimer] c.n.eureka.registry.ResponseCacheImpl : Invalidating the response cache key : SVIP my-data-processing V2 XML, full
2019-09-16 19:34:46.272 INFO 12732 --- [a-EvictionTimer] c.n.e.registry.AbstractInstanceRegistry : Cancelled instance MY-DATA-PROCESSING/localhost:my-data-processing:1:8081 (replication=false)
2019-09-16 19:35:00.007 DEBUG 12732 --- [-CacheFillTimer] c.n.eureka.registry.ResponseCacheImpl : Updating the client cache from response cache
2019-09-16 19:35:00.007 DEBUG 12732 --- [-CacheFillTimer] c.n.eureka.registry.ResponseCacheImpl : Updating the client cache from response cache for key : Application ALL_APPS_DELTA V2 JSON
2019-09-16 19:35:00.008 DEBUG 12732 --- [-CacheFillTimer] c.n.e.registry.AbstractInstanceRegistry : The number of elements in the delta queue is : 1
2019-09-16 19:35:00.008 DEBUG 12732 --- [-CacheFillTimer] c.n.e.registry.AbstractInstanceRegistry : The instance id localhost:my-data-processing:1:8081 is found with status UP and actiontype DELETED
2019-09-16 19:35:00.010 DEBUG 12732 --- [-CacheFillTimer] c.n.eureka.registry.ResponseCacheImpl : New application cache entry {name=ALL_APPS_DELTA, type=Application, format=JSON} with apps hashcode
2019-09-16 19:35:00.011 DEBUG 12732 --- [-CacheFillTimer] c.n.eureka.registry.ResponseCacheImpl : Updating the client cache from response cache for key : Application ALL_APPS V2 JSON
2019-09-16 19:35:00.012 DEBUG 12732 --- [-CacheFillTimer] c.n.e.registry.AbstractInstanceRegistry : Fetching applications registry with remote regions: false, Regions argument []
2019-09-16 19:35:00.013 DEBUG 12732 --- [-CacheFillTimer] c.n.eureka.registry.ResponseCacheImpl : New application cache entry {name=ALL_APPS, type=Application, format=JSON} with apps hashcode
Comment From: spencergibb
Are both of those logs from eureka server?
I'm not sure what we can do. Eviction all happens in eureka-server which is here https://github.com/Netflix/eureka
Have you debugged the server and stepped thru to see what is happening?
Comment From: bmpattanaik
Still things are not clear for me. One thing I tried. Rather than stopping through eclipse I enable shutdown endpoint of actuator. I tried. It immediately unregistered the client. This is a healthy scenario. But when instance goes down in real time environment it may not able to unregistered the client.
Comment From: ryanjbaxter
That makes sense that it is instantly removed when using the actuator endpoint because we actually send a message to the Eureka server saying the app is going down.
I still dont understand how it would take 3-4 minutes to be removed if you just kill the process though. Like @spencergibb said, it is all happening in the Eureka code and not in Spring Cloud.
Comment From: bmpattanaik
@ryanjbaxter @spencergibb @NiteshKant
This looks a bug for me. Eureka expects a zone key. If it does not found the key it wait for 3 mins.
I have no clue which property to use , so that I can change is default behavior.
https://github.com/Netflix/eureka/issues/118
Comment From: bmpattanaik
My requirement is to run with one eureka server.I don't want to create multiple zones.
Comment From: bmpattanaik
eureka.server.response-cache-auto-expiration-in-seconds=90 eureka.server.response-cache-update-interval-ms=90000 Also added. Didn't work.
Comment From: bmpattanaik
I debug and found out in ResponseCacheImpl.java they have this below condition removedKey.hasRegions() satisfied it will not going to consider eureka.server.response-cache-auto-expiration-in-seconds parameter. Can anyone suggest how to configure a region ?
@Override
public void onRemoval(RemovalNotification<Key, Value> notification) {
Key removedKey = notification.getKey();
if (removedKey.hasRegions()) {
Key cloneWithNoRegions = removedKey.cloneWithoutRegions();
regionSpecificKeys.remove(cloneWithNoRegions, removedKey);
}
}
Comment From: cowboy-cod3r
Your log is riddled with Current renewal threshold is : 0. Eureka does not evict unless you explicitly de-register the service when the current renewal threshold is 0, at least that is my experience with the newer versions of eureka. There is some discussion here about it:
https://github.com/spring-cloud/spring-cloud-netflix/issues/380
Also here (lines 69 to 75): https://github.com/spring-cloud/spring-cloud-netflix/blob/master/spring-cloud-netflix-eureka-server/src/main/java/org/springframework/cloud/netflix/eureka/server/InstanceRegistry.java
I had a similar problem in a 3 server setup. Initially the servers would start out calculating renewal thresholds correctly but eventually they'd fall to zero for some reason. I don't really know why. This is with thousands of instances registered sending heartbeats every 30 seconds. The fix in my setup was to set the following on all servers:
# had this previously set to false
eureka.client.fetch-registry=true
# Should be set to zero in multi-server environments
eureka.instance.registry.default-open-for-traffic-count=0
Comment From: FWinkler79
Hi there,
I configured a standalone Eureka instance with self-preservation turned off and client leases and eviction timers setup so that service instances that get killed (ungraceful exit) get evicted from Eureka faster (within a few seconds).
Details and descriptions can be found here. Hope this helps anyone.
The trick is to properly configure the following settings in Eureka clients:
eureka:
instance:
# Request a lease with a validity of 5 seconds. If until then the
# lease has not been renewed, it expires and the Eureka server can evict it.
# Default: 90s
lease-expiration-duration-in-seconds: 5
# The cadence of lease renewal, i.e. how often a heartbeat is sent to Eureka server.
# In this case every 2 seconds. Use this only for development / debugging. In production use the ...
# Default: 30s
lease-renewal-interval-in-seconds: 2
... and the following settings in Eureka server:
eureka:
server:
# Switch off self-preservation. Will turn lease expiration on and evict all instances which no longer sent a heartbeat and whose lease has expired.
# Self-preservation is desirable for Eureka clusters and where network outages (e.g. between data centers) could be possible.
# Note: the lease validity / expiration is configured in the Eureka _client_ instances (see eureka.instance.lease-expiration-duration-in-seconds).
enable-self-preservation: false
# Make sure this is set to the same value as the lease renewal interval in Eureka _client_ instances (or slightly higher)
# This value is relevant for Eureka's calculation of the 'current renewal threshold'.
# Specifically, the following equation is used: current renewal threshold = (60s / expected-client-renewal-interval-seconds) * renewal-percent-threshold * current number of client instances.
# In this case:
# - for one registered client: 60 / 3 * 0.5 * 1 = 10.
# - for two registered clients: 60 / 3 * 0,5 * 2 = 20.
# As soon as two clients are connected:
expected-client-renewal-interval-seconds: 3
# The interval in which the instance eviction task scans for instances with expired leases.
# Given in milliseconds.
eviction-interval-timer-in-ms: 2000
Comment From: bmpattanaik
Yes it is working as suggested by @FWinkler79. Thanks a lot for suggesting the solution.
Comment From: danishiumca
@bmpattanaik and @FWinkler79 I just want to check are you using same config in prod too. As you have explained in your example .
Comment From: FWinkler79
Hi @danishiumca,
I guess the proper answer is "it depends".
First and foremost, my intention was to explain what is going on at all, and how to configure Eureka to evict dead instances faster - something not only I was struggling with, but a lot of people on the Web seemed to have a hard time to understand.
❗ I did not want to make any recommendations as to using this sample setup in production. ❗
However, we did - with slightly less tight eviction times.
The problem is, that there is a tradeoff you must find. The reason for Eureka to go into self-preservation mode and longer eviction intervals is to make sure that it does not drain its registered services too soon. You can look at the list of registered services as a kind of cache. If you have 45 seconds of network outage, and very tight eviction settings, you might end up with an empty registry ("cleared cache"), since all services appear to be offline. If you have a lot of services, that can be a nuisance, since all of them have to re-register, which can take a while and even might overload your Eureka instance (if you are running just a single instance). It is especially problematic, if that happens regularly (which hopefully is not the case for a decent Cloud platform).
In our case, we decided that we mostly can rely on a reasonably stable Cloud platform (which again is an assumption that depends on your environment) and tuned the setting values so that we could both live with the eviction times (i.e. the amount of time the registry is in an inconsistent state) and still not have too much fluctuation in case of occasional issues with our Cloud platform itself.
I hope that makes sense and answers your question. It's been a while since I looked into that topic.