How to configure the MongoDb.NET Driver so it doesn't limit scaling my game

I ran some load tests on my Azure Functions, which talk to a MongoDb dedicated M10 cluster. I have the cluster set to autoscale.

After trying to run 1000 concurrent users reading and writing to the database, I quickly started getting WaitForQueueTimeout exceptions. I fixed this by increasing the settings.MaxConnecting and settings.MaxConnectionPoolSize values on the driver settings.

But now what happens when my game has 5000, 10000, 1 million users? How am I supposed to scale my game confidently when the driver settings are imposing limitations on my game’s ability to scale?

I want my infrastructure (Azure Functions and MongoDb Cluster) to set the limits, not some arbitrary value on the driver settings.

Please advise which settings I should use on the driver for this case.

Hi @MeltdownInteractive,

Are there any other details you can share about the application architecture? Assuming each game client (Player) is not corresponding to a connection? Are the functions using the same connection pool? i.e The connection pool might be starved due to the concurrent workload. There are more details around how connection pooling works with the .NET/C# driver here.

Thanks,

Rishit.

Hi Rishit,

I have read that document.

My point is I don’t want the connection pool to be starved because of some setting on the driver, I want to set it, so my Azure Functions can cause my MongoDb environment to scale all the way to an M200 dedicated cluster if needed.

My Azure Functions instance uses one MongoClient instance for all MongoDb operations.

So what is the recommended way to configure the driver settings so it doesn’t put any limitation on the driver?