How do I get SQL Server to resume cleaning up SPIDs?
-
Recently our SQL Server 2008 R2 has began to stop cleaning up defunct SQL processes as show by and EXEC sp_who2. From reading I know a ghost process should run every 10 seconds and clean these process up. But when our system get busy the processes start to accumulate and because they are not released they consume more and more resources until I restart the database. Most of these process are users doing development under SQL Server Manager. I've asked the developers to voluntarily limit themselves to 4 open windows but it doesn't seem to be helping. I've tried killing spids but I'd have to type all day and I'm afraid of killing an active one.
-
Answer:
If the processes are not being released because your developers are leaving connections open, that's pretty standard behavior. If a connection is open, it won't be cleaned up by any internal processes because it's supposed to be left open. As far as I know, the ghost cleanup process if for removing deleted records (see this entry from Paul Randal: http://www.sqlskills.com/BLOGS/PAUL/post/Inside-the-Storage-Engine-Ghost-cleanup-in-depth.aspx) not with removing completed connections. Instead of using sp_who2, use the Dynamic Management Objects (DMO) to get a better understanding of exactly what's going on. You can join sys.dm_exec_requests to sys.dm_exec_sql_text to understand exactly what SQL statements are being run by the active connections to see if they're simply sitting there open or are actively running a process. I'd suggest adding a default connection timeout and see if that helps remove processes that are no longer active.
Grant Fritchey at Quora Visit the source
Other answers
How much memory does your server have? It may be simpler/easier to add more.
Greg Moore
Related Q & A:
- How can I get through a proxy server?Best solution by Super User
- How Do I Configure SQL Server 2005 Backend?Best solution by Server Fault
- Can I get OSQL if I install SQL Server Client Tools?Best solution by Database Administrators
- How can I get the count in SQL?Best solution by Stack Overflow
- How can I get the remote server's date and time at the client side in my application in c#?Best solution by Stack Overflow
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.