@kleegeek davidklee.net heraflux.com linkedin.com/in/davidaklee Specialties / Focus Areas / Passions: Virtualization & Cloud Performance Tuning Business Continuity Infrastructure Architecture Health & Efficiency Capacity Management Founder & Technical Exorcist Heraflux Technologies 2 redistribute or copy as your own. 1
All Cloud Hybrid In Planning No Way Heraflux Technologies 3 Application SQL Server DB SQL Server Instance Someone else s problem? Maybe Interconnects Operating System Virtualization Physical Server Storage Networking Heraflux Technologies 8 redistribute or copy as your own. 2
( plus automation ) Heraflux Technologies 9 (My personal pick because they uhh own the code.) Heraflux Technologies 10 redistribute or copy as your own. 3
IaaS? DBaaS? AaaS? QaaS? PaaS? ZaaS? Heraflux Technologies 11 Azure SQL DB Application Pros No instance to manage No OS to manage Straightforward HA + DR options Cons Single database No cross database calls No SQL Agent Alternative job schedulers exist Interconnects SQL Server DB SQL Server Instance Operating System Virtualization Physical Server Storage Networking Heraflux Technologies 12 redistribute or copy as your own. 4
Azure SQL Managed Instances ( in public preview ) Pros Full SQL Server instance Cross database calls SQL Agent HA + DR options? Cons Less flexibility External dependencies won t work HA + DR options? Backups? Interconnects Application SQL Server DB SQL Server Instance Operating System Virtualization Physical Server Storage Networking Heraflux Technologies 13 Azure VM + SQL Server Application Pros Full flexibility Maximum customization Cons You patch Windows You patch SQL Server You manage HA You manage DR You manage backups Interconnects SQL Server DB SQL Server Instance Operating System Virtualization Physical Server Storage Networking Heraflux Technologies 14 redistribute or copy as your own. 5
What platform works best for you? DBaaS Instance aas VMaaS On prem? DBAs work with Infra Admins Selection of platform depends on DB requirements Once you pick the platform Then you pick the SCALE Heraflux Technologies 15 (Img src: https://auto.ndtv.com/lamborghini cars/aventador s) (Img src: https://www.tesla.com/model3 Heraflux Technologies 16 redistribute or copy as your own. 6
Cloud claims: pay for consumption Not true for most cloud services Reality: pay by allocation Allocate what you need Heraflux Technologies 17 What do you need? CPU RAM Storage space Storage SPEED More flexibility as approach VM YOU have to define this, not a sysadmin Do you have a resource consumption baseline? Low granularity averages ARE NOT ACCURATE Heraflux Technologies 18 redistribute or copy as your own. 7
I have 32 CPUs! It s still slow! 6% CPU consumption average? Heraflux Technologies 19 Heraflux Technologies 20 redistribute or copy as your own. 8
Collect raw data first Perfmon how to guide Download at hfxte.ch/perfmon 30 second interval Export to CSV (relog) Review trends Or use other third party tools Heraflux Technologies 21 PowerShell Loader for Perfmon Files into SQL Server http://hfxte.ch/perfmonposh Heraflux Technologies 22 redistribute or copy as your own. 9
CPU by Core Five Minute Mon Fri Baseline 60 50 40 % CPU Consumption 30 20 10 0 00:00 00:20 00:40 01:00 01:20 01:40 02:00 02:20 02:40 03:00 03:20 03:40 04:00 04:20 04:40 05:00 05:20 05:40 06:00 06:20 06:40 07:00 07:20 07:40 08:00 08:20 08:40 09:00 09:20 09:40 10:00 10:20 10:40 11:00 11:20 11:40 12:00 12:20 12:40 13:00 13:20 13:40 14:00 14:20 14:40 15:00 15:20 15:40 16:00 16:20 16:40 17:00 17:20 17:40 18:00 18:20 18:40 19:00 19:20 19:40 20:00 20:20 20:40 21:00 21:20 21:40 22:00 22:20 22:40 23:00 23:20 23:40 Time of Day (Avg) CPU00 CPU01 CPU02 CPU03 CPU04 CPU05 CPU06 CPU07 Heraflux Technologies 23 60 8 Core CPU Percentile Baseline (15 min) 50 40 % CPU Consumption 30 20 10 0 00:00 00:30 01:00 01:30 02:00 02:30 03:00 03:30 04:00 04:30 05:00 05:30 06:00 06:30 07:00 07:30 08:00 08:30 09:00 09:30 10:00 10:30 11:00 11:30 12:00 12:30 13:00 13:30 14:00 14:30 15:00 15:30 16:00 16:30 17:00 17:30 18:00 18:30 19:00 19:30 20:00 20:30 21:00 21:30 22:00 22:30 23:00 23:30 Hour of Day (Avg) MinCPUConsumption AvgCPUConsumption CPU50th CPU95th CPU99th MaxCPUConsumption Heraflux Technologies 24 redistribute or copy as your own. 10
Server had 8 vcpus Business hours Mon Fri or 24x7? Used no more than 50% at absolute max Used no more than 40% at 95 th percentile Aggressive = 4 vcpus Conservative = 6 vcpus 2 vcpus not paying for! 25% price reduction immediately Heraflux Technologies 25 Less choices in cloud Some services allow CPU count selection Other services have more abstract scale Azure SQL DB DTU What the heck is a DTU? Heraflux Technologies 26 redistribute or copy as your own. 11
Memory means Buffer Pool Buffer Pool is just that I/O Buffer Assumption RAM is faster than storage Working data in RAM, or flush to disk Low RAM = High I/O consumption? High RAM = Low I/O consumption? Premium SSD storage is quite fast What is your memory consumption? Heraflux Technologies 27 12000 Memory Pages sec Percentile 10000 8000 Pages per sec 6000 4000 2000 0 Time of Day (Avg) MinPerfConsumption AvgPerfConsumption PerfConsumption50th PerfConsumption95th PerfConsumption99th MaxPerfConsumption Heraflux Technologies 28 redistribute or copy as your own. 12
Buffer Cache Hit Ratio Page Life Expectancy 101 16000 100 14000 99 12000 98 10000 97 96 95 94 93 00:00 00:45 01:30 02:15 03:00 03:45 04:30 05:15 06:00 06:45 07:30 08:15 09:00 09:45 10:30 11:15 12:00 12:45 13:30 14:15 15:00 15:45 16:30 17:15 18:00 18:45 19:30 20:15 21:00 21:45 22:30 23:15 Value Value 8000 6000 4000 2000 0 00:00 00:45 01:30 02:15 03:00 03:45 04:30 05:15 06:00 06:45 07:30 08:15 09:00 09:45 10:30 11:15 12:00 12:45 13:30 14:15 15:00 15:45 16:30 17:15 18:00 18:45 19:30 20:15 21:00 21:45 22:30 23:15 Time of Day (Avg) Time of Day (Avg) ValMin Val25th ValAvg Val50th Val95th Val96th ValMin Val25th ValAvg Val50th Val95th Val96th Val97th Val98th Val99th Val99_9th ValMax Val97th Val98th Val99th Val99_9th ValMax Heraflux Technologies 29 Low latency = SSD (Premium storage) IOPs critical IOPs x NTFS block size = Throughput (MB/s) Cloud provisioned storage has IOPs limits Some have throughput limits too What are you consuming today? Heraflux Technologies 30 redistribute or copy as your own. 13
Physical Disk Read IOPs Physical Disk Write IOPs 1000 600 900 800 500 700 400 600 IOPs 500 IOPs 300 400 300 200 200 100 100 0 0 00:00 00:40 01:20 02:00 02:40 03:20 04:00 04:40 05:20 06:00 06:40 07:20 08:00 08:40 09:20 10:00 10:40 11:20 12:00 12:40 13:20 14:00 14:40 15:20 16:00 16:40 17:20 18:00 18:40 19:20 20:00 20:40 21:20 22:00 22:40 23:20 00:00 00:40 01:20 02:00 02:40 03:20 04:00 04:40 05:20 06:00 06:40 07:20 08:00 08:40 09:20 10:00 10:40 11:20 12:00 12:40 13:20 14:00 14:40 15:20 16:00 16:40 17:20 18:00 18:40 19:20 20:00 20:40 21:20 22:00 22:40 23:20 Hour of Day (Avg) Hour of Day (Avg) MP0c MP1s MP1t MP2e MP2k MP2t MP3e MP0c MP1s MP1t MP2e MP2k MP2t MP3e MP3k MP3t MP4e MP4k MP4s MP4t MP3k MP3t MP4e MP4k MP4s MP4t Heraflux Technologies 31 Single drives have IOPs / throughput limits Scaling up speed is costly if you don t need the space DBaaS / Instance aas Less choice VMs Windows Storage Spaces Bundle multiple smaller disks together for faster performance and lower costs Heraflux Technologies 32 redistribute or copy as your own. 14
Some things you can scale easily CPU / RAM One short outage and done! Storage is harder Usually means new storage + DB / file migration Longer outage Plan for speed and capacity, not just capacity Heraflux Technologies 33 You must determine resource allocations Saving your company $$ makes you a hero Many platform choices DBaaS / Instance aas / VMaaS With SQL Server pay by allocation, not consumption So allocate just what you need! Leave just enough headroom Scale as needed Heraflux Technologies 34 redistribute or copy as your own. 15
Heraflux Technologies 35 redistribute or copy as your own. 16