Solved

Timeout in SQLServer 2008

Posted on 2013-10-29
3
447 Views
Last Modified: 2013-11-04
Hello,

We didn't know that we have any kind of problem in our system related to the database.

But we have been analysing the timeout errors registered from the .NET aplication, we can see that sometimes the error "Timeout expired.  The timeout period elapsed prior to completion of the operation or the server is not responding" happens in query's with an average response time of less than 100 miliseconds.
The timeout of the .NET connection is 60s.

So seems that we have a process that cause to colapse the system.

In order to get the guilty, we want to establish a timeout for the worker processes in SQL Server, in order that anyone that use more than 50 seconds, has to be killed.

Does somebody know how to fix in SQLServer a limit/timeout for querys/processes/jobs?

Thanks in advance,
0
Comment
Question by:Jaimesastre
  • 2
3 Comments
 
LVL 8

Accepted Solution

by:
virtuadept earned 500 total points
ID: 39609032
This is a common problem. I do not know of any built in setting for this, but you can run DBA scripts that can do it.

Here is one that I found that attempts to send and email about the processes that will be killed before killing:

http://connectsql.blogspot.com/2012/09/sql-server-automatically-detect-and.html

Here is another one:

http://jasonhall.blogs.sqlsentry.net/2010/02/auto-kill-long-running-blocks-on-sql.html

These links have code examples and discussion about the issue.
0
 
LVL 39

Expert Comment

by:lcohan
ID: 39609169
<<
In order to get the guilty, we want to establish a timeout for the worker processes in SQL Server, in order that anyone that use more than 50 seconds, has to be killed.

Does somebody know how to fix in SQLServer a limit/timeout for querys/processes/jobs?
>>


You can set the Query timeout in SQL SSMS Properties on the "Connections" option like in attached picture however...I would strongly advise to NOT do that on production servers as this can cause lots of data issues - as you can see the SQL default is 600 seconds or ten minutes.
SQLProperties.png
0
 
LVL 39

Expert Comment

by:lcohan
ID: 39609177
0

Featured Post

VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Slowly Changing Dimension Transformation component in data task flow is very useful for us to manage and control how data changes in SSIS.
Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
Via a live example, show how to shrink a transaction log file down to a reasonable size.

862 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

25 Experts available now in Live!

Get 1:1 Help Now