Configure threads used by MongoDB (Spring data mongo)

Preformatted textI am using Spring Boot with Webflux & Spring data mongodb. I’m using reactive streams (async drivers). I observe that when running a request, the thread id used when querying mongodb is of patter - async-channel-group-XX-handler-executor .
From which executor service are these threads created ? and can we configure this to improve performance. I didn’t find any helpful documentation around this.

Found this “streamFactory” method of MongoClientSettings which closely relates but this has been removed/deprecated in newer versions for driver.

MongoClientSettings.builder ()
    .streamFactoryFactory

While doing a load test we see only fixed number of threads are created (about 4) and mongodb response time increases. Since CPU utilization is still low, wondering if more threads are added then response time may improve.

Version used - 4.11 Java asyn (reactive) driver.
Java 17

In reactive/async programming, adding more threads will generally not improve performance until CPU utilization is high.

If you want more control of async settings, I suggest you use Netty as the transport layer. As of 5.0, you can figure that with com.mongodb.connection.NettyTransportSettings and MongoClientSettings.Builder.transportSettings.

Hope this helps.

Jeff