Setting up local eureka for dynamic redeploys

604 views
Skip to first unread message

Peter Modzelewski

unread,
Jan 29, 2015, 1:37:26 PM1/29/15
to eureka_...@googlegroups.com
Hi guys,

I am using eureka for some time now, and it's really cool.
Right now I'm working on setting up "micro" cloud for devs basing on docker.
Services are run rapidly, tested and closed.

There is one problem - how eureka is carefull about dropping / registering stuff.
I've already configured it to run OK in single instance, but still the wait times
1) when new service appears
2) when service is killed

are big.

I was trying different configurations... with no use
So guys, what options would you suggest me to use on server/client side to make eureka drop and register services fast?

tb...@netflix.com

unread,
Jan 29, 2015, 2:05:10 PM1/29/15
to eureka_...@googlegroups.com
Eureka 1.x has three sources of delay:

1. client registration

Client status is registered with Eureka by an asynchronous job running
in background.

Configured by:
property: appinfo.replicate.interval (default == 30sec)
property: appinfo.initial.replicate.time (default = 40sec)

2. delta computation

On the server side, a periodic cache task is executed to build delta
packages that are returned to the clients.

Configured by:
property: responseCacheUpdateIntervalMs (default == 30sec)

3. client cache refresh task

Run periodically to load new data from the server.

Configured by:
property: client.refresh.interval (default == 30sec)


If you sume this up it gives 100sec delay in worst case.


You can reduce the default values for these properties, but this will
add extra load on your servers/clients.

Peter Modzelewski

unread,
Jan 29, 2015, 3:30:22 PM1/29/15
to eureka_...@googlegroups.com
Hi, 

Thx for response! It helped with help of registry, I've used:

In Server config:

eureka.responseCacheUpdateIntervalMs=1000
eureka.refresh.interval=1
eureka.appinfo.replicate.interval=1
eureka.appinfo.initial.replicate.time=1
eureka.evictionIntervalTimerInMs=1500

In Client config:
eureka.appinfo.replicate.interval=1
eureka.appinfo.initial.replicate.time=1

The problem is eureka is not dropping them as fast as registering (that part seams unaffected) even that I've set evictionIntervalTimerInMs
I suspect it's because services are killed brutally and are not sending status DOWN, still can I make eureka to drop them faster? For example if there was no heartbeat in last 5 seconds or so (I probably need also make client to send hearbeats more often but I don't see config options for that either :()?  

Tomasz Bak

unread,
Jan 29, 2015, 4:26:00 PM1/29/15
to eureka_...@googlegroups.com
Heartbeat frequency is defined in LeaseInfo object, which is aggregated by your service's InstanceInfo object. It defaults to 30sec.


--
You received this message because you are subscribed to the Google Groups "eureka_netflix" group.
To unsubscribe from this group and stop receiving emails from it, send an email to eureka_netfli...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Peter Modzelewski

unread,
Jan 30, 2015, 4:46:02 AM1/30/15
to eureka_...@googlegroups.com
Thx!

Thank to both of You I have my docker cluster configured so it drops and registers services fast :)

ol...@oneboxtm.com

unread,
May 7, 2015, 5:17:03 AM5/7/15
to eureka_...@googlegroups.com
Hi,

Did you manage to get Eureka to drop more quickly the services when they are killed?

Thanks

Peter Modzelewski

unread,
May 7, 2015, 6:35:09 AM5/7/15
to eureka_...@googlegroups.com
Yup.
I've updated my config and it helped, but also we've discovered that the way we run apps inside docker container caused them not to get appropriate signal to work with and shutdown hook that was suppose to unregister service from eureka never triggered. 
Runtime.getRuntime().addShutdownHook(new Thread(){
@Override
public void run() {
DiscoveryManager.getInstance().shutdownComponent();
}
});

Wnyway our current "dev" config is as follow:

eureka.region=default
eureka.preferSameZone=false
eureka.shouldUseDns=false
eureka.enableSelfPreservation=false
eureka.us-east-1.availabilityZones=default
eureka.serviceUrl.default=http://localhost:8080/eureka/v2/
eureka.port=8080
eureka.name=eureka
eureka.vipAddress=eureka.YOUR_DOMAIN_HERE

eureka.waitTimeInMsWhenSyncEmpty=0
eureka.numberRegistrySyncRetries=0
eureka.registerWithEureka=false
eureka.fetchRegistry=false
eureka.responseCacheUpdateIntervalMs=1000

eureka.refresh.interval=3
eureka.appinfo.replicate.interval=3
eureka.appinfo.initial.replicate.time=5

#NOT SURE IF THIS PART IS NECESSARY
eureka.client.refresh.interval=3
eureka.client.appinfo.replicate.interval=3
eureka.client.appinfo.initial.replicate.time=5

You received this message because you are subscribed to a topic in the Google Groups "eureka_netflix" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/eureka_netflix/24FLU_q7d0I/unsubscribe.
To unsubscribe from this group and all its topics, send an email to eureka_netfli...@googlegroups.com.

Oreste Luci

unread,
May 7, 2015, 7:05:03 AM5/7/15
to eureka_...@googlegroups.com
Thank you for your quick response.

When I kill a client it takes about 4 minutes to unregister from Eureka. Have you been able to reduce this time?

Thanks

Peter Modzelewski

unread,
May 7, 2015, 7:11:39 AM5/7/15
to eureka_...@googlegroups.com
yup, should be shorter with this config

Oreste Luci

unread,
May 7, 2015, 10:15:26 AM5/7/15
to eureka_...@googlegroups.com
I added this configuration to the client and now the release time is shorter.

eureka:
instance:
leaseExpirationDurationInSeconds: 5
Reply all
Reply to author
Forward
0 new messages