Connecting to a database is the single slowest operation inside a data centric application. That’s why managing connections through connection pooling is important to application performance. Connection pooling allows you to reuse connections rather than create a new one every time the ADO.NET data provider needs to establish a connection to the underlying database.
You can control connection pooling behavior by using connection string options (see the documentation for your data provider). For example, for most ADO.NET data providers, you can define the number of connection pools, the number of connections in a pool, and the lifetime of pooled connections used by each process.
Each connection pool is associated with a specific connection string. By default, the connection pool is created when the first connection with a unique connection string connects to the database. The pool is populated with connections up to the minimum pool size. Additional connections can be added until the pool reaches the maximum pool size.
The pool remains active as long as any connections remain open, either in the pool or used by an application with a reference to a Connection object that has an open connection.
If a new connection is opened and the connection string does not exactly match an existing pool, a new pool must be created. By using the same connection string, you can enhance the performance and scalability of your application.
The connection string with the pooling related keywords would look somewhat like this
initial catalog=Northwind; Data Source=localhost; Connection Timeout=30;
User Id=MYUSER; Password=PASSWORD; Min Pool Size=20; Max Pool Size=200;
Incr Pool Size=10; Decr Pool Size=5;