sql - Increasing the Max Pool Size and performance -


in asp.net website have connection sql server express database. , lot of errors like

system.invalidoperationexception: timeout expired. timeout period elapsed prior obtaining connection pool. may have occurred because pooled connections in use , max pool size reached.

after searching error found may due unclosed sql server connections. have used sql server connections , have disposed properly.i have used using-statement dispose connection. in application lot of requests (connections sql server database) @ peak time of day.

so planning increase max pool size. have not specified in connection string. 100 (default). planning increase 20000 won't error.

so increasing max pool size number cause problem? increasing max pool cause performance problem?

edit: below sample of how used using in code

using con1 new sqlconnection     con1.connectionstring = "" //conn string here     con1.open()     dosomething()       end using   using con2 new sqlconnection                 con2.connectionstring = "" //conn string here                 con2.open()                 dosomething()             using con3 new sqlconnection                con3.connectionstring = "" //conn string here                con3.open()                dosomething()                    end using  end using   catch ex exception  end try 

edit: tested setting max pool size 20000 in application check if max pool causing problem.i expecting not exception more. didn't solve problem or may not reason of error. after setting max pool got above error 50 times in duration of 3 hours. doubt due pool size? error message states "this may have occurred because pooled connections in use , max pool size reached". there other case same error message shown? please help.

you can increase pool size if want. there 2 downsides:

  1. more connections mean more resource usage.
  2. sql server has connection limit of 30k connections. when exhaust lose availability.

i recommend going higher more slowly. don't increase pool size 20k immediately. think 20k connections mean: mean 20k threads (or less of single thread uses more 1 connections) executing @ same time. if in spot have load problems.

why need many connections? web apps, have 1 connection open @ same time per running request. few hundred should enough cases.

try shorten duration each connection must open.


Comments

Popular posts from this blog

javascript - Jquery show_hide, what to add in order to make the page scroll to the bottom of the hidden field once button is clicked -

javascript - Highcharts multi-color line -

javascript - Enter key does not work in search box -