Spring-cloud-netflix: Document setting max semaphores for zuul

Created on 24 Jun 2016  路  23Comments  路  Source: spring-cloud/spring-cloud-netflix

Dear all,

I want to run a multiple number of concurrent requests through the Gateway Zuul with Eureka servers
where i faced this Error Internal server error 500 any solution or suggestion are welcome and Thank you

Caused by: com.netflix.hystrix.exception.HystrixRuntimeException: YYYYY could not acquire a semaphore for execution and no fallback available.

Caused by: java.lang.RuntimeException: could not acquire a semaphore for execution
documentation

Most helpful comment

Set zuul.eureka.<serviceId>.semaphore.maxSemaphores=<maxSemaphors>. It defaults to 100.

All 23 comments

Set zuul.eureka.<serviceId>.semaphore.maxSemaphores=<maxSemaphors>. It defaults to 100.

I'am using spring cloud Netflix 1.1.2 version tried to use your suggestion on my properties file but i can't find zuul.eureka. ?

What do you mean "i can't find zuul.eureka."?

what I understand from you is to add zuul.eureka.<serviceId>.semaphore.maxSemaphores=<maxSemaphors> in my proporties file of my zuul gateway right !

Yes.

i have

          zuul.host.max-per-route-connections= xxx
          zuul.host.max-total-connections= xxxx
          ..............

and other properties but i can't see zuul.eureka.<serviceId>.semaphore.maxSemaphores=<maxSemaphors>

witch maven or zuul version that i can use to got the properties of the semaphore !

I don't understand "i can't see zuul.eureka.<serviceId>.semaphore.maxSemaphores=<maxSemaphors>". What do you mean you can't see it?

in my properties file when I tap zuul.<space> I got the list of properties but there's no`zuul.eureka.<serviceId>.semaphore.maxSemaphores=<maxSemaphors>
I should to download a newst version of zuul to got it or what can I do !

does it work just if I add it to a Metadata or I should to install another version:
Create metadata for 'zuul.eureka.XXXXX.semaphore.maxSemaphores'.

It will not be part of any completion. It should just work.

I think it's work but I got this

com.netflix.zuul.exception.ZuulException: Forwarding error
Caused by: com.netflix.hystrix.exception.HystrixRuntimeException: xxxxxxx short-circuited and no fallback available.
Caused by: java.lang.RuntimeException: Hystrix circuit short-circuited and is OPEN

any help ideas from your experience what cause it !

Your downstream service has failed so often the circuit is open. This is what hystrix does.

I don't no from problems to another but I want to fix it now :) thanks for your help :)

com.netflix.zuul.exception.ZuulException: Forwarding error
Caused by: com.netflix.client.ClientException: null
Caused by: com.sun.jersey.api.client.ClientHandlerException: java.net.SocketTimeoutException: Read timed out
Caused by: java.net.SocketTimeoutException: Read timed out

my zuul config
in addition to your zuul.eureka.<serviceId>.semaphore.maxSemaphores=<maxSemaphors>
I have

zuul.host.max-per-route-connections=2000
zuul.host.max-total-connections=2000
zuul.host.socket-timeout-millis=2000000
zuul.host.connect-timeout-millis=10000
hystrix.command.default.execution.isolation.strategy=THREAD
hystrix.command.default.execution.isolation.thread.timeoutInMilliseconds=200000000000
health.hystrix.enabled=true 

your service calls are timing out. Try setting ribbon.ReadTimeout.

just added this

ribbon.eureka.enabled=true
ribbon.ServerListRefreshInterval=1000
ribbon.ConnectTimeout=200000
ribbon.ReadTimeout=200000

and got

com.netflix.zuul.exception.ZuulException: Forwarding error
Caused by: com.netflix.hystrix.exception.HystrixRuntimeException: xxxxx timed-out and no fallback available.
Caused by: java.util.concurrent.TimeoutException: null

THREAD isolation isn't supported currently in zuul. I'm unsure why you are still getting timeouts.

have you any idea about the parameter of read timeout and connect timeout suggested or recommended for supporting more than 1000 request through zuul Gateway !

You have them set. Without seeing a sample project, I'm not sure what else I can do.

In all case thanks a lot for your help, but I didn't understand zuul doesn't support more than 1000 request at the same time
I run 1000 request just 835 arrived to do their job and I got the error mentioned above, I will try to play with the parameter of read timeout connect timeout and I will see but I don't think that it's that the problem.
have a nice day

Hey @spencergibb it's work by following this config for the read timeout parameter
execTime < hystrixTimeout < readTimeout --> OK (no leak)
from https://github.com/spring-cloud/spring-cloud-netflix/issues/327
but I'am asking if you have more details information or reference link to understand more why we should use one of those scenario test to avoid the HTTP connection leak timeout !

zuul.eureka.<serviceId>.semaphore.maxSemaphores=<maxSemaphors> works for me. (Brixton SR6)

Was this page helpful?
0 / 5 - 0 ratings