MongoDB provides several connection pool options to test this. Mongo Connection Pool Settings
MaxPoolSize The maximum number of connections in the connection pool. The default value is 100.
minPoolSize The minimum number of connections in the connection pool. The default value is 0.
maxIdleTimeMS The maximum number of milliseconds that a connection can remain idle in the pool before being deleted and closed.
This option is not supported by all drivers.
waitQueueMultiple The number at which the driver multiplies the value of maxPoolSize by to provide the maximum number of threads that are allowed to wait for the connection to be available from the pool. For default values, see the MongoDB Driver and Client Library File Documentation.
waitQueueTimeoutMS The maximum time in milliseconds that a thread can wait for a connection to become available. For default values, see the MongoDB Driver and Client Library File Documentation.
source share