I have a server that all client connect this server. May be max 100 connected users at the same time( I do not know if over ). Client is Android, Web and Desktop Application via socket(TCP/IP).
Only the server connect and querying data from MongoDB.
Server Application is loading MongoDB C++
driver once at start up and if connection incoming, Server Create a thread and MongoDB client
for per connection. Here's the main suspicion.
Is MongoDB Driver going on Fault? Is this way can caused a problem if the users count increase many?
I tried 86 Connection from my PC and there is no problem on performance or driver.
Thanks
The limits are really a function of your memory, so there's no way to tell you a specific number.
Here are two considerations:
If your server only ever connects to the database with a single set of authentication credentials, then you're best off creating a single mongocxx::pool object and then checking out clients from the pool in connection threads. You can tune the size of the pool to manage resource consumption.
If each client connection requires separate authentication credentials to the database, then you need to create a mongocxx::client object in each thread. This will use much more memory and have much higher latency as each client will create new connections to the database (rather than reusing connections as in the pool case).