Manohar Punna Azure Database Migration Choosing the Right Tier
Thank you to our sponsors:
Evaluations: Please complete the evaluation forms for each session you attend. You received these in your welcome pack first thing this morning from registration. Please put them in the evaluations box on your wait out after this session. There are evaluation prizes at the end of the day for completed evaluation forms.
Manohar Punna Blogger, Speaker, Mentor Community Enthusiast and Data Platform MVP. Microsoft Data Platform Consultant at LobsterPot Solutions. Authored One DMV a Day Series Wrote 80 blogs in 80 days. http://bit.ly/onedmvaday Website: www.manoharpunna.com Speaker at SQLBits, SSGAS, SQL Server Day, Data Platform Day, SQL Saturdays. President at DataPlatformGeeks Data Platform Summit 2017 - http://dataplatformgeeks.com/dps2017 @ManuSQLGeek
Agenda SQL Server on a VM - IaaS Azure SQL Database - PaaS Elastic Pools Service Tiers Resource Utilization Collections Choosing the Right Tier - Analysis
SQL Server on Microsoft Azure
SQL Server on a Azure VM - IaaS Features Infrastructure as a Service Hardware and OS maintained by Microsoft SQL Server license included BYOL Suitability Straight forward / hybrid migrations with minimal changes Resources to maintain the VM and SQL instance Highly customizable with full admin rights Highly suitable for enterprise and hybrid applications Customizable HA and DR solution
Azure SQL Database - PaaS Features Platform as a Service/ Database as a Service Hardware, OS and SQL administration maintained by Microsoft Automated backups, geo-redundancy Suitability Focus on application layer New applications, SaaS providers Up to 4 TB databases with scale-out option Single database / non OS dependent applications
Azure Managed Instance - PaaS Features Platform as a Service Hardware, OS and SQL administration maintained by Microsoft Automated backups, geo-redundancy Suitability List and shift. Introduced Database Migration Service to automate migration. Applications need Instance level features cross database querying, SQL Agent, SQL CLR etc. Currently in private preview.
Elastic Pools Limitation of SQL DB Over allocation / scattered usage of resources Monitoring challenges Elastic Pools Resources shared between multiple databases Limit resources for each database
Service Tiers Single Database Clear differentiation between different service tiers. Relatively easy to move between different service tiers. Tier Group Tier StartDTU EndDTU TierSort Basic B 0 5 1 Standard S0 5.01 10 2 Standard S1 10.01 20 3 Standard S2 20.01 50 4 Standard S3 50.01 100 5 Premium P1 100.01 125 6 Premium P2 125.01 250 7 Premium P4 250.01 500 8 Premium P6 500.01 1000 9 Premium P11 1000.01 1750 10 Premium P15 1750.01 4000 11
Service Tiers Elastic Pool Four service tiers with different DTU levels. Easy to change DTU levels in a pool Moving databases between tiers needs moving between pool ElasticTier start edtu end edtu Max DBs Max edtus / database Max storage price per hour Basic-0050 0 50 100 5 5 GB $0.14 Basic-0100 50.01 100 200 5 10 GB $0.28 Basic-0200 100.01 200 500 5 20 GB $0.57 Basic-0300 200.01 300 500 5 29 GB $0.85 Basic-0400 300.01 400 500 5 39 GB $1.13 Basic-0800 400.01 800 500 5 78 GB $2.28 Basic-1200 800.01 1200 500 5 117 GB $3.41 Basic-1600 1200.01 1600 500 5 156 GB $4.55 Standard-0050 0 50 100 50 50 GB $0.22 Standard-0100 50.01 100 200 100 100 GB $0.43 Standard-0200 100.01 200 500 100 200 GB $0.87 Standard-0300 200.01 300 500 100 300 GB $1.29 Standard-0400 300.01 400 500 100 400 GB $1.71 Standard-0800 400.01 800 500 100 800 GB $3.41 Standard-1200 800.01 1200 500 100 1.2 TB $5.12 Standard-1600 1200.01 1600 500 100 1.6 TB $6.84 Standard-2000 1600.01 2000 500 100 2.0 TB $8.55 Standard-2500 2000.01 2500 500 100 2.4 TB $10.69 Standard-3000 2500.01 3000 500 100 2.9 TB $12.82 Premium-0125 0 125 50 125 250 GB $1.32 Premium-0250 125.01 250 100 250 500 GB $2.64 Premium-0500 250.01 500 100 500 750 GB $5.29 Premium-1000 500.01 1000 100 1000 750 GB $10.58 Premium-1500 1000.01 1500 100 1000 750 GB $15.87 Premium-2000 1500.01 2000 100 1750 750 GB $21.16 Premium-2500 2000.01 2500 100 1750 750 GB $26.45 Premium-3000 2500.01 3000 100 1750 750 GB $31.73 Premium-3500 3000.01 3500 100 1750 750 GB $37.02 Premium-4000 3500.01 4000 100 4000 750 GB $42.32
DTU Calculator Perfmon counter collection Powershell and command line exe. CPU IOPS disk reads and writes Log Bytes Flushed Ideal for single database on single instance DTUs are calculated based on maximum of DTUs needed for each metric in a single set. (Max of DTU calculated for CPU or IOPS or Log Bytes Flushed)
DTU Calculator Collect CPU Database CPU usage CPU usage for each database cannot be tracked accurately. The closest is cumulative usage of CPU for the database from Glenn Berry s Diagnostic Queries. Collect average at regular intervals. For every second, collect at 5 sec interval and consider average for every 1 sec. Queries removed from cache. This is just the % out of total SQL Server CPU usage.
DTU Calculator Collect CPU Instance CPU usage Step 1 Process(sqlservr) - % Processor Time Sum of (% cpu on each core). Step 2 (Process(sqlservr) - % Processor Time)/No. of cores Multiple instances? Step 3 Sqlservr, sqlservr#1, sqlservr#2 Registry hack - KB 281884
DTU Calculator Collect IOPS Cumulative IO stats from sys.dm_io_virtual_file_stats Similar to CPU collect samples, get the difference and calculate the average across intervals.
DTU Calculator Collect Log Bytes Flushed/Sec Log Bytes Flushed counter - easiest to collect Databases Log Bytes Flushed/sec can be collected for each database.
DTU Calculator Reverse engineering on DTU Calculator Cores considered only for CPU DTUs Cores 1 2 4 6 8 10 12 14 16 DTU for 100% CPU 100 250 500 750 1000 1250 1500 1750 2000 Utilized CPU % 25 25 25 25 25 25 25 25 25 Calculated DTU 25 62.5 125 187.5 250 312.5 375 437.5 500 Log Bytes Flushed Basic 256 KB, Standard 1.3 MB Premium > 1.3 MB 1 DTU = (B)5 KB, (S)16 KB, (P)24 KB Log Bytes Flushed (MB) 3 6 12 18 24 30 36 42 48 DTU 125 250 500 750 1000 1250 1500 1750 2000 IOPS Basic 16, Standard 158, Premium > 158 1 DTU = (B)3.2, (S)Variable for standard(s0, S1, ), (P)12.8 IOPS 1600 3200 6400 9600 12800 16000 19200 22400 25600 DTU 125 250 500 750 1000 1250 1500 1750 2000
DTU Analysis The graphs from the DTU Calculator are basic Need more insights into the whole story. DEMO - Power BI to the rescue Three-sigma rule Normal distribution 68, 95, 99.7 Non-normal distribution 88.8 % fall in 3 standard deviations
The Real World Always rely on direct testing on Azure. Create a copy of the database in Azure IaaS or PaaS. Replay the workload using load and performance testing tools. Time vs Contention End of the day cost to migrate and run on Azure. Remember you still need someone who breathes data a Data Professional
Questions: Please make sure you visit our fantastic