Answer the question
In order to leave comments, you need to log in
How does connection pooling work in mongoDb?
Can someone explain how connection pooling works in mongoDb? What is interesting to me, if I create a pool of 10 connections, they live throughout the life of the application? Can they break and how to reconnect them in this case? Maybe there is something in Russian to read about it?
Answer the question
In order to leave comments, you need to log in
They may break off.
Will they be regenerated - see the pool code.
The idea of the pool is that a new connection is first taken from the pool,
if not, a new one is created,
after use it is put into the pool for further use.
That is, there really should be many open active connections in the pool.
That's the point of the pool.
But at the same time, there is no need to reopen a connection already in the pool when it breaks.
Reconnection is enough to do when the connection is taken from the pool again.
But some pools are still able to restore the connection automatically.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question