I am currently using MongoDB Driver 2.18.0, my MongoClientSettings are as follows:
maxConnecting=50;maxpoolsize=2000;minpoolsize=100;WaitQueueSize=60000;WaitQueueTimeout=00:00:10
If set in this way, the default configuration
MaxConnectionIdleTime=00:10:00;MaxConnectionLifeTime=00:30:00
will be used
The connection to the database will be created at startup and will be reclaimed every 10 minutes. For example, if 100 connections are idle, these 100 connections will be reclaimed and connections will be added to the minpoolsize at almost the same time.
My question is that frequent destruction and creation of connections will consume database performance. Why reclaimed connections to smaller than minpoolsize instead of keeping minpoolsize at all times?
Looking forward to your answer.