Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Sleeping Processes Expand / Collapse
Author
Message
Posted Wednesday, May 5, 2004 1:31 PM


SSC-Addicted

SSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-Addicted

Group: General Forum Members
Last Login: 2 days ago @ 3:31 PM
Points: 436, Visits: 619

I have a question about "sleeping" processes. 

We have an application that access our SQL Server.  I just took a look at the Current Activity and I saw 18 processes from the same person that all had a login time of a few seconds.

I have seen this before where I have had a large number of sleeping processes that had login times and last batch times that were long ago.

Is this caused by opening connections and not closing them, or is it something else?  Also, should I be concerned about having a lot of sleeping connections?  Is it going to cause a big drain on my system?  If so, should I do something about killing sleeping processes after a certain time or will this cause bigger problems?

Thanks.



----------------------------------------------------------

01010011010100010100110000100000010100110110010101110010011101100110010101110010
001000000101001001101111011000110110101101110011
Post #114573
Posted Thursday, May 6, 2004 8:33 AM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Tuesday, January 12, 2010 12:39 PM
Points: 48, Visits: 36

This can be somewhat confusing when looking at sp_who in Query Analyzer.  I believe this is somewhat of an energy saver feature.  When a spid is sleeping it is simply holding a place holder representing a login against the database.  It is very common to see many processes with a status of sleeping even from Production application processes.  I do not believe these processes are holding locks nor do they affect performance.

Oh, btw, GO HOGS!

Cortec




Post #114734
Posted Friday, May 7, 2004 7:03 AM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Friday, January 7, 2005 6:06 AM
Points: 31, Visits: 1

Normally a sleeping process may be waiting ether for a lock or user input. Cortec is correct the process is not holding locks.

Regards

Post #114945
Posted Tuesday, December 8, 2009 7:26 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Yesterday @ 7:31 AM
Points: 4, Visits: 227
Sorry, my last post was not complete. I also have Sleeping processes that are holding locks. The processes have no CPU, No I/O, using some memory. It is Awaiting Commands and has Last Batch time varying from 8 hrs to 5 days. These guys have prevented me from shrinking the Tlog until I killed them. We are running SQL Server 2000 Enterprise with latest SP. These TXNS have just started to appear in the last 2 weeks. Any ideas why or what could be causing these ? Thanks.
Post #830663
Posted Monday, January 28, 2013 2:03 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Sunday, September 14, 2014 2:09 AM
Points: 4, Visits: 49
I too observed similar behavior in our production servers, in SQL 2005&2008 environments.

Here is an issue that is new in SQL Server 2005, and is only exposed under specific conditions – namely, the use of the x64 version of SQL Server 2005 and the execution of large ad hoc query batches. Unfortunately, the memory that is used to store the execution plans for those ad hoc queries is not trimmed aggressively enough in the x64 version, and as a result we see more and more connections having to wait for memory allocations before they can continue. If any connection is suspended for more than 30 seconds, the application terminates the connection by reporting that the command currently executing has timed out.

This issue has been previously identified and is fixed in the upcoming service pack release (SP2) for SQL Server 2005,
the Community Technology Preview (CTP) release of which is available today, and is confirmed to fix the issue in your environment.

Possible Solutions:

1. Sp2 on SQL 2005 X64 machines


Post #1412254
Posted Monday, January 28, 2013 2:09 AM


SSC-Forever

SSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-Forever

Group: General Forum Members
Last Login: Today @ 3:13 AM
Points: 40,416, Visits: 36,867
Please note: 3 year old thread.

Also, ad-hoc queries and plan cache has nothing to do with sleeping connections.



Gail Shaw
Microsoft Certified Master: SQL Server 2008, MVP
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

We walk in the dark places no others will enter
We stand on the bridge and no one may pass

Post #1412259
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse