When you think ASP, think...
Recent Articles
All Articles
ASP.NET Articles [1.x] [2.0]
ASPFAQs.com
Message Board
Related Web Technologies
User Tips!
Coding Tips
Search

Sections:
Book Reviews
Sample Chapters
Commonly Asked Message Board Questions
Headlines from ASPWire.com
JavaScript Tutorials
MSDN Communities Hub
Official Docs
Security
Stump the SQL Guru!
Web Hosts
XML Info
Information:
Advertise
Feedback
Author an Article
Technology Jobs

















internet.com
IT
Developer
Internet News
Small Business
Personal Technology
International

Search internet.com
Advertise
Corporate Info
Newsletters
Tech Jobs
E-mail Offers
ASP ASP.NET ASP FAQs Message Board Feedback ASP Jobs
Print this page.

Windows Systems Administrator
Jupitermedia
US-CT-Darien

Justtechjobs.com Post A Job | Post A Resume

Published: Thursday, November 05, 1998

WebDaily: Your daily source for Web Technology Tips and Tricks!


*****************************************************************
Connection Pooling
*****************************************************************

- continued -

* This article describes how to utilize connection pooling in your ASP application.

If your ASP applications interact with databases at all (and I am sure they do, else why use Active Server Pages?), then you can experience a great increase in database performance if you are utilizing connection pooling. The time and resources needed to create a connection to a database are not trivial. If for every page where you create a connection instance, a new connection must be created, and then deleted once the page is finished executing, your users will notice the performance lost if there are many people hitting your server simultaneously.

Connection pooling keeps the connection instances around after a particular page is through using it. For example, say that you have an ASP file that creates a connection to a SQL database, retrieves some data, and displays it on the web page. Without connection pooling enabled, here are the sequence of steps that ASP performs:

Create a connection to the database Send the query to the database Get back the resultset Display the resultset Destroy the connection

Each user who hits this page will have to go through each of these steps. With connection pooling, however, the steps involved look more like this:

See if an unused connection exists in our "pool" of connections If so, use it, else create a new connection Send the query to the database Get back the resultset Display the resultset Return the connection to the "pool"

It is much less costly to reuse a connection than to have to create a brand new one each and every time a page needs to establish a connection to a database.

Now, let's look at how we can make sure our ASP applications use connection pooling. There are two steps which you need to take to utilize connection pooling: one, you must make sure your ASP registry settings have connection pooling enabled; two, you must have SQL server set up to use TCP/IP Sockets.

First, to edit the registry so that our ASP programs use connection pooling you will need to run the REGEDIT program and alter the following registry entry:

HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\W3SVC\ASP\Parameters

(If this value is not set, go ahead and insert this key into your registry)

Find the StartConnectionPool entry and change the value from 0 (zero) to 1 (one). Once this change has been made, ADO and ASP will utilize connection pooling.

The final step is to set SQL server to use TCP/IP Sockets. To set your SQL Server to use TCP/IP Sockets, you need to go into SQL Server and select the SQL Server Client Configuration Utility (via Start / Programs / Microsoft SQL Server / SQL Server Client Configuration Utility). Once the utility opens, click on the Net Library tab. Under the Default Network setting, choose TCP/IP Sockets. That's all there is to it! (Note: Connection Pooling will not work with Access as the backend. If there is a workaround that someone knows, please email me with the solution. Thanks!)

Happy Programming!


*****************************************************************
*****************************************************************
To subscribe to WebDaily, point your browser to:
http://www.4GuysFromRolla.com/webtech/webdaily
*****************************************************************
*****************************************************************


Windows Internet Technology | ASP.NET [1.x] [2.0] | ASPMessageboard.com | ASPFAQs.com | Advertise | Feedback | Author an Article



JupiterOnlineMedia

internet.comearthweb.comDevx.commediabistro.comGraphics.com

Search:

Jupitermedia Corporation has two divisions: Jupiterimages and JupiterOnlineMedia

Jupitermedia Corporate Info


Legal Notices, Licensing, Reprints, & Permissions, Privacy Policy.

Advertise | Newsletters | Tech Jobs | Shopping | E-mail Offers

Solutions
Whitepapers and eBooks
Microsoft Article: Will Hyper-V Make VMware This Decade's Netscape?
Microsoft Article: 7.0, Microsoft's Lucky Version?
Microsoft Article: Hyper-V--The Killer Feature in Windows Server 2008
Avaya Article: How to Feed Data into the Avaya Event Processor
Microsoft Article: Install What You Need with Windows Server 2008
HP eBook: Putting the Green into IT
Whitepaper: HP Integrated Citrix XenServer for HP ProLiant Servers
Intel Go Parallel Portal: Interview with C++ Guru Herb Sutter, Part 1
Intel Go Parallel Portal: Interview with C++ Guru Herb Sutter, Part 2--The Future of Concurrency
Avaya Article: Setting Up a SIP A/S Development Environment
IBM Article: How Cool Is Your Data Center?
Microsoft Article: Managing Virtual Machines with Microsoft System Center
HP eBook: Storage Networking , Part 1
Microsoft Article: Solving Data Center Complexity with Microsoft System Center Configuration Manager 2007
MORE WHITEPAPERS, EBOOKS, AND ARTICLES
Webcasts
Intel Video: Are Multi-core Processors Here to Stay?
On-Demand Webcast: Five Virtualization Trends to Watch
HP Video: Page Cost Calculator
Intel Video: APIs for Parallel Programming
HP Webcast: Storage Is Changing Fast - Be Ready or Be Left Behind
Microsoft Silverlight Video: Creating Fading Controls with Expression Design and Expression Blend 2
MORE WEBCASTS, PODCASTS, AND VIDEOS
Downloads and eKits
Sun Download: Solaris 8 Migration Assistant
Sybase Download: SQL Anywhere Developer Edition
Red Gate Download: SQL Backup Pro and free DBA Best Practices eBook
Red Gate Download: SQL Compare Pro 6
Iron Speed Designer Application Generator
MORE DOWNLOADS, EKITS, AND FREE TRIALS
Tutorials and Demos
How-to-Article: Preparing for Hyper-Threading Technology and Dual Core Technology
eTouch PDF: Conquering the Tyranny of E-Mail and Word Processors
IBM Article: Collaborating in the High-Performance Workplace
HP Demo: StorageWorks EVA4400
Intel Featured Algorhythm: Intel Threading Building Blocks--The Pipeline Class
Microsoft How-to Article: Get Going with Silverlight and Windows Live
MORE TUTORIALS, DEMOS AND STEP-BY-STEP GUIDES