說明:
1、我還沒有真正理解Spring Cloud的精髓,現只停留在使用階段,可能存在分析不到位的問題。
1、這個是由於線程池的最大數量導致的,官方說隨着線程池的數量越大,資源開銷也就越大,所以調整時要慎重。
2、Hystrix默認是10個線程,超過就會報這個異常。
解決方法:
hystrix: threadpool: default: coreSize: 200 ##並發執行的最大線程數,默認10 maxQueueSize: 200 ##BlockingQueue的最大隊列數 queueSizeRejectionThreshold: 50 ##即使maxQueueSize沒有達到,達到queueSizeRejectionThreshold該值后,請求也會被拒絕 default: execution: timeout: enabled: true isolation: strategy: THREAD semaphore: maxConcurrentRequests: 1000 thread: timeoutInMilliseconds: 30000
說明:以上是YAML寫法
參考:
http://blog.csdn.net/gisam/article/details/78028080
http://blog.csdn.net/u011742484/article/details/59524361
http://blog.csdn.net/chenpeng19910926/article/details/78295720?locationNum=2&fps=1
http://blog.csdn.net/w_x_z_/article/details/72222550
http://ju.outofmemory.cn/entry/68192
https://segmentfault.com/a/1190000009939815
http://tietang.wang/2016/02/25/hystrix/Hystrix%E5%8F%82%E6%95%B0%E8%AF%A6%E8%A7%A3/
https://github.com/Netflix/Hystrix/issues/1428
https://github.com/Netflix/Hystrix/wiki/Configuration#allowmaximumsizetodivergefromcoresize