Azure SQL DB Autoscaling issue

MoTaar 290 Reputation points
2024-04-17T15:38:07.7833333+00:00

Hello,

I'm currently facing an issue with automating the scale up/down of my Azure SQL DB. When the DB experiences high DTU usage and the auto scale-up is triggered by an alert runbook, the query that was running on the DB gets interrupted, causing my website to go down. Do you have any solutions for this?

Thanks.

Azure SQL Database
{count} votes

2 answers

Sort by: Most helpful
  1. Alberto Morillo 32,886 Reputation points MVP
    2024-04-17T17:53:14.0633333+00:00

    Transactions opened at the time the change of tier is started, they will be rolled back. Logins connected to the database will be disconnected. Contained database users will stay connected. Make sure your application is getting connected with a contained database user.

    Query plans may vary after scaling up/down because the number of threads available for query changes, and the data cache and query cache will be cleared. This means when queries are executed the first time after scaling up or down, they may show poor performance and some timeouts may occur until data is uploaded to memory again.

    When the database is facing high DTU usage, you may also face connection timeouts.


  2. Oury Ba-MSFT 16,241 Reputation points Microsoft Employee
    2024-04-22T17:55:30.33+00:00

    @MoTaar

    I have checked this internally and seems like this is expected and documented behavior. For details including mitigation steps, see https://learn.microsoft.com/en-us/azure/azure-sql/database/scale-resources?view=azuresql#impact-of-scale-up-or-scale-down-operations.

    Hope that helps also.

    Regards,

    Oury

    0 comments No comments