日志
The web application [ROOT] created a ThreadLocal with key of type [com.netflix.hystrix.metric.HystrixThreadEventStream$1] (value [com.netflix.hystrix.metric.HystrixThreadEventStream$1@60ca88f2]) and a value of type [com.netflix.hystrix.metric.HystrixThreadEventStream] (value [HystrixThreadEventStream (341658 - http-nio-10454-exec-2353)]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak.
持续不断创建 ThreadLocal 存在内存泄漏问题。
大量请求/黑客攻击,到网关,网关请求下游,最终返回500错误,触发Hystrix,不断创建ThreadLocal,最终将zuul拖挂
配置了Hystrix (例如:
hystrix.command.default.execution.isolation.thread.timeoutInMilliseconds = 14000
hystrix.command.default.execution.isolation.strategy = SEMAPHORE ) 信号量
解决办法:引入限流