在阅读了关于Spring cloud Zuul的文档后,我已经了解到,通过SEMAPHORE隔离和大约2的最大并发请求,Zuul服务器可以轻松处理大约5000 rps。当我试图从Jmeter调用服务时,它的值大约为2000,它抛出以下异常并显示100%的错误率。
com.netflix.hystrix.exception.HystrixRuntimeException:
Service1 could not acquire a semaphore for execution and no fallback available.
然后我将最大并发请求数增加到200000但仍然抛出异常,但错误率已下降到10%。 能告诉我原因吗?这是因为Spring云Zuul中的微服务缓慢或任何配置问题?以下是配置:
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
答案 0 :(得分:4)