openjdk:10.0.1-jre-slim
I have a ribbon client called serviceA
and associated
serviceA.ribbon.ConnectTimeout=5000
serviceA.ribbon.ReadTimeout=15000
hystrix.command.serviceA.execution.isolation.thread.timeoutInMilliseconds = 20000
I have not (knowingly) got spring-retry on the classpath. I execute ./mvnw dependency:list | grep -i retry
and get no results.
At runtime I get these warnings:
The Hystrix timeout of 20000ms for the command serviceA is set lower than the combination of the Ribbon read and connect timeout, 40000ms.
I'm not sure where these numbers come from given that I thought I'd set them to 15 and 5 seconds respectively. Why is this figure double?
The Hystrix framework library helps to control the interaction between services by providing fault tolerance and latency tolerance. It improves overall resilience of the system by isolating the failing services and stopping the cascading effect of failures.
Hystrix is a library that controls the interaction between microservices to provide latency and fault tolerance. Additionally, it makes sense to modify the UI to let the user know that something might not have worked as expected or would take more time.
It makes more sense for the service to back off and give calls to the callee service after some time or share default response. Netflix Hystrix, Resilince4j are two well-known circuit breakers which are used to handle such situations.
Hystrix Status. Hystrix is no longer in active development, and is currently in maintenance mode. Hystrix (at version 1.5. 18) is stable enough to meet the needs of Netflix for our existing applications.
Actually, ribbon timeout includes all same server retry and next server retry.
ribbonTimeout = (ribbon.ConnectTimeout + ribbon.ReadTimeout) * (ribbon.MaxAutoRetries + 1) * (ribbon.MaxAutoRetriesNextServer + 1);
// ...
if(hystrixTimeout < ribbonTimeout) {
LOGGER.warn("The Hystrix timeout of " + hystrixTimeout + "ms for the command " + commandKey +
" is set lower than the combination of the Ribbon read and connect timeout, " + ribbonTimeout + "ms.");
}
In your configuration:
So the hystrixTimeout should be:
(5000 + 15000) * (1 + 0) * (1 + 1) // -> 40000 ms
If you choose to not configure Hystrix timeout, the default Hystrix timeout will be 40000ms.
19.13 Zuul Timeouts in Spring Cloud Document
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With