Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
GitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
added MONGO_MAX_POOL_SIZE and MONGO_USE_GREENLETS parameters #15
Hey Dan! Summary: max_pool_size is fine, but leave validation up to PyMongo. Don't expose use_greenlets.
max_pool_size is the horrifically-named option to control how many idle sockets the pool will keep open when they're returned to the pool (via end_request, or when a thread dies). So it's better thought of as "max idle sockets before I start closing any more that are returned to the pool."
It's far, far less frequently useful than anyone thinks. I'd venture to call it useless. People want it to mean "max concurrent connections allowed," but PyMongo has no such option. However, if you want to make max_pool_size configurable this is a fine way to do it.
I strongly recommend not validating it at all, since Connection or ReplicaSetConnection will much more thoroughly validate the parameter. Thus it's redundant and likely buggy to do your own validation here.
use_greenlets: please don't set this. We're removing it from public view very soon. Our idea was that you could either do gevent.monkey.patch_all(), or use gevent and set use_greenlets=True. We've changed our minds and we can't think of any good reason not to just do patch_all(), so we're going to legislate that and hide use_greenlets as best we can.