locked
C# .net in IIS connection pooling question RRS feed

  • Question

  • Hi,

    In our web application hosting on the IIS.
    If the pooling in the connection string in C# is set false,
    and a web page uses that connection string quite often,
    will that cause a poor performance problem?
    Or the pooling is handled by the IIS pool itself?
    Thanks for help.

    Jason

    Friday, May 29, 2015 7:10 AM

Answers

  • When you say "pooling in the connection string in C# is set false" do you mean sql server connection pooling?

    https://msdn.microsoft.com/en-us/library/8xx3tyca(v=vs.110).aspx

    like

    using (SqlConnection connection = new SqlConnection(
      "Integrated Security=SSPI;POOLING=FALSE;Initial Catalog=Northwind"))
        {
    

    Bad idea.

    Don't set that false, it will have performance implications and iis will not somehow fix that.

    If you mean some other sort of connection, please elaborate.


    Hope that helps.

    Technet articles: WPF: Change Tracking; All my Technet Articles

    Friday, May 29, 2015 7:34 AM
  • Hi,

    In our web application hosting on the IIS.
    If the pooling in the connection string in C# is set false,
    and a web page uses that connection string quite often,
    will that cause a poor performance problem?
    Or the pooling is handled by the IIS pool itself?
    Thanks for help.

    Jason

    Connectionstring is about connecting to a database like MS SQL Server. Connection pooling is about pooling connections to the database. IIS has nothing to do with it.

    In the connectionstrng credentials being used are user-id = JasonHuang8888 and psw = help, then the connection can be pooled. If 10 users are using the database in the application concurrently, then all 10 users can share the one connection the connection is pooled. If it were 100 users, then 100 users would share the same connection,.  In a Web  application, you can have several open/close on the database  throughout the application running for a user.

    You disable connection pooling for a database connection, then each open of the database  will be treated as an individual connection instead of the connection being shared pooled, which would result  in the database server being choked=out on connections to the database. And it could cause your application or other applications hitting the database to start having connection timeout exceptions as no more connections can be obtained from the DB.    

    Friday, May 29, 2015 12:34 PM

All replies

  • When you say "pooling in the connection string in C# is set false" do you mean sql server connection pooling?

    https://msdn.microsoft.com/en-us/library/8xx3tyca(v=vs.110).aspx

    like

    using (SqlConnection connection = new SqlConnection(
      "Integrated Security=SSPI;POOLING=FALSE;Initial Catalog=Northwind"))
        {
    

    Bad idea.

    Don't set that false, it will have performance implications and iis will not somehow fix that.

    If you mean some other sort of connection, please elaborate.


    Hope that helps.

    Technet articles: WPF: Change Tracking; All my Technet Articles

    Friday, May 29, 2015 7:34 AM
  • Hi,

    In our web application hosting on the IIS.
    If the pooling in the connection string in C# is set false,
    and a web page uses that connection string quite often,
    will that cause a poor performance problem?
    Or the pooling is handled by the IIS pool itself?
    Thanks for help.

    Jason

    Connectionstring is about connecting to a database like MS SQL Server. Connection pooling is about pooling connections to the database. IIS has nothing to do with it.

    In the connectionstrng credentials being used are user-id = JasonHuang8888 and psw = help, then the connection can be pooled. If 10 users are using the database in the application concurrently, then all 10 users can share the one connection the connection is pooled. If it were 100 users, then 100 users would share the same connection,.  In a Web  application, you can have several open/close on the database  throughout the application running for a user.

    You disable connection pooling for a database connection, then each open of the database  will be treated as an individual connection instead of the connection being shared pooled, which would result  in the database server being choked=out on connections to the database. And it could cause your application or other applications hitting the database to start having connection timeout exceptions as no more connections can be obtained from the DB.    

    Friday, May 29, 2015 12:34 PM