0

Is there a way to set or limit the number of connections to Mongo a single pymongo client instance will open? I don't want to modify Mongo config to do this, because I don't want to affect other applications.

4

Use the following parameter to set the number of maximum connections from your pymongo app.

client = MongoClient(host, port, maxPoolSize=10)

Here is documentation with more details.

| improve this answer | |
  • Says pool size is number of Mongo operations allowed. Does this always equate to number of network connections? Network is my bottleneck, with many active connections depending on scaling – MWhale Jan 28 '18 at 5:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.