Migrated DB to SQL Azure very slow

  • Hi!

    I migrated a quite simple DB from SQL 2016 to SQL Azure PaaS.

    The app server using the DB is also in Azure, same location and RG.

    Now when running queries it is extremely slow. Both from the app server, and I also did a test creating 750000 rows:

    -onprem server: 5,38 min

    -SQL Azure: 42,27 min

    All the time the utilization of resources (CPU/IO) are very low (0-3%)

    • This topic was modified 3 years, 1 month ago by  niklasrene.
  • It's hard to say without a lot more data. Capture query metrics using extended events. Capture wait statistics (you can combine these with the query metrics using extended events so you can see waits per query). Look at the execution plans. All this will tell you what's going on with the Azure SQL Database instance.

    In general, you should see similar performance to your on premises systems, completely depending of course, on what kind of hardware you have locally, and what service tier you pick in Azure.

    "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

  • One other thing to look at would be bandwidth.  On-Prem, you may have a Gb ethernet connection between you and the server.  In the cloud, you may have reduced bandwidth.

    As an example, I currently work from home and pulling in data from a SQL instance is substantially slower than on-prem.  My work around is to RDP to an on-prem machine when I need to run big queries or want to do query tuning.  We run everything on-prem, but my internet at home is a LOT slower than what is offered at my workplace.

    The above is all just my opinion on what you should do. 
    As with all advice you find on a random internet forum - you shouldn't blindly follow it.  Always test on a test server to see if there is negative side effects before making changes to live!
    I recommend you NEVER run "random code" you found online on any system you care about UNLESS you understand and can verify the code OR you don't care if the code trashes your system.

Viewing 3 posts - 1 through 2 (of 2 total)

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