Hystrix : 解决请求会被拒绝和抛出异常并且fallback不会被调用的问题

启动脚本增加参数:-Dserver.tomcat.max-http-header-size=102400

增大Hystrix,ribbon的各项参数;


hystrix:
  threadpool:
    default:
      coreSize: 5000 #并发执行的最大线程数 50
      maxQueueSize: 5000 #BlockingQueue的最大队列数 ---
      queueSizeRejectionThreshold: 3000 #即使maxQueueSize没有达到,达到queueSizeRejectionThreshold该值后,请求也会被拒绝 ---
  command:
    default:
      execution.isolation.thread.timeoutInMilliseconds: 7200000  #命令执行超时时间 2hours 600000 10min #600000 1min
      fallback.isolation.semaphore.maxConcurrentRequests:  5000 #如果并发数达到该设置值,请求会被拒绝和抛出异常并且fallback不会被调用。50
      execution.isolation.semaphore.maxConcurrentRequests: 5000 #最大并发请求数50
      default.execution.timeout.enabled: false     #执行是否启用超时

ribbon:
  eureka.enabled: false
  ConnectTimeout: 6000000 #600000
  ReadTimeout: 6000000 #600000


 
原文地址:https://www.cnblogs.com/zhaojinxin/p/7843305.html