-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
eureka registration time lag with ribbon or springclound? #3263
Comments
Please learn how to format code on GitHub and read this section of the documentation. |
sorrry ,Paste error |
@ryanjbaxter thx for your reply, |
What if you lower it to something lower? |
thanks to the time lag, my cd system need to offline target service(set OUT_OF_SERVICE state) and wait other client has no registry of this service before restart this service, i want to know exactly eureka registration state synchronization time, maybe i can lower the wait time; |
I just wanted you to test that if you lower it to less than 5 seconds that you would then see an overall lower sync time (less than 30 seconds). Your math seems correct but since these things are running in threads that run periodically it may not be exactly as you calculate. |
Beware that changing how frequently the eureka client sends its heartbeats to the server (other than every 30s) is likely to cause very strange results. Please read the following issue before proceeding: #373 |
hi, i dont know the "very strange results", i read that doc before and it helps; i lower it to 5 seconds and publish to my test environment, i planned to publish this lower heartbeats to production environment ,can you point some bad influences that can be ?,maybe i should not lower it |
At the time I wrote that post, the Eureka server expected clients to renew their leases every 30s - not more, not less. If you have a single service, the Eureka registry expects to receive 2 heartbeats per minute. With 2 services, it expects 4 heartbeats. Etc. The registry enters in "self preservation" mode when the actual number of heartbeats received during a given period falls below 80% of the expected number (by default). So, in the above example, if the period is one minute (it is actually longer but I don't remember how long it is) that mode is activated when 3 heartbeats are received instead of the 4 expected. Suppose now that your clients are sending an heartbeat (renewal) every 10 seconds, the registry will receive 6 heartbeats per minute per client, ie 12 heartbeats for 2 clients whereas it expects only 4... As you understand, the "self preservation" feature is now broken... All this because most of the registry's internal logic is hardcoded with a 30s renewal period from the client. As far as I remember, "Self preservation" isn't the only feature affected. Unfortunately I can"t remember now what were the others... :( |
Hi @brenuart First
Maybe not 80%. Its 85% Second
For this issue the in eureka 1.9.4 version has already fix it. You can see Netflix/eureka#1093 Thanks |
We have incorporated that version of eureka |
Hi,i want to reduce eureka registration state synchronization time,i knew eureka client/server ribbon has local cache for eureka registration info,i try to config some related configuration, like this
Eureka Server
Eureka Client A( ribbon and feign as http client)
**Eureka client B(privide some rest api) **
question:
i turn off eureka server read only cache: eureka.server.use-read-only-response-cache: false
i lowering eureka client registry fetch interval:eureka.instance.registry-fetch-interval-seconds: 5
i lowering ribbon server list refresh time:ribbon.ServerListRefreshInterval: 1000
i think it should be less 10 seconds that client a can get the latest registration info;
but when i execute: curl -i -X PUT http://localhost:9000/eureka/apps/rest-server/192.168.1.138:9006/status?value=OUT_OF_SERVICE
ps:rest-server is client B
client A not alway synchronize client B registration info within 10 seconds;sometimes up to 30 seconds
(i continued send request to client A ,client send request to client B via ribbon and feigin
when i set client B OUT_OF_SERVICE, count how long client A failed to get response)
i use eureka rest api and get registry immdiately; it can be ribbon or springclound something wrong?
or is these some configuration i missed?
thank you !
The text was updated successfully, but these errors were encountered: