Skip to content

MongoClient should reduce the number of created threads #46206

@franz1981

Description

@franz1981

Description

While profiling Quarkus super heroes we found that mongdb create a huge amount of Threads to handle async I/O (and other operations) - see the attached profiling data

FIGHTS_asprof_steady.zip

Implementation ideas

I see that https://mongodb.github.io/mongo-java-driver/4.1/apidocs/mongodb-driver-core/com/mongodb/MongoClientSettings.Builder.html#streamFactoryFactory(com.mongodb.connection.StreamFactoryFactory) allows to configure https://mongodb.github.io/mongo-java-driver/4.1/apidocs/mongodb-driver-core/com/mongodb/connection/netty/NettyStreamFactoryFactory.html which could even enable us to re-use the existing Netty/Vertx event loop for mongodb.

In alternative having the chance to size & configure the running thread pool for the mongoDB client would be of great help - unless I've misread how it should be done (@edeandrea as well).

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions