mongodb - PyMongo: Should I use single or multiple clients? -
the question simple: should keep operations single mongoclient? single client or multiple clients better other?
the mongoclient maintains connection pool. having multiple clients not have advantages. quite contrary, since new client has connect mongodb first, requires 3 way handshake , other overhead each time new client created.
since multiple clients have disadvantages single application, answer is: create 1 client , use everywhere need make connection.
Comments
Post a Comment