Presentation is loading. Please wait.

Presentation is loading. Please wait.

Optimizing SQL Server Performance in a Virtual Environment

Similar presentations


Presentation on theme: "Optimizing SQL Server Performance in a Virtual Environment"— Presentation transcript:

1 Optimizing SQL Server Performance in a Virtual Environment
Denny Cherry twitter.com/mrdenny

2 About Me Denny Cherry & Associates Consulting 6 books Dozens of articles Microsoft MVP Microsoft Certified Master VMware vExpert

3 Topics of Discussion Diagnosing Performance Problems
Balloon Memory Drivers Memory Deduplication Options Storage Configuration Options

4 Tuning Differences in T-SQL
Nope Nothing Nope Never Nada It’s all the same! No Zero Zip

5 Diagnosing Performance Problems
Check Host and Guest CPU numbers Check Host for CPU thrashing Check Host and Guest for Disk IO latency For Thrashing PerfMon in Hyper-V esxtop in v-Sphere %USED needs to be under 75% Use SCVMM or vCenter to look at historical trends for these numbers The storage is a very common place to see performance problems. If SQL Server is reporting slow IO via the DMVs or via the ERRORLOG file check IO latency numbers at the host and from the storage array. Look into auto-teiring options within the storage array to move hot portions of the disk to faster storage. Another option would be to use a dedicated LUN for the database instead of a shared LUN. The dedicated LUN could be connected to the guest via a Pass Through Disk in Hyper-V or a Raw Device Mapping in vSphere/ESX or via iSCSI directly to the guest. If the Hypervisor host has limited bandwidth to the storage array, using a single iSCSI connection over a single 1 Gig-E network connection for example additional network links / faster network links may be needed. Moving from iSCSI to fiber channel may be required do to the lower latencys of fiber channel compared to iSCSI. If iSCSI is being used review the network configuration to ensure that there are as few network devices between the server and the storage array as possible as each additional network device adds additional latency.

6 Balloon Memory Drivers
Used by host OS to request memory back from the guest OS Prevents host of from paging physical memory to the hosts swap file Should be enabled Lock pages in memory should be disabled, unless enabled for a specific reason Available in ESX 3.0+ Available in Windows Server 2008 R2 SP1+ Disabling the balloon drivers can cause memory pressure at the host level, which would be masked from the guest and cause performance issues.

7 Memory Reservations - VMware
Forces the memory to be available for the guest Recommended that it be set to a portion of the allocated memory For a sample machine with 64 Gigs of RAM, I’d recommend setting the memory reservation to Gigs (32 Gigs for SQL and 2-4 Gigs for Windows). This ensures that SQL will have enough memory in the event of a major system failure, to continue to function.

8 Memory Deduplication Options
Great for OS memory Unless… multiple SQL Servers have the same pages in cache Doesn’t work at all for SQL Server Native in ESX since 3.0 or older Introduced in Hyper-V in Server 2008 R2 SP1 Talk about what this process does, and why it’s so cool for other kinds of servers. Talk about why it is so useless for SQL Servers.

9 Storage Configuration Options
IO is the same if the disks are physical or virtual Use automatic tier adjusting technology if possible Keep OS, data, logs, tempdb on separate disks if possible VMDKs or vDisks only have a 1-2% performance penalty Spend some time talking about FAST / Compellent automatic tier adjusting technology FAST is available on CX4 running FLARE 34? Or newer DMX build FAST is available on all VNX and VPLEX arrays (for a cost) Also available on X-IO, 3PAR, etc. Not all automatic tiering platforms are the same. Some more data faster than others from one tier to another. Some more data is bigger slices than others. EMC for example started by moving data in 8 Gig slides, but now uses 1 Gig slices. If you are running an older version of the EMC software upgrading may be worth it to remove the size of the slices so that the data can be moved between the tiers faster and with greater granualary.

10 Storage Deduplication
Can greatly improve overall performance By deduplicating OS virtual disks, we save much less data to the array As less data is written to the array, less OS data is loaded into cache on the array Can increase risk of corruption Data LUNs can’t be deduped very well OS LUNs can be Most array’s do not support this as it is very CPU intensive Don’t forget to account for loss of deduplication as service packs and hot fixes are installed making files on different servers different

11 VMware Paravirtualization Driver
Optional Driver for vSphere Virtual Machines Recommended for high IO workloads Configured via VM Properties Select SCSI Controller Change Type

12 Monitor, Monitor, Monitor
Did I mention that you need to monitor Watch all levels of the environment SQL Server Guest Hypervisor Host Storage Use SCVMM or vCenter for long term trending Trust nothing If your storage vendor charges extra for the monitoring tool, pay for it. It is worth the cost Correlate Numbers Together

13 Some Perfmon Counters to Monitor
Reads & Writes / Sec Seconds / Read & Write Disk Queue Page Life Expectancy System Processor Queue VM Disk (VMware) VM Memory (VMware)

14 Thanks to our sponsors

15 Denny Cherry mrdenny@dcac.co www.dcac.co twitter.com/mrdenny

16 Thank for attending Singapore SQLSaturday#646!


Download ppt "Optimizing SQL Server Performance in a Virtual Environment"

Similar presentations


Ads by Google