Determining an Appropriate Service Tier

As a SQL Server DBA, when migrating to an Azure SQL Database, you will need to have an initial estimate of DTUs so as to assign an appropriate Service tier to an Azure SQL Database. An appropriate Service Tier will ensure that you met most of your application performance goals. Estimating a lower or a higher Service tier will result in decreased performance or increased cost, respectively.

This chapter teaches you how to use the DTU calculator to make an appropriate initial estimate of the Service tier. You can, at any time, change your service tier by monitoring the Azure SQL Database performance once it's up and running.

Azure SQL Database DTU Calculator

Developed by Justin Henriksen, an Azure Solution Architect at Microsoft, the DTU Calculator can be used to find out the initial Service tier for an Azure SQL Database. The calculator is available at https://dtucalculator.azurewebsites.net.

DTU Calculator Work Flow

The DTU Calculator works as shown in the following diagram:

Azure SQL Database DTU Calculator

Figure 2.2: DTU Calculator Work Flow

First, you have to set up a trace to record the following counters for at least an hour:

  • Processor: % Processor Time
  • Logical Disk: Disk Reads/sec
  • Logical Disk: Disk Writes/sec
  • Database: Log Bytes Flushed/sec

You can run a trace by using either the command-line utility or the PowerShell script provided on the DTU Calculator website.

Capture the counters on a workload similar to that of the production environment. The trace generates a CSV report.

Note

These utilities capture the counters at the server level and not at the database level. To capture at the database level, use SQL Server DMVs.

The DTU Calculator uses this report to analyze and suggest an initial Service Tier.

Finding an Initial Service Tier for the Database to be Migrated using the DTU Calculator

Let’s get back to Mike. Mike is unsure about the service tier that he has to select while migrating to the Azure SQL Database. Hence, he wants to make use of the DTU Calculator to select the service tier to migrate to. The following steps describe how he can use the DTU Calculator to determine the initial service tier for his database:

  1. Open https://dtucalculator.azurewebsites.net and download the command-line utility to capture the performance counters.

    Note

    You can also open the file saved at C:CodeLesson02DTUCalculatorsql-perfmon-cl

    The sql-performance-cl folder has two files, SqlDtuPerfmon.exe and SqlDtuPerfmon.exe.config. The first one is the executable which, when run, will capture the counter in a csv file, and the second file is a configuration file that specifies the counters to be captured.

  2. Open SqlDtuPerfmon.exe.config in Notepad and make changes, as suggested in the following points:
    • Change the SQL Instance name to be monitored:
      Finding an Initial Service Tier for the Database to be Migrated using the DTU Calculator
    • Under the SQL COUNTER comment, modify the value of SqlCategory as per the instance name of your SQL Server.
    • If you are running on a default instance, then replace MSSQL$SQL2016:Databases with SQLServer:Databases.
    • If you are running on a named instance, say, Packtpub, then replace MSSQL$SQL2016:Databases with MSSQL$Packtpub:Databases.
    • Set the output file path:
      Finding an Initial Service Tier for the Database to be Migrated using the DTU Calculator
    • If you wish to change the output file, modify the value for the CsvPath key shown in the preceding screenshot.
    • You are now ready to capture the performance trace.
  3. Double click the C:CodeLesson02DTUCalculatorsql-perfmon-clSqlDtuPerfmon.exe file to run the performance trace.

    A new command prompt will appear and will display the counters as they are being monitored and saved into the CSV file.

    You should get a similar command-line window, as shown in the following screenshot:

    Finding an Initial Service Tier for the Database to be Migrated using the DTU Calculator
  4. The next step is to upload the output file on the DTU Calculator website and analyze the results. To do this, follow these steps:
    1. Open https://dtucalculator.azurewebsites.net/ and scroll down to the Upload the CSV file and Calculate section.
    2. In the Cores text box, enter the number of cores on the machine you ran SqlDtuPerfmon.exe on and capture the performance counters.
    3. Click Choose file and in the File Open Dialog box, select the C:CodeLesson02DTUCalculatorsql-perfmon-log.csv file.
    4. Click the Calculate button to upload and analyze the performance trace:
    Finding an Initial Service Tier for the Database to be Migrated using the DTU Calculator
  5. The DTU Calculator will analyze and then suggest the Service tier you should migrate your database to. It gives an overall recommendation and further breaks down the recommendation based on only CPU, I/O, and Logs utilization.

    Overall Recommendation

    The DTU Calculator suggests to migrate to Premium – P2 tier, as it will cover approximately 100% of the workload.

    You can hover your mouse over different areas of the chart to check what percent the workload of each tier covers:

    Finding an Initial Service Tier for the Database to be Migrated using the DTU Calculator

    Recommendation Based on CPU Utilization

    The calculator recommends Premium – P2 tier based on CPU utilization:

    Finding an Initial Service Tier for the Database to be Migrated using the DTU Calculator

    Recommendation Based on Iops Utilization

    Based solely on Iops utilization, the DTU Calculator suggests going for a Standard – S2 tier, which covers approximately 90% of the workload. However, it also mentions that approximately 10% of the workloads will require a higher service tier. Therefore, the decision lies with you; the Premium – P2 Service tier is costlier, however, it covers 100% of the workload. If we are okay with 10% of the workload performing slowly, we can choose the Standard – S2 service tier.

    Remember, this is an estimation of the Service Tier and you can at any time scale up to a higher Service Tier for improved performance:

    Finding an Initial Service Tier for the Database to be Migrated using the DTU Calculator

    Recommendation Based on Log Utilization

    Based solely on Log Utilization, the DTA Calculator recommends the Basic Service tier. However, it is also mentioned that approximately 11% of the workload requires a higher Server tier.

    At this point, you may start with the Basic Service Tier and then scale up as and when required. This will certainly save money. However, you should consider that the Basic Service allows only 30 concurrent connections and has a maximum database size limit of 2 GB:

    Finding an Initial Service Tier for the Database to be Migrated using the DTU Calculator
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.133.127.37