This came up a few times the last few weeks so wanted to make sure you don’t hit the issue the next time your peak load hits; With federations, your app servers connect to the collection of databases (your federated db with the root and member databases) using a single connection string. This is key to solving the connection multiplexing and connection pool fragmentation issues. However this also means that if you push a high load on your app tier (worker, web roles etc), you may run out of connections. The default connection pool ceiling is set to 100 concurrent connections and if you have more than 100 concurrent connections from the app instance, you get a timeout error that looks like this;

"Timeout expired. The timeout period elapsed prior to obtaining a connection from the pool. This may have occurred because all pooled connections were in use and max pool size was reached"

The workaround is simple: update your max pool size setting in the connection string in your app tier. So what do you set it to? we need to set the value a good distance away from the peak number of concurrent connections you expect a single app instance to handle. Usually 1000 is a safe limit for most realistic apps. If you are testing scale of performance you may want to push the value to a few thousands.

The way to set your max pool size is explained here for SQLClient in ADO.Net but it simply means you need to add “…;Max Pool Size=1000;” to your connection string. Full details on the connection string settings for SQL can be found here;