title: Why is SQL Server Agent Job running endlessly?
body: <p>Currently I'm working on system that gathers data from different websites/apis and stores this data in a SQL Server database. Then reporting service generates reports based on this data.</p>
  
  <p>We have a lot of jobs running in SQL Server agent (each job has some steps, each step can be of type - PowerShell script or SQL...). </p>
  
  <p>Version of SQL Server is 2017.</p>
  
  <p><a href="https://i.stack.imgur.com/sxjD7.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/sxjD7.png" alt="enter image description here"></a></p>
  
  <p><a href="https://i.stack.imgur.com/4xXgj.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/4xXgj.png" alt="enter image description here"></a></p>
  
  <p>We have a problem that almost every day there are jobs that starts but never ends (status is "Executing"). This job can not run that long. </p>
  
  <p>Does anybody has an idea how to solve this problem? Or at least how to investigate it?</p>
  
  <p>CPU usage on virtual machine is +- 20%. Memory usage - 50%. So it is not a resource problem.</p>