场景:门店服务调用其他外服务共计26个,每个服务都由Hystrix统一配置线程数

配置如下:

hystrix.threadpool.default.coreSize = 50
hystrix.threadpool.default.maxQueueSize = 1000
hystrix.threadpool.default.queueSizeRejectionThreshold = 1000

查看服务性能如下:

记录 SpringBoot 微服务调用Hystrix线程优化

经过查阅资料,了解hystrix配置参数后,发现可针对调用外服务的FeignClient单独配置相关参数:

参靠:https://blog.csdn.net/tongtong_use/article/details/78611225

hystrix.threadpool.default.coreSize = 30
hystrix.threadpool.default.maxQueueSize = 1000
hystrix.threadpool.default.queueSizeRejectionThreshold = 1000
hystrix.threadpool.BSS-MS.coreSize = 50
hystrix.threadpool.BSS-MS.maxQueueSize = 1000
hystrix.threadpool.BSS-MS.queueSizeRejectionThreshold = 1000
hystrix.threadpool.SBS-MS.coreSize = 80
hystrix.threadpool.SBS-MS.maxQueueSize = 1000
hystrix.threadpool.SBS-MS.queueSizeRejectionThreshold = 1000

针对需要高线程的服务设置大一些,低频率使用的服务设置小一些

记录 SpringBoot 微服务调用Hystrix线程优化

线程数明显降低,此时我们的线程使用频率如图:

记录 SpringBoot 微服务调用Hystrix线程优化

稳!

持续关注服务性能3天,无特殊异常,服务器线程优化完成

 

相关文章:

  • 2022-12-23
  • 2021-11-19
  • 2022-01-16
  • 2021-08-03
  • 2021-10-06
  • 2021-08-31
  • 2021-04-26
  • 2021-04-10
猜你喜欢
  • 2021-03-31
  • 2021-07-30
  • 2021-10-01
  • 2021-12-01
  • 2021-11-22
  • 2021-11-18
相关资源
相似解决方案