Random Timeout Error

  • Hi, following a code release we have seen random timeout errors. I'm not sure whats causing the system to slow down to the point that a timeout happens so set a SQL profiler running and found that on 2 traces before the timeout occurs there is a deadlock thing recorded...

    SET DEADLOCK_PRIORITY -10

    Does this mean that a deadlock is being resolved or what? im a c# dev so this really isnt my bag. any help would be much appreciated.

  • That means that the task being run will be cancelled if it is involved in a deadlock.  It doesn't mean that a deadlock will occur.  -10 is the lowest priority possible, so, by default, every other task will be considered more important.

    By default, deadlock priority is 0.  If two tasks get into a deadlock, SQL uses its own stats -- which comes down to SQL determining "which task being cancelled would require less work" -- to determine which one to cancel.

    But, if one task has a lower priority than the other one(s), SQL will cancel that task, no matter what the stats are for each query.

     

    SQL DBA,SQL Server MVP(07, 08, 09) Prosecutor James Blackburn, in closing argument in the Fatal Vision murders trial: "If in the future, you should cry a tear, cry one for them [the murder victims]. If in the future, you should say a prayer, say one for them. And if in the future, you should light a candle, light one for them."

  • Thats a really nice, easy to understand writeup. thanks a lot.

    Do you have any recommendations as to how I would go about diagnosing what could be causing the timeout?

  • Look in the SQL error log, you might be able to at least some more details about what task timed out, though admittedly not a lot of details.

    Typically timeouts are caused by blocking.  Blocking is normal and expected in SQL Server (or any other relational dbms), but excessive blocking is a problem.

    Also, make sure no database backup(s) are occurring during normal database activity.  Backups can cause serious slowdowns and contentions in any SQL database.

     

    SQL DBA,SQL Server MVP(07, 08, 09) Prosecutor James Blackburn, in closing argument in the Fatal Vision murders trial: "If in the future, you should cry a tear, cry one for them [the murder victims]. If in the future, you should say a prayer, say one for them. And if in the future, you should light a candle, light one for them."

  • Wonderful @ssc guru. After ruling out deadlocks, checking error logs and backup schedule I actually managed to find a sql agent job that was running some awful queries. ????

Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic. Login to reply