Comments on: A Deep Dive Into Spring WebFlux Threading Model https://piotrminkowski.com/2020/03/30/a-deep-dive-into-spring-webflux-threading-model/ Java, Spring, Kotlin, microservices, Kubernetes, containers Thu, 02 Jun 2022 08:04:25 +0000 hourly 1 https://wordpress.org/?v=6.9.1 By: piotr.minkowski https://piotrminkowski.com/2020/03/30/a-deep-dive-into-spring-webflux-threading-model/#comment-1581 Thu, 02 Jun 2022 08:04:25 +0000 http://piotrminkowski.com/?p=7878#comment-1581 In reply to stranger.

Thanks 馃檪
There are thread pool names in the logs, and you can find information about it in Spring documentation.

]]>
By: stranger https://piotrminkowski.com/2020/03/30/a-deep-dive-into-spring-webflux-threading-model/#comment-1574 Tue, 31 May 2022 06:28:14 +0000 http://piotrminkowski.com/?p=7878#comment-1574 Nice article.
Wondering how you found out the fact that some reactor thread is delegating task to some bounded elastic thread, just by a screenshot of yourkit?

]]>
By: piotr.minkowski https://piotrminkowski.com/2020/03/30/a-deep-dive-into-spring-webflux-threading-model/#comment-1553 Wed, 04 May 2022 10:18:23 +0000 http://piotrminkowski.com/?p=7878#comment-1553 In reply to Arunim Chopra.

I’m just configuring a dedicated thread pool, to use a different pool then the main worker thread pool

]]>
By: Arunim Chopra https://piotrminkowski.com/2020/03/30/a-deep-dive-into-spring-webflux-threading-model/#comment-1544 Wed, 27 Apr 2022 18:21:53 +0000 http://piotrminkowski.com/?p=7878#comment-1544 Hi Piotr.

when u write

return Flux.fromStream(this::prepareStreamPart1).log()
.mergeWith(
client.get().uri(“/slow/” + param)
.retrieve()
.bodyToFlux(Person.class)
.log()
.publishOn(Schedulers.fromExecutor(taskExecutor))
);

as you have used publishOn in the end, how will it benefit at all? The webclient will still use nio thread group to call and receive responses over network. So, what purpose does publishOn serve here?

And how can performance increase with this change as you have shown in your performance results?

]]>
By: Bachelor of Interior Program Telkom University https://piotrminkowski.com/2020/03/30/a-deep-dive-into-spring-webflux-threading-model/#comment-1154 Thu, 10 Jun 2021 02:49:52 +0000 http://piotrminkowski.com/?p=7878#comment-1154 good! I’m looking forward to seeing your post, will you make it like this again?

]]>
By: piotr.minkowski https://piotrminkowski.com/2020/03/30/a-deep-dive-into-spring-webflux-threading-model/#comment-1098 Tue, 20 Apr 2021 07:51:41 +0000 http://piotrminkowski.com/?p=7878#comment-1098 In reply to Mariusz W贸jcik.

Yes, of course. They are workers.

]]>
By: Mariusz W贸jcik https://piotrminkowski.com/2020/03/30/a-deep-dive-into-spring-webflux-threading-model/#comment-1097 Fri, 16 Apr 2021 08:46:39 +0000 http://piotrminkowski.com/?p=7878#comment-1097 I mean the semantics of these thread pools. Are they low-level threads that are responsible for reading sockets(IO), or rather high-level threads that perform application tasks (Workers). The names suggest the first one group, but I think they are worker (maybe I’m wrong).

]]>
By: piotr.minkowski https://piotrminkowski.com/2020/03/30/a-deep-dive-into-spring-webflux-threading-model/#comment-1096 Fri, 16 Apr 2021 08:23:49 +0000 http://piotrminkowski.com/?p=7878#comment-1096 In reply to Mariusz W贸jcik.

Yes, ‘epoll*’ is for that fragment `Flux.fromStream(this::prepareStream).doOnNext(person -> LOGGER.info(“Server produces: {}”, person))`, while ‘nio*’ is for the `WebClient`:
“`
client.get().uri(“/slow/” + param)
.retrieve()
.bodyToFlux(Person.class)
.log()
.publishOn(Schedulers.fromExecutor(taskExecutor))
“`
So, the client and server use different thread pools.

]]>
By: Mariusz W贸jcik https://piotrminkowski.com/2020/03/30/a-deep-dive-into-spring-webflux-threading-model/#comment-1095 Fri, 16 Apr 2021 07:19:21 +0000 http://piotrminkowski.com/?p=7878#comment-1095 On the first screen, thread names have “epoll” term, and on the second, “nio”. Does it indicate the pool they come from? What about Workers Threads ?

]]>
By: Piotr Mi艅kowski https://piotrminkowski.com/2020/03/30/a-deep-dive-into-spring-webflux-threading-model/#comment-847 Thu, 25 Jun 2020 10:37:42 +0000 http://piotrminkowski.com/?p=7878#comment-847 In reply to Elia.

Well, there is a lower number of used threads, and probably a little smaller memory footprint (I didn’t test it). In this article I focused on showing threading model, not on performance testing. However, if you will increase the number of concurrent threads in the test you should have better result in comparison to synchronous approach.

]]>