Reputation: 107
I'm using entity framework 6 on multiple applcations. All of this applications (around 10) make use of the same database. In some cases (when there are lots of connections at the same time, I believe), applications won't work, the exception is "underlying provider failed on open". I made some research and I found out entity framework's default max pool connections is 100, so I increase that number to 1,000 in most of the applications. Is it poosible that if I left one application with the 100 default, my other applications will stop working too? As I understand, entity framework tells SQL how many connections will be available, but are this connections for the application only or is it general?
Upvotes: 3
Views: 262
Reputation: 107
As I suspected, all the applications making connections to the same sql instance must change it's connection string to allow more than entity's framework default connections (100).
Scenario:
Application 1 and 2 have MaxPoolSize = 1000. Application 3 has MaxPoolSize = 100.
Application 1 and 2 are making connections to SQL, the current connections are 200... Everything works fine.
Application 3 tries to make a connection to SQL, it's configuration tells SQL that the max pool size is only 100, so SQL blocks the pooling, until connections timeout and are under 100.
In other words, you have to make sure all MaxPoolSize are changed from the default 100 to avoid this problem, in this case I changed all of them to allow a max of 1000 connections.
Upvotes: 1