hystrix高并发未超时却降级

原因:因为hystrix线程数不足,需在配置文件增加线程配置和最大队列

ribbon:
  # 连接超时
  ConnectTimeout: 10000
  # 响应超时
  ReadTimeout: 60000
  #失败再次发送
  MaxAutoRetries: 0
  #失败再次发送
  MaxAutoRetriesNextServer: 0
feign:
  hystrix:
    ###开启hystrix
    enabled: true

###设置hystrix超时时间 
hystrix:
  command:
    default:
      execution:
        isolation:
          thread:
            timeoutInMilliseconds: 60000
  threadpool:
    default:
      coreSize: 200 #并发执行的最大线程数,默认10
      maxQueueSize: 1000 #BlockingQueue的最大队列数,默认值-1
      queueSizeRejectionThreshold: 800 #即使maxQueueSize没有达到,达到queueSizeRejectionThreshold该值后,请求也会被拒绝,默认值5

设置线程词200,最大队列100

参考文章地址地址:https://www.cnblogs.com/seifon/p/9921774.html

你可能感兴趣的:(hystrix高并发未超时却降级)