Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Zuul timing out in long-ish requests

I am using a front end Spring Cloud application (micro service) acting as a Zuul proxy (@EnableZuulProxy) to route requests from an external source to other internal micro services written using spring cloud (spring boot).
The Zuul server is straight out of the applications in the samples section

@SpringBootApplication @Controller @EnableZuulProxy @EnableDiscoveryClient public class ZuulServerApplication {     public static void main(String[] args) {         new SpringApplicationBuilder(ZuulServerApplication.class).web(true).run(args);     } } 

I ran this set of services locally and it all seems to work fine but if I run it on a network with some load, or through a VPN, then I start to see Zuul forwarding errors, which I am seeing as client timeouts in the logs.

Is there any way to change the timeout on the Zuul forwards so that I can eliminate this issue from my immediate concerns? What accessible parameter settings are there for this?

like image 888
EvilJinious1 Avatar asked Mar 06 '15 17:03

EvilJinious1


People also ask

How do I set Zuul timeout?

If you want to configure the socket timeouts and read timeouts for requests proxied through Zuul, you have two options, based on your configuration: If Zuul uses service discovery, you need to configure these timeouts with the ribbon. ReadTimeout and ribbon. SocketTimeout Ribbon properties.

Is Netflix Zuul deprecated?

Zuul 1 and Archaius 1 have both been superseded by later versions that are not backward compatible. The following Spring Cloud Netflix modules and corresponding starters will be placed into maintenance mode: spring-cloud-netflix-archaius. spring-cloud-netflix-hystrix-contract.

Why we need Zuul when we can directly call API with rest?

Zuul is built to enable dynamic routing, monitoring, resiliency, and security. It can also route the requests to multiple Amazon Auto Scaling Groups. For Example, /api/products are mapped to the product service and /api/user is mapped to the user service.

Does Zuul automatically uses Hystrix?

Zuul creates a Hystrix circuit breaker for each route (serviceId). It means that one Hystrix circuit breaker will be shared between your all instances of payment-services. The circuit breaker that Zuul creates for each route is not for removing an unhealthy instance from the routing list.


2 Answers

In my case I had to change the following property:

zuul.host.socket-timeout-millis=30000 
like image 174
acohen Avatar answered Oct 27 '22 01:10

acohen


The properties to set are: ribbon.ReadTimeout in general and <service>.ribbon.ReadTimeout for a specific service, in milliseconds. The Ribbon wiki has some examples. This javadoc has the property names.

like image 35
spencergibb Avatar answered Oct 27 '22 01:10

spencergibb