【问题标题】:configuration maxSemaphores for zuul serverzuul 服务器的配置 maxSemaphores
【发布时间】:2017-11-16 13:29:21
【问题描述】:

我正在尝试对 zuul version 1.1.2 进行负载测试。

但是在运行负载测试几分钟后,我不断收到以下问题。

Caused by: com.netflix.hystrix.exception.HystrixRuntimeException: book could not acquire a semaphore for execution and no fallback available.
    at com.netflix.hystrix.AbstractCommand$21.call(AbstractCommand.java:783) ~[hystrix-core-1.5.3.jar:1.5.3]

我的问题是如何通过配置增加maxSemaphores

hystrix.command.default.execution.isolation.thread.timeoutInMilliseconds= 20000000
zuul.hystrix.command.default.execution.isolation.strategy= SEMAPHORE
zuul.hystrix.command.default.execution.isolation.semaphore.maxConcurrentRequests= 10
zuul.hystrix.command.default.fallback.isolation.semaphore.maxConcurrentRequests= 10
zuul.semaphore.maxSemaphores=3000

zuul.eureka.book.semaphore.maxSemaphore=30000

我尝试在 Internet 上搜索许多选项,但其中一个对我有用

请指教

【问题讨论】:

    标签: netflix-zuul spring-cloud-netflix hystrix


    【解决方案1】:

    原来我使用的是旧版本。对于以后的版本,我们可以在 Zuul 级别设置信号量。下面是一个将 maxSemaphores 3000 设置为默认路由到每个代理服务的示例

    zuul.semaphore.maxSemaphores=3000

    【讨论】:

      【解决方案2】:

      实际属性是 max-semaphores(这将使用 yaml 配置):

      zuul:
        semaphore:
          #com.netflix.hystrix.exception.HystrixRuntimeException: "microservice" could not acquire a semaphore for execution and no fallback available.
          max-semaphores: 2000
      

      【讨论】:

        猜你喜欢
        • 2020-07-30
        • 2016-05-07
        • 1970-01-01
        • 2016-04-23
        • 2015-01-18
        • 2016-07-15
        • 2018-01-03
        • 2020-11-09
        • 2018-10-13
        相关资源
        最近更新 更多