reactor / reactor-netty

TCP/HTTP/UDP/QUIC client/server with Reactor over Netty
https://projectreactor.io
Apache License 2.0
2.61k stars 647 forks source link

QUESTION: Higher Performance when using dedicated threads for every httpClient #3497

Closed mateusz-nalepa closed 3 weeks ago

mateusz-nalepa commented 3 weeks ago

Problem

I've asked question on stackoverflow SpringBoot + Netty: Higher Performance when using dedicated threads for every httpClient and then I've realized, that maybe this github project is a better place for it. I just don't know why in my scenario using dedicated threads works better and I'm looking for an answer.

Code

All the details are on stackoverflow, so here i will put only those lines, which are imo most important:

when (isUseDedicatedThreadsPerClient) {
    true -> { // better performance here
        val reactorRequestFactory = ReactorResourceFactory().apply {
            connectionProvider = connectionProviderBuilder.build()
            loopResources = LoopResources.create("http-loop-$number-pool-")
        }
        return ReactorClientHttpConnector(reactorRequestFactory, clientCustomization)
    }
    false -> {
        val reactorRequestFactory = ReactorResourceFactory().apply {
            connectionProvider = connectionProviderBuilder.build()
            loopResources = sharedLoopResources
        }
        return ReactorClientHttpConnector(reactorRequestFactory, clientCustomization)
    }
}

Your Environment

Thanks in advance for your help!

violetagg commented 3 weeks ago

@mateusz-nalepa Thanks for getting in touch, but it feels like this is a question that would be better suited to Gitter or Stack Overflow. As mentioned in README, we prefer to use GitHub issues only for bugs and enhancements.