[Asp.net learning] database connection pool settings

Source: Internet
Author: User

 

Use a group of name-value pairs to configure the link pool as a link string. For example, you can configure whether the pool is valid (which is valid by default). The maximum and minimum capacity of the pool is used for the time when the queued requests that open the link are blocked. The following example string configures the maximum and minimum capacity of the pool.

 

The following table describes the connectionstring values that can be used to adjust the connection pool behavior.

Name

Default Value

Description

Connection lifetime

0

When the connection is returned to the pool, the creation time of the connection is compared with the current time. If the time interval exceeds the value specified by connection lifetime (in seconds ), the connection is destroyed. In clustering configuration, you can use it to force load balancing between the running server and the online server.

If the value is zero (0), the pool connection has the maximum timeout period.

Enlist

'True'

If true, the pool manager automatically registers the connection in the current transaction context of the Creation thread.

Max pool size

100

Maximum number of connections allowed in the pool

Min pool size

0

The minimum number of connections maintained in the pool.

Pooling

'True'

If the value is true, the connection is retrieved from the corresponding pool, or the connection is created and added to the corresponding pool when necessary.

<Connectionstrings>

<Add name = "ccopconnstr" connectionstring = "Data Source = (local); pooling = true; Max pool size = 7500; min pool size = 5; packet size = 4096; initial catalog = CCOP; user id = sa; Password = wuaisheng; connection timeout = 150; "providername =" system. data. sqlclient "/>

</Connectionstrings>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.