高并发下-Zuul参数调优
项目背景:
单个请求过来时候没问题,大量请求过来会是不是报错 500
日志详情
问题定位
zuul网关
在spring cloud Zuul中有2种对路由的隔离机制,其默认的是信号量(semaphore)对路由做隔离,默认值是100,当一个路由请求的信号量高于100就返回500。
修复
application.yml
zuul:
semaphore:
max-semaphores: 5000
hystrix:
command:
default:
execution:
isolation:
strategy: SEMAPHORE
thread:
timeoutInMilliseconds: 120000
semaphore:
maxConcurrentRequests: 1000
circuitBreaker:
sleepWindowInMilliseconds: 5000
参考
https://blog.csdn.net/zhangzijiejiayou/article/details/101070379/
https://www.cnblogs.com/java-spring/p/13042335.html