Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6612175
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T20:03:53+00:00 2026-05-25T20:03:53+00:00

I have a big trouble here, well at my server. I have an ASP

  • 0

I have a big trouble here, well at my server.

I have an ASP .net web (framework 4.x) running on my server, all the transactions/select/update/insert are made with ADO.NET.

The problem is that after being using for a while (a couple of updates/selects/inserts) sometimes I got more than 100 connections on “sleeping” status when check for the connections on sql server with this query:

SELECT 
 spid,
 a.status,
 hostname,  
 program_name,
 cmd,
 cpu,
  physical_io,
  blocked,
  b.name,
  loginame
FROM   
  master.dbo.sysprocesses  a INNER JOIN
  master.dbo.sysdatabases b  ON
    a.dbid = b.dbid where program_name like '%TMS%'
ORDER BY spid 

I’ve been checking my code and closing every time I make a connection, I’m gonna test the new class, but I’m afraid the problem doesn’t be fixed.

It suppose that the connection pooling, keep the connections to re-use them, but until I see don’t re-use them always.

Any idea besides check for close all the connections open after use them?

SOLVED(now I have just one and beautiful connection on “sleeping” status):

Besides the anwser of David Stratton, I would like to share this link that help explain really well how the connection pool it works: http://dinesql.blogspot.com/2010/07/sql-server-sleeping-status-and.html

Just to be short, you need to close every connection (sql connection objects) in order that the connection pool can re-use the connection and use the same connectinos string, to ensure this is highly recommended use one of the webConfig.

Be careful with dataReaders you should close its connection to (that was what make me mad for while).

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T20:03:54+00:00Added an answer on May 25, 2026 at 8:03 pm

    It sounds like it is connection pooling.

    From here: http://msdn.microsoft.com/en-us/library/8xx3tyca.aspx

    A connection pool is created for each unique connection string. When a
    pool is created, multiple connection objects are created and added to
    the pool so that the minimum pool size requirement is satisfied.
    Connections are added to the pool as needed, up to the maximum pool
    size specified (100 is the default). Connections are released back
    into the pool when they are closed or disposed.

    To ensure you’re not creating unnecessary pools, ensure that the exact same connection string is used each time you connect – store it in the .config file.

    You can also reduce the Maximum Pool Size if you like.

    Actually, I’d recommend just reading the entire article linked to above. It talks about clearing the pools, and gives you the best practices for using pooling properly.

    Edit – added the next day

    The pools on your server are there because of how Connection pooling works. Per the documentation linked to above:

    The connection pooler removes a connection from the pool after it has
    been idle for a long time, or if the pooler detects that the
    connection with the server has been severed. Note that a severed
    connection can be detected only after attempting to communicate with
    the server. If a connection is found that is no longer connected to
    the server, it is marked as invalid. Invalid connections are removed
    from the connection pool only when they are closed or reclaimed.

    This means that the server itself will clean up those pools eventually, if they remain unused. If the are NOT cleaned up,l that means that the server believes that the connections are still in use, and is hanging on to them to increase your performance.

    In other words, I wouldn’t worry about it unless you see a problem. Connection Pooling is happening exactly as it should be.

    If you REALLY want to clear the pools, again, per the documentation:

    Clearing the Pool

    ADO.NET 2.0 introduced two new methods to
    clear the pool: ClearAllPools and ClearPool. ClearAllPools clears the
    connection pools for a given provider, and ClearPool clears the
    connection pool that is associated with a specific connection. If
    there are connections being used at the time of the call, they are
    marked appropriately. When they are closed, they are discarded instead
    of being returned to the pool.

    However, if you want to adjust pooling, the Connection String can be modified. See this page, and search for the word “pool”:

    http://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqlconnection.connectionstring.aspx

    Or you can enlist a DBA to assist and set pooling at the server-level. That’s off-topic here, but ServerFault.com might have people to assist there.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i have big trouble with my application that web-application(jsp,java,servlet) landed between two server cause
I have a big trouble with the multiplication of floats. here is the example:
We have a legacy WSE3 ASP.Net webservice here that defines a method GetFileContent(string fileName)
I have big trouble with file uploads with php. My own tests are successful
We have a data driven ASP.NET website which has been written using the standard
I have a big project with many library projects as well as many packages
I am in big trouble at the moment. We have a huge JS library
I have big system that make my system crash hard. When I boot up,
I have big URL list, which I have to download in parallel and check
I have big problem when I am trying to deploy my app over clickonce.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.