473,387 Members | 1,742 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Usage of Connection Pooling: What are the best practices?

Hello All,

I am working on a windows application which will talk to the database

through the Web services.

So i need to enhaance the performance, for which i m using connection

pooling.

I want to use pooling at the Web services end and not the default SQL server

pooling.

i have created a connection pool component which maintains a pool of

sqlconnection objects.

When a request for connection comes:

1. It checks the pool for open connection which are not currently in use. If

it finds one it returns it.

2. Else it creates a new connection object , opens it and adds it to the

pool.

Now my problem is that if i plan to ve a pool of 100

connections............if at some instant i ve 100 requests i ll return all

the avaialable connection objects

But this scenario was an exterme one and in most cases not more than 50

connections will be in use. So in that case i need to close the open

connection if it is unused for a given amount of time.

For that i created a thread which keeps checking if any of the connection

object timed out and if it has timed out then close it.

Will this approach be useful performance wise??

Will an extra thread running affect the applications perforamance??

Is there any other solution to this??

Is application level pooling needed in my application and will it help

improve the performance??

Please reply ASAP.

Regards,

Mithun
Jul 21 '05 #1
1 2796
It's recommended that you make use of the SqlProvider connection pool which
is included in the .NET Framework. This has undergone extensive performance
and scalability testing and it is unlikely a custom implementation of a
connection pool would see significant improvements in these areas.

FYI in order to leverage the built-in connection pool you need to always use
the same connection string - this implies the same user account is used to
authenticate against the database. Check out this link:
http://msdn.microsoft.com/library/de...taProvider.asp

--
Provided by the Microsoft PSfD UK team.
This posting is provided "AS IS" with no warranties, and confers no rights.

"Mithun Verma" <mi*****@MAQSoftware.com> wrote in message
news:O6******************@TK2MSFTNGP10.phx.gbl...
Hello All,

I am working on a windows application which will talk to the database

through the Web services.

So i need to enhaance the performance, for which i m using connection

pooling.

I want to use pooling at the Web services end and not the default SQL server
pooling.

i have created a connection pool component which maintains a pool of

sqlconnection objects.

When a request for connection comes:

1. It checks the pool for open connection which are not currently in use. If
it finds one it returns it.

2. Else it creates a new connection object , opens it and adds it to the

pool.

Now my problem is that if i plan to ve a pool of 100

connections............if at some instant i ve 100 requests i ll return all
the avaialable connection objects

But this scenario was an exterme one and in most cases not more than 50

connections will be in use. So in that case i need to close the open

connection if it is unused for a given amount of time.

For that i created a thread which keeps checking if any of the connection

object timed out and if it has timed out then close it.

Will this approach be useful performance wise??

Will an extra thread running affect the applications perforamance??

Is there any other solution to this??

Is application level pooling needed in my application and will it help

improve the performance??

Please reply ASAP.

Regards,

Mithun

Jul 21 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Mark | last post by:
OK. Here we go. I have an ASP.NET application that does many hits to a SQL Server DB on a separate server. When I first created this application (2 years ago) and was very new to ASP/ASP.NET, to...
7
by: greg | last post by:
Hi We have w2k, iis5, .NET/c# I periodically receive this message and the system freezes ++++++++++++++++++++++++++++++++++++++++++++++++++ Timeout expired. The timeout period elapsed...
1
by: Mithun Verma | last post by:
Hello All, I am working on a windows application which will talk to the database through the Web services. So i need to enhaance the performance, for which i m using connection
2
by: PH | last post by:
Hi; I got an application written in ASP.NET (VB.NET and C#) that uses connection pooling. The Max connections defined in the connection command are 50, and there are no more than 3 or 4 user...
3
by: Martin B | last post by:
Hallo! I'm working with C# .NET 2.0, implementing Client/Server Applications which are connecting via Network to SQL-Server or Oracle Databases. To stay independent from the underlaying Database...
4
by: =?Utf-8?B?RFNJU3VwcG9ydA==?= | last post by:
Hi, I have this ASP.NET application developed with VS.NET 2003 VB.NET and deplyed on Windows 2K server IIS 5. This application uses the following: - Oracle 10G databse - MS Data Access Block...
6
by: Charles Zhang | last post by:
I want to reuse ADO.NET Connection object from session to session, are there any way to do that? Thanks Charles Zhang
3
by: fniles | last post by:
In the Windows application (using VB.NET 2005) I use connection pooling like the following: In the main form load I open a connection using a connection string that I stored in a global variable...
0
viswarajan
by: viswarajan | last post by:
Introduction This article is to go in deep in dome key features in the ADO.NET 2 which was shipped with VS 2005. In this article I will go trough one of the key features which is the Connection...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.