Giter VIP home page Giter VIP logo

Comments (8)

karthik-vn avatar karthik-vn commented on August 24, 2024

When eureka first starts up without peers it takes about 5 mins for it to start serving requests because it waits for all clients to register completely before it can give out the list. You can disable this by setting this

#Set this only for this sample service without which starting the instance will by default wait for the default of 5 mins
eureka.waitTimeInMsWhenSyncEmpty=0

In a production environment, it is recommended that you don't set this property. You might want to revert the other property changes above as they are unrelated.

from eureka.

jfenner avatar jfenner commented on August 24, 2024

Hi Karthik-vn,

Thanks for the reply. I'm actually already setting that parameter, but it doesn't seem to make a difference. Here's what I have for a config:

Tomcat setenv.sh:

export JAVA_OPTS="$JAVA_OPTS \
                   -Deureka.enableSelfPreservation=false \
                   -Deureka.registration.enabled=false \
                   -Deureka.environment=dev \
                   -Deureka.datacenter=ndc"
echo $JAVA_OPTS

And my eureka-server.properties (masked):

#Set this only for this sample service without which starting the instance will by default wait for the default of 5 mins
eureka.waitTimeInMsWhenSyncEmpty=0

#AWS access key which has access to EIP binding and looking up autoscaling information
eureka.awsAccessId=*****
eureka.awsSecretKey=******
@next=eureka-${environment}-${region}.properties

And finally eureka-server-dev.properties (masked):

#AWS access key which has access to EIP binding and looking up autoscaling information
eureka.awsAccessId=******
eureka.awsSecretKey=*******

from eureka.

cfregly avatar cfregly commented on August 24, 2024

@jfenner - this might sound silly, but are you rebuilding the eureka-server webapp with the new properties being set?

also, you might want to try setting those -D's in the actually eureka-server.properties file itself.

here's a link to my FluxCapacitor Netflix OSS FAQ that describes this issue: https://github.com/cfregly/fluxcapacitor/wiki/NetflixOSS-FAQ#eureka-service-discovery-load-balancer

The eureka.registration.enabled=false should have taken care of the problem (it has for others), so i wonder if those -D's aren't being picked up for some reason.

i just added karthik's recent suggestion of setting eureka.waitTimeInMsWhenSyncEmpty=0 to the FAQ as i hadn't heard of that before.

lemme know if that helps.

-chris

from eureka.

bpollack avatar bpollack commented on August 24, 2024

I'm also seeing this, even with eureka.waitTimeInMsWhenSyncEmpty set to 0. While this is hard to see with Tomcat, attempting to run under Jetty shows a tremendous number of stack traces as Eureka server tries and fails to connect to itself with the Eureka client, presumably because it's still attempting to come up.

from eureka.

bpollack avatar bpollack commented on August 24, 2024

@NiteshKant @cfregly @karthik-vn This is actually happening in EurekaBootStrap.contextInitialized, when it calls registry.syncUp() (roughly line 102, depending on which PRs are merged when you look this up). syncUp() will sleep up to, by default, five times, for 30 seconds, until it can find a peer to register with. There's your 3-5 minute start-up time with the default .properties files.

There are two possible fixes to this:

  1. Modify the wiki to also note that you have to set eureka.numberRegistrySyncRetries to 0 for debugging
  2. Introduce a new setting, called something like eurekaServer.testingMode, that bypasses the initial syncUp call entirely.

The first is obviously less work, but second's also pretty simple. Thoughts?

from eureka.

NiteshKant avatar NiteshKant commented on August 24, 2024

@bpollack I personally like the option 2. so that there is less configuration to set.
In fact we should be able to support starting the servers with no eureka peers configured. This would automatically remove all these issues. Thoughts?

from eureka.

bpollack avatar bpollack commented on August 24, 2024

@NiteshKant Hmm, I like your idea. Will quickly whip up a PR in that style for feedback.

from eureka.

tbak avatar tbak commented on August 24, 2024

To eliminate syncUp just set eureka.numberRegistrySyncRetries=0. Once it is set, the server starts up instantly.
I propose to close this issue, as there was no follow up on it for some time, and there is alternative approach to achieve this goal.

from eureka.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.