The diagram below describes our soon to be production environment, our user registration process, our async web API client, and our stress test application. I have successfully stress tested our User Registration process going to each of our IIS Servers and I am able to run 110 concurrent User Registration tasks without receiving any errors. I was able to run 50,000 user registrations in about 53 minutes. The IIS Server's CPU Utilization averaged 78% and SQL Server's was 13%. Increasing the number of concurrent tasks over 110 results in the following exceptions being thrown: "A task was canceled." or "The underlying connection was closed: A connection that was expected to be kept alive was closed by the server." My assumption was that IIS was running out of resources. I was OK with this result.
I was hoping to be able to get 220 concurrent user registration tasks (110 for each server) when stress testing both IIS Servers simultaneously. I placed the stress test client on two separate development machines: 1 targeted the first IIS server and the second one targeted the second one. I received the exceptions that I mentioned above right away. I had to reduce the concurrent user registration tasks to 55 for each server in order to successfully run my tests with without exceptions. My first thought was that SQL was restricting the number of connections, but max concurrent connections is set to 0 which means it unlimited (32767 concurrent connections). From my research, I don't think there is a per database connection limit. It doesn't make sense that the issue is on the IIS Servers because each one can separately run 110 tasks concurrently. I did try increasing the SQL Connection Pool Max Pool Size to 150 (I didn't expect it to solve this problem, but wanted to see if this could allow me to run more than 110 concurrent tasks on a single server). Any thoughts on where I can check next?