You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Current default maxPoolSize for MongoClient is 100. We may wish to reduce this amount to limit the number of active connections per worker. Additionally we only use one worker currently, but in the production dockerfile we could use multiple via the --workers setting.
If we go for --workers 4 for example using the default maxPoolSize of 100, we could have a total of 400 open database connections at once. In practice however as we can only process 4 requests at the same time, I would assume that ignoring any async behaviour we would only have 4 open connections at once.
For which I found a total of 9 connections which increased from an initial 6 by navigating around the site (with a single worker), but then never went further. So it appears it can differ in practice still if there are more connections available in the pool. Increasing the workers to 4, I found a total of 17 connections after navigation without changing the maxPoolSize in either case. Setting maxPoolSize still maintained 16 connections, so not sure what is going on there.
Current default
maxPoolSize
for MongoClient is 100. We may wish to reduce this amount to limit the number of active connections per worker. Additionally we only use one worker currently, but in the production dockerfile we could use multiple via the--workers
setting.See here for info on maxPoolSize:
https://pymongo.readthedocs.io/en/stable/faq.html#how-does-connection-pooling-work-in-pymongo
The text was updated successfully, but these errors were encountered: