280 likes | 567 Views
Hands-On Performance with the Windows Performance Toolkit . Erik Holt Senior Program Manager Lead Microsoft Corporation. Objectives. Learn how to analyze systems in production environments Learn about the Windows ® Performance Toolkit (WPT) Learn how to collect a performance trace
E N D
Hands-On Performance with the Windows Performance Toolkit Erik Holt Senior Program Manager Lead Microsoft Corporation
Objectives • Learn how to analyze systems in production environments • Learn about the Windows®Performance Toolkit (WPT) • Learn how to collect a performance trace • Learn how to perform basic analysis of a performance trace
Agenda • Why performance matters • Overview of the Windows Performance Toolkit • The basics of using the Windows Performance Toolkit • Case studies • Call to action • Resources
Why Great Performance Matters • Responsiveness • Unresponsive systems lead to customer dissatisfaction • Shared resources • Resources are limited and shared, so use them effectively • The whole picture matters: CPU, storage, memory, network, and power • “Good citizenship” • Just one bad component can reduce system performance • Lots of money and years are spent developing software; ensure that your component doesn’t degrade the experience
Competition for Resources • Applications, services, drivers, and the operating system compete for these resources • Processor time • Physical memory space and virtual address space • Disk service time and disk space • Network bandwidth • Battery power • Performance analysis starts with inspecting resources • Machine constraints = resource usage limits = user experience
Windows Performance Toolkit (WPT) • Official kit • Built and used by the Windows organization • Distributed in the Windows SDK • EULA allows the MSI to be redistributed • Wide support range • Supported on Windows Vista® and later on both client and server • Supported on x86, x64, and IA64 processor architectures • Contains a variety of performance analysis tools • WPA includes xPerf and xPerfView • Also includes GPUView and WPFPerf tools
Strategic Investment • Industry-wide OEM performance effort • Used in the Windows Logo Kit and in the Velocity toolkit • Used every day by the Windows engineering group to improve the performance of Windows components • Windows 7 performance work • Puts into practice the lessons learned from Windows Vista
What Is in the WPT? • xperf • Captures and processes traces • xperfview • Displays trace data • xbootmgr and xbootmgrsleep • Captures on/off transition traces • hwpower2etw • Converts test and data management software (TDMS) events to Windows event tracing logs (ETL) for analyzing power efficiency • symcachegen • Converts PDB files into symcache files
Windows Performance Analyzer (WPA) • Tools for capture, post-processing, and analysis • Very mature • 10+ years in development • 4th generation • Written in-house for Microsoft developers • Documented on MSDN • Very low overhead compared with other performance analysis tools
Why Use WPA? • Enables holistic performance analysis by analyzing: • All processes and threads in user mode and kernel mode • Deferred procedure calls (DPCs) and interrupt service requests (ISRs) • Scheduling • Disk and file I/O • Memory • Network • Helps analyze what the customer experiences • Catch the problem as it happens • Capture anywhere, decode anywhere
WPA Can Help Analyze Root Causes • Lack of responsiveness • Long delays in applications • High CPU usage • High disk usage • Slow on/off transitions • Poor battery life
How WPA Works 5. CLI trace analysis can be done via actions using xPerf. An XML file can also be produced 3. xPerf controls logging sessions and enables/disables providers to make an ETL file XML File 4. Metadata is gathered and injected when the trace capture is stopped xPerf ETW Event Providers ETW ETL File Merged ETL File ETW Session xPerfView 6. GUI trace analysis is done via graphs and summary tables built from the Merged ETL file in xPerfView 1. Any component that has been instrumented with the Event Tracing API can provide events System and Symbol Info 2. ETW contains a collection of configurable in-memory buffers
Why WPA Is Non-Intrusive • Event Tracing for Windows (ETW) makes WPA non-intrusive • ETW has been a core component since Windows 2000 • ETW has very low overhead • ~2.5% CPU usage for sustained rate of 10,000 events/sec on a 2GHz CPU
Comparison of WPA and Performance Monitor WPA Performance Monitor Ships in Windows Takes snapshots of the system state Used for long periods of time Based on performance counters Designed for long-term monitoring These are complementary technologies • Ships separately • Analyzes random events • Used for short periods of time • Based on ETW events • Designed for reactive analysis
New Features in WPT 4.8 • Search in summary tables • Memory analysis: pool, heap, CONTMEMGEN • Energy efficiency analysis • Disk idle analysis • Improvements to the CPU idle histogram analysis • Spinlock analysis • 256-processor support • Customizable summary table layout UI profiles • Selection-based filtering in summary tables
How to Get the WPT • Download from the Windows Performance Analysis Developer Centerhttp://msdn.microsoft.com/enus/performance/default.aspx
demo Performance Analyzer Preview
Summary of Disk Usage Case Study • Multiple components that work well in isolation can impact performance when executed in parallel • Disk contention dramatically impacts performance for all involved components • Disk seeks can cut throughput by 90% • Schedule all work that can wait as idle tasks • See “Task Scheduler” documentation on MSDN@ http://msdn.microsoft.com/enus/library/aa383614(VS.85).aspx
Summary of DPC Case Study • One bad component can disrupt numerous good components • High usage of any single resource can cause performance issues • Spending too much CPU time for DPCs impacts performance • Use Direct Memory Access (DMA) instead of Programmed I/O (PIO) when transferring data • See “DMA” on MSDN@ http://msdn.microsoft.com/en-us/library/aa447493.aspx
Best Practices • Make sure UI remains responsive • Let the user know what is happening and how long a requested action will take • Remember: A responsive UI helps customers stay satisfied with the product • Focus on resource utilization and efficiency • Use WPA to understand how the CPU, disk, memory, network, and battery are being used • Capture traces across entire user scenarios • Make sure your software practices good citizenship
Call to Action • Download the Windows Performance Toolkit • Invest in ETW instrumentation in your applications, drivers, and services • Visit Windows Performance Analysis Dev Center • Visit the WPT public forum and ask plenty of questions • Fill out the evaluation form for this presentation
Resources • Windows Performance Analysis Dev Centerhttp://msdn.microsoft.com/en-us/performance • Documentation about Event Tracing for Windowshttp://msdn2.microsoft.com/en-us/library/aa363787.aspx • Public forum for the WPThttp://social.msdn.microsoft.com/Forums/enUS/wptk_v4/threads • Windows Internals • For details, see “Event Tracing” on MSDNhttp://msdn.microsoft.com/enus/library/bb968803(VS.85).aspx
© 2010 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.