August 13, 2019 at 9:48 pm
I have a particular VM instance of SQL that is exhibiting perplexing behavior. The job consists of two steps, the first typically runs in under 2 seconds, while the second runs around a minute. But the duration of the job itself has been ranging up to an hour! For example, the 11:37 run today list step 1 with a duration of 0:03, then shows step 2 with a 0:39 duration (but starting 5 minutes later), then shows a total duration of 7:02. The 11:47 run has durations of 0:00, 1:41 (starting 39 minutes later), and 40:55.
Any ideas what to look for? I'm thinking the VM or SQL Agent is just overloaded, but was looking for input on both what would cause this behavior and how to best address it. Both job steps are simple invocations of stored procedures via TSQL.
August 13, 2019 at 10:07 pm
Hello
Have you tried executing your procedures manually?
Greetings
August 14, 2019 at 11:28 am
Sounds like blocking or resource contention. Take a look at the system_health Extended Event session. Excessive waits and blocks are automatically captured there. It should give you a lot more information to go on. Here's some examples of how to retrieve that data. You can also use the Data Viewer window to search them.
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
- Theodore Roosevelt
Author of:
SQL Server Execution Plans
SQL Server Query Performance Tuning
August 14, 2019 at 3:28 pm
August 14, 2019 at 3:29 pm
August 15, 2019 at 2:25 pm
Grant,
Great references! I had to do a double take after reading your article and then finding my 4 health logs covered the last two seconds! I am diving deeper now, since it appears they are just full of (mostly) deadlocks writing to job history, which is firing trigger msdb.dbo.ti_Restart_Job.
August 15, 2019 at 2:44 pm
August 15, 2019 at 7:06 pm
Thanks for coming back with what the problem was. So many people never let us know.
You can modify system_health to keep more data, but, from the sounds of it, I wouldn't recommend that just yet. Best of luck.
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
- Theodore Roosevelt
Author of:
SQL Server Execution Plans
SQL Server Query Performance Tuning
Viewing 8 posts - 1 through 7 (of 7 total)
You must be logged in to reply to this topic. Login to reply