Closed davidyangss closed 2 years ago
@davidyangss Can you provide a complete minimal sample (something that we can unzip or git clone, build, and deploy) that reproduces the problem.
OK, but it will take some time. I will provide a demo
I put the demo into the repo: https://github.com/davidyangss/demo.git @violetagg
This may be another factor。 When I tested spring-cloud-gateway 3.1.0, I also found the same problem. Especially when the number of connections exceeds 10,000, the problem is obvious
Hi @davidyangss,
Thanks for sharing your sample app.
Are you using "ab" intentionally ? This tool only supports HTTP/1.0 and I got a tons of TIME_WAIT sockets while loading your demo project. Could you use another loader tool which supports HTTP/1.1 + keep alive, like wrk2, gatling, vegeta, or jmeter for example ?
let us know, thanks.
Hi, @pderop ,
Hi @davidyangss,
Thanks for having insisted on this issue, I could finally reproduce well the issue using vegeta tool. Now we have a fix available in the 1.0.16-SNAPSHOT, that would be nice if you could give it a try ?
🐞 Hot thread(reactor-http-epoll) appears when WebClient requests back-end services
Problem Description I implemented an application using WebFlux. This application provides REST service, and then calls (WebClient) backend service to get the result, and return the result. But, when I stress test, I found a hot thread appeared. Its name is similar to reactor-http-epoll. Through log analysis, I came to the conclusion that almost all Http connections are created by this hot thread, As shown
Spring version spring-boot-starter-parent 2.5.6 spring-boot-starter-webflux 2.5.6 io.netty 4.1.69.FINAL io.projectreactor:reactor-core:3.4.10 reacotr-pool-0.2.6 reactor-netty:1.0.11
ReactorResourceFactory
@Primary @Bean public ReactorResourceFactory reactorClientResourceFactory(PrometheusMeterRegistry prometheusMeterRegistry, CollectorRegistry collectorRegistry) { ReactorResourceFactory resourceFactory = new ReactorResourceFactory(); resourceFactory.setUseGlobalResources(false);
}
🎁 Reasons for the emergence of hot threads, The hot thread of this stress test is reactor-http-epoll-6
🎁 My advice
🎁 The above is my analysis, it may be accurate, please correct me. thanks