I've inherited a .net/web service project that has serious connection object leaks. Oddly enough it's been in production for quite some time with no problems until recently. I guess the garbage collector cleans them up fairly quickly ordinarily. One web server at one customers site has started running out of connections when under heavy load.
Obviously the solutions is to fix all the connection leaks, but that's not going to happen quickly. I can't even change the max pool setting in the connection string, the connection string is built dynamically by the app. This would require a code change which requires going through a process which is not quick.
Is there anything I can do at the server to mitigate this until a code change can happen?
Why would this be a problem at just one location, a smaller location at that? If I knew the answer to that question I might be able to figure out a temporary work around.
Is it possible the actual problem is something else entirely and it's causing a connection pool problem? For example, perhaps the load balancing on the servers is hosed or something wrong with the web server that is having the problem.
The Default MAX POOL SIZE is 100, but you can increase this to the maximum allowed by the database you are connecting to.
A connection pool is created for each unique connection string. When a pool is created, multiple connection objects are created and added to the pool so that the minimum pool size requirement is satisfied. Connections are added to the pool as needed, up to the maximum pool size specified (100 is the default).
A quickfix can be to increase the Pool Size on your connection string. Add this property Max Pool Size=1000
so your string looks like ie. this
Data Source=server;Initial Catalog=db;User ID=user; Password=pwd;Max Pool Size=1000
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With