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

Comment From: spencergibb

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

Comment From: HoussamKASSAH

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. ?

Comment From: spencergibb

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

Comment From: HoussamKASSAH

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

Comment From: spencergibb

Yes.

Comment From: HoussamKASSAH

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>

Comment From: HoussamKASSAH

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

Comment From: spencergibb

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

Comment From: HoussamKASSAH

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 !

Comment From: HoussamKASSAH

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'.

Comment From: spencergibb

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

Comment From: HoussamKASSAH

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 !

Comment From: spencergibb

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

Comment From: HoussamKASSAH

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

Comment From: HoussamKASSAH

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 

Comment From: spencergibb

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

Comment From: HoussamKASSAH

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

Comment From: spencergibb

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

Comment From: HoussamKASSAH

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 !

Comment From: spencergibb

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

Comment From: HoussamKASSAH

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

Comment From: HoussamKASSAH

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 !

Comment From: prontera

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

Comment From: OlgaMaciaszek

This module has entered maintenance mode. This means that the Spring Cloud team will no longer be adding new features to the module. We will fix blocker bugs and security issues, and we will also consider and review small pull requests from the community.