queezing op Performance from your Virtualized QL erver David lee, Group Principal and Practice Lead riangle QL erver Users Group, November 19 2014 1
You know us individually, but do you know Linchpin People? Linchpin People are database coaches and wellness experts for the Microsoft QL erver Ecosystem. Our team includes more than 15 of the world s top QL erver experts, and we have presented over 175 combined sessions at QL aturdays, P ummit, and other events in the past year. Do you have specific questions about your database environment? Check out www.linchpinpeople.comand take a look at the range of services we provide, or contact one of us today to learn how we can help improve your business. 2
David lee Group Principal and Practice Lead @kleegeek davidklee.net gplus.to/kleegeek linked.com/a/davidaklee pecialties / Focus reas / Passions: Performance uning & roubleshooting Virtualization Cloud Enablement Infrastructure rchitecture High vailability Disaster Recovery Health Monitoring Capacity Management Data Processing 3
genda What does Virtualization Mean for DBs? Environmental Design & Performance Impact QL erver Virtual Machine Construction Demo uned versus Non-uned Performance Real-World Performance illers (and How to Fix hem) 4
Virtualization What Is It? Why hould DBs Care? 5
What is Virtualization? dded layer between hardware and operating system Hardware treated as physical resource queues Extension of the hardware, so is treated as part of the platform Not just P2Ving a single server Most DB s virtualization experience Virtualization layer is transparent to performance Expect at least equivalent raw performance (when done right) 6
Hypervisor Options (Q3 2013) ware vphere 5.5 Microsoft Hyper-V 2012 R2 Cost of the hypervisor and management suite is irrelevant when compared to QL erver licensing. 7
Environment Underneath Your Data 8
Physical Environment Model Local Disks (O, Instance Home) QL erver QL erver B QL erver C 9
Virtualization (Private Cloud) Model VIRULIZION 10
Logical Environment Model 16 vcpu 128 GB vrm 8 vcpu 64 GB vrm 2 vcpu 16 GB vrm 2 vcpu 16 GB vrm 2 vcpu 16 GB vrm 2 vcpu 16 GB vrm 2 vcpu 16 GB vrm 2 vcpu 16 GB vrm V I R U L I Z I O N 150 GHz CPU 4 B Memory 4x10GbE Network 20 B ier 1 torage 40 B ier 2 torage 11
Virtualization: hen and Now Virtualization s historical draw is hardware consolidation Performance of virtualized critical systems is number one concern Consolidation ratios are secondary (but a close second) Resource contention levels determine consolidation ratio Resource contention leads to silent QL erver performance penalties You can improve all of this! 12
Configuration op to Bottom Performance 13
Host -Physical erver Fastest CPU cores vs. core count Maximize host memory capacity But ensure maximum memory performance (i.e. http://tinyurl.com/hpmemoryperf) Configuration tips: et O-controlled CPU power management Enable CPU virtualization extensions Plan for no memory overcommitment Plan for no more than 80% resource consumption 14
Host Cluster Enable automatic cluster-wide load balancing ware DR / Hyper-V Performance and Resource Optimization V I R U L I Z I O N 30% 95% 35% 25% 30% 25% 65% Host Resource Utilization N Disk Pool 15
(hared) torage Configuration ypes of storage Local torage (not recommended) Fibre Channel IP-Based (MB, ici, NF) ingle points of failure Multipath all paths RID ypes / Controller cache ware: PVCI torage Presentation: iered storage Performance Benchmark all your storage Microsoft QLIO (http://tinyurl.com/mssqlio) IOMeter(http://iometer.org) CrystalDiskMark (http://crystalmark.info) Metrics to collect: hroughput (MB/s) I/OsPer econd (IOps) Latency (ms) 16
One Lane Highways vs. Interstate torage performance bottleneck potential Get fastest possible! Get most possible! Multi-pathing configuration & software Vendor-recommended HB queue depth settings Verify and test end-to-end performance Use iperf to test network throughput bit.ly/1edcybi 17
Construction Performance-Oriented From Day One 18
Resource llocations (Maximums) ware vphere 5.5 128 vcpus per 2B vrm per 120 virtual machine disks (D / RDMv) @ 62B each 120 raw device mapped disks (RDMp) @ 64B each Guest NUM extensions Microsoft Hyper-V 2012 R2 64 vcpus per 1B vrm per 256 virtual hard drives (VHDX) @ 64B each 256 Passthrough disks @ 256B+ each Guest NUM extensions 19
Virtual Machine Configuration elect correct operating system Correct vcpu vnum configuration ppropriate vrm allocation Full memory reservation (Dynamic Memory?) CPU & RM O-level hot-add -> No vnum Use virtual disks whenever possible Right-ized virtual machine resources 20
Right-izing the Virtual Machine Right amount of vcpu and vrm resources Physical world = ize for requirements at end of life Virtual world = ize for your requirements right now ll resources must be scheduled by the hypervisor s resource queues Idle vcpus can actually slowapplication performance of all s on the host How to right-size? nalyze performance baselines and determine what you need Repeat right-sizing analysis quarterly 21
CPU cheduling 16 vcpu 128 GB vrm 8 vcpu 64 GB vrm 2 vcpu 16 GB vrm 2 vcpu 16 GB vrm 2 vcpu 16 GB vrm 2 vcpu 16 GB vrm 2 vcpu 16 GB vrm 2 vcpu 16 GB vrm V I R U L I Z I O N (wo sockets, eight cores, no H) 22 CPU Ready to Run cheduling Queue
ware vcpu Ready ime vcpu Ready ime = Delay between vcpu task queue entry and execution of the task on a pcpu Performance impact of high vcpu Ready ime at http://tinyurl.com/ kleecpuovercommit 23
Hyper-V CPU Wait ime Equivalent to ware vcpu Ready ime Hyper-V 2012 and above Perfmon counter: Hyper-V Hypervisor\Virtual Processor\CPU Wait ime Per Dispatch Jonathan ehayias writeup: http://tinyurl.com/cpureadyhyperv 24
Virtual Machine Configuration -Disks Disk Layout C:-Operating ystem D:-QL erver Instance Home E:-ystem Databases (master, model, msdb) * F:-User Database Data (1 of X) G:-User Database Log (1 of Y) H:-empDB Y: -Windows Page file ** Z:-Backups 25
Virtual Disk Placement User Data 1 empdb ier 1 Disk Pool (D) User Data 2 User Logs 1 Instance Home, ystem DBs ier 2 Disk Pool (FC/) Big Fancy & Expensive N 26 User Data 3 Operating ystem Backups ier 3 Disk Pool ()
Windows erver O et power settings to High Performance (CPU-Z) 64B NF allocation unit size et antivirus exclusions for QL erver (http://tinyurl.com/sqlav) Background applications & processes Ongoing O-level performance metric collection No greater than five minute interval 24 x 7, not just as-needed Windows Perfmon, Microsoft COM, or any other thirdparty utility 27
Instance-Level Configuration et Max and Min erver Memory Leave enough headroom for O & background processes Enable Lock Pages in Memory Enable Instant File Initialization et MaxDOP= vnum node core count Cost threshold for parallelism = Not default Large Pages (understand pros and cons) empdb data file count Optimize for d-hoc Workloads 28
Benchmarks Demonstrate Raw Performance 29
Performance Benchmarks and Baselines he demonstration of performance is largely subjective Until you make it objective through benchmark metrics Must benchmark (and then create baseline): Each component of infrastructure underneath O QL erver Instance itself Long running tasks / jobs / queries nything else you can measure that matters to your users ools for benchmark statistics collection Perfmon / COM / ware vcenter QL erver DMOs LOD of third-party tools Monitoring and alerting 30
Instance Benchmark Utility -DVDtore Open source database server benchmarking tool ingle number output for relative instance-level performance comparisons Orders placed per test vailable from http://linux.dell.com/dvdstore How-to at http://tinyurl.com/kleedvdstore 31
Performance Demo: uned vs. Non-uned s 32
DVDtore Performance Comparisons 2 vocketx 3 vcpu Core (+ vnum) 32GB vrm uned Multiple virtual disks with PVCI 50GB DVDtore database ll best practices applied 128 worker threads (2 tests x 64 t) pproximately 52% CPU utilized 774,925 combined orders placed in 60 min Not uned 6 vocketx 1 vcore(default) 32 GB vrm One large virtual disk Click-through QL erver install Had to reduce to 64 worker threads (connection timeout failures) pproximately 41% CPU utilized 538,164 combined orders placed in 60 minutes 31% slower than tuned 33
Conclusions Pick the hypervisor that best suits your environment Break down the silos around the infrastructure and application teams and work with them Understand your QL erver workloads Individual ggregate Validate target virtualization environment performance Virtualize everything Make sure you have your benchmarks to demonstrate equivalent performance Routinely check ongoing performance 34
Questions? @kleegeek davidklee.net gplus.to/kleegeek linked.com/a/davidaklee 35
hank You! 36