O'Reilly logo

ASP.NET Site Performance Secrets by Matt Perdeck

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Data access

Accessing the database is the most expensive part of the processing for most pages. Here you'll see a number of ways to reduce that expense.

Connection pooling

Opening a connection to the database is expensive. Because of this, ASP.NET maintains a pool of open connections. There is a pool per connection string, by Windows identity when integrated security is used, and by whether they are enlisted in a transaction.

When you open a connection, you actually receive a connection from the pool. When you close that connection, it stays open and goes back to the pool, ready for use by another thread.

To make this work efficiently, always use exactly the same connection string for each database you access. If you access one database, have one ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required