Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 Database Connections and high traffic websites

Author  Topic 

00kevin
Yak Posting Veteran

78 Posts

Posted - 2007-06-24 : 15:41:50
I recently discovered something very interesting with one of my high traffic websites that some of you might want to consider.

I discovered that it is much faster to have many short database connection requests then having a small number of connection requests open for a longer period of time.

For example, if I have a webpage that needs to perform several operations (stored procedure calls) it is better to open one connection, make the sp call and close the connection. Having a connection open for all the calls that a page requires is a bad idea.

Let me explain why.

Consider what will happen if you have 10000 people requesting the same web page at the same time. You don't want 10000 connections open. What you want is a lot of short connection requests (one per sp) so that your users will get faster page responses. The less time a connection is open the better.

Many people now think that the oposite is true. The fact is it isn't MS has confused many people with the the introduction of connection pooling. Sure it might make it faster for a single user but it won't for many users. What you will end up with is a server crash and your users will only get blank pages. Furthermore, the problem with dynamic connection pooling is that you are stuck with a fixed minimum and maximum number determined by the administrators. Connection pooling doesn't solve all your problem.








   

- Advertisement -