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.
That's certainly an error message that points in the direction of the application. The pattern is that the application opens connections, but not does not close them properly. Eventually, there are no connections left in the pool, and connection fails.
Now, you also mentioned blocking, and true, there can be a situation where processes comes in and get blocked, and therefore never disconnect. This will eventually lead to this error above. And in that case, the message as such means nothing.
But there is also an interesting variation of this. The proper pattern of opening a connection is do it inside of a using
block. This guarantees that the connection is returned to the pool when the using
block is exited. On the other hand, this does not happen if the application simply does:
SqlConnection cn = new SqlConnection(...);
cn.Open();
// Do stuff here
cn.Close();
In this case, the connection remains open until the connection object is garbage-collected. Now, depending on the load, this may be sufficient, but if the load on the application increases over time, it may come to a point where garbage collection does not kick in often enough.
Please note that I am not saying that this is the actual root cause to your problem. Rather it is just a speculation. You have shared close to zero amount of information, and there is no way we can give you a confident answer of what is going on. At a minimum I would need to see the output of beta_lockinfo when you have this condition.