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
 

 

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM