Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Couldn't acquire semaphore - Zuul Configuration

After reading the documentation on Spring cloud Zuul I have understood that with SEMAPHORE isolation and max concurrent requests of around 2, Zuul server can easily handle about 5000 rps. With a value of around 2000 it's throwing the following exception and showing error rate 100% when I tried to invoke the service from Jmeter.

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

Then I have bumped up the number of max concurrent requests to 200000 but still it's throwing the exception but the error rate has gone down to 10%. Can you please let me know the reason for this. Is this because of slow micro service or any configuration issue in Spring cloud Zuul ? The following is the configuration:

ribbon:
 ConnectTimeout: 20000000
 ReadTimeout: 20000000
 MaxTotalHttpConnections: 5000
 MaxHttpConnectionsPerHost: 5000
 ActiveConnectionsLimit: 4000

 hystrix.command.default.execution.isolation.thread.timeoutInMilliseconds: 20000000
 zuul.hystrix.command.default.execution.isolation.strategy: SEMAPHORE
 zuul.hystrix.command.default.execution.isolation.semaphore.maxConcurrentRequests: 2000
 zuul.hystrix.command.default.fallback.isolation.semaphore.maxConcurrentRequests: 2000
 zuul.eureka.default.semaphore.maxSemaphores: 30000
like image 668
Deepak Avatar asked Jul 14 '16 07:07

Deepak


1 Answers

After some tests, I found it should be:

zuul.semaphore.maxSemaphores: 30000

It is different from the issue in github. Maybe it is related with the version.

like image 54
Mavlarn Avatar answered Oct 10 '22 18:10

Mavlarn