SQL Jobs are Running slow in Azure SQL MI

Thyagarajulu B M 121 Reputation points
2023-07-05T12:55:52.49+00:00

Hi Team,

Recently , We have migrated all SQL jobs from on-premises SQL Server to Azure SQL MI. SQL Jobs are running slow compared with on-premises SQL Server.

Please help on this issue.

Azure SQL Database
SQL Server | Other
{count} votes

3 answers

Sort by: Most helpful
  1. Alberto Morillo 34,671 Reputation points MVP Volunteer Moderator
    2023-07-05T13:43:35.5633333+00:00

    Please verify what types of waits are prevalent during the execution of jobs. Here you will find ways to capture waits for the jobs. If you see on the top waits IO related waits then the workload your jobs execute is IO intensive and IO latency could be 10 ms on General Purpose. As a workaround and improve some performance, reserve enough storage on all log files to not allow them to auto-grow with DML operations. Backups may show poor performance and automated backups may impact some tasks on the server also.

    Make sure you defragment and update statistics after migration, to improve some performance.

    If the top waits are not IO related, please share them with us. As Erland mentioned on the comments, please share more information about the type of workload your jobs execute.


  2. Thyagarajulu B M 121 Reputation points
    2023-07-05T18:07:40.85+00:00

    tempdb

    0 comments No comments

  3. RahulRandive 10,486 Reputation points Volunteer Moderator
    2023-07-05T18:47:30.29+00:00

    Hi @Thyagarajulu B M

    Here is the possible recommendation/solution for “TEMPDB ran out of space during spilling” issue which you are getting. 

    There is a limit in tempdb size for both General Purpose and Business Critical tier. If the limit is reached, it will not automatically scale. You need to add more vCores to get more TempDB space. Resource limits - Azure SQL Managed Instance | Microsoft Docs
     
    Recommendations to mitigate tempdb issue:

    1. Long running transactions causes tempdp full issue and it is automatically resolved once the transaction is killed. Consider killing the long-running session if it is impacting the database performance. 
    2. Increase vcores to get more TempDB space.
    3. Design your transactions to be as short lived as possible.
      4. If multiple queries are consuming tempdb space concurrently, consider serializing the workloads.

     Below snippet taken from Resolve tempdb-related errors in Azure SQL Database - Microsoft Community Hub

     User's image

    Please refer this document to find more information on troubleshooting issues of Managed Instance Tempdb Azure SQL DB and Managed Instance tempdb - Microsoft Tech Community

    Hope this helps!

    Thank you!

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.