Challenges with the WebFlux processing model

WebFlux is significantly different from Web MVC. Since there is no blocking I/O in the system, we can use only a few Thread instances to process all requests. Processing events simultaneously does not require a higher number of Thread instances than processors/cores in the system.

This is because WebFlux is built on top of Netty, where the default number of Thread instances is the Runtime.getRuntime().availableProcessors() multiplied by two.

Although the use of non-blocking operations allows the processing of results asynchronously (see diagram 6.11), so we can scale better, utilize CPUs more efficiently, spend CPU cycles on actual processing, and reduce wastage on context switching, the asynchronous ...

Get Hands-On Reactive Programming in Spring 5 now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.