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.

1 Answer 1


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.

  • 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, 2018 at 5:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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