Windows Performance Troubleshooting and Analysis

Slides:



Advertisements
Similar presentations
Performance Testing - Kanwalpreet Singh.
Advertisements

MCTS GUIDE TO MICROSOFT WINDOWS 7 Chapter 10 Performance Tuning.
How to use Sysinternals tools to troubleshoot SharePoint/Office
© Neeraj Suri EU-NSF ICT March 2006 Budapesti Műszaki és Gazdaságtudományi Egyetem Méréstechnika és Információs Rendszerek Tanszék Zoltán Micskei
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 2: Computer-System Structures Computer System Operation I/O Structure Storage.
CMPT 300: Operating Systems I Dr. Mohamed Hefeeda
Hands-On Microsoft Windows Server 2003 Administration Chapter 10 Monitoring and Troubleshooting Windows Server 2003.
Figure 2.8 Compiler phases Compiling. Figure 2.9 Object module Linking.
1 School of Computing Science Simon Fraser University CMPT 300: Operating Systems I Dr. Mohamed Hefeeda.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 2: Computer-System Structures Computer System Operation I/O Structure Storage.
Page 1 Processes and Threads Chapter Processes 2.2 Threads 2.3 Interprocess communication 2.4 Classical IPC problems 2.5 Scheduling.
Chapter 14 Chapter 14: Server Monitoring and Optimization.
Introduction to Operating Systems – Windows process and thread management In this lecture we will cover Threads and processes in Windows Thread priority.
Home: Phones OFF Please Unix Kernel Parminder Singh Kang Home:
Threads CS 416: Operating Systems Design, Spring 2001 Department of Computer Science Rutgers University
Maintaining and Updating Windows Server 2008
Hands-On Microsoft Windows Server 2008 Chapter 11 Server and Network Monitoring.
CH 13 Server and Network Monitoring. Hands-On Microsoft Windows Server Objectives Understand the importance of server monitoring Monitor server.
Windows Server 2008 Chapter 11 Last Update
70-290: MCSE Guide to Managing a Microsoft Windows Server 2003 Environment, Enhanced Chapter 12: Managing and Implementing Backups and Disaster Recovery.
Budapesti Műszaki és Gazdaságtudományi Egyetem Méréstechnika és Információs Rendszerek Tanszék Scheduling in Windows Zoltan Micskei
Chapter 3 Operating Systems Introduction to CS 1 st Semester, 2015 Sanghyun Park.
Chapter 8 Windows Outline Programming Windows 2000 System structure Processes and threads in Windows 2000 Memory management The Windows 2000 file.
Introduction to HP LoadRunner Getting Familiar with LoadRunner >>>>>>>>>>>>>>>>>>>>>>
MCTS Guide to Microsoft Windows Vista Chapter 11 Performance Tuning.
MCTS Guide to Microsoft Windows 7
Protection and the Kernel: Mode, Space, and Context.
70-290: MCSE Guide to Managing a Microsoft Windows Server 2003 Environment, Enhanced Chapter 2: Managing Hardware Devices.
Chapter 2: Computer-System Structures
Operating Systems Lecture 2 Processes and Threads Adapted from Operating Systems Lecture Notes, Copyright 1997 Martin C. Rinard. Zhiqing Liu School of.
1 Chapter 2: Computer-System Structures  Computer System Operation  I/O Structure  Storage Structure  Storage Hierarchy  Hardware Protection  General.
®® Microsoft Windows 7 for Power Users Tutorial 9 Evaluating System Performance.
Windows 2000 Course Summary Computing Department, Lancaster University, UK.
Lecture 3 Process Concepts. What is a Process? A process is the dynamic execution context of an executing program. Several processes may run concurrently,
Slide 3-1 Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 3.
Windows Crash Dump Analysis Daniel Pearson David Solomon Expert Seminars.
CH 13 Server and Network Monitoring. Hands-On Microsoft Windows Server Objectives Understand the importance of server monitoring Monitor server.
We will focus on operating system concepts What does it do? How is it implemented? Apply to Windows, Linux, Unix, Solaris, Mac OS X. Will discuss differences.
CE Operating Systems Lecture 2 Low level hardware support for operating systems.
1 Computer Systems II Introduction to Processes. 2 First Two Major Computer System Evolution Steps Led to the idea of multiprogramming (multiple concurrent.
The Million Point PI System – PI Server 3.4 The Million Point PI System PI Server 3.4 Jon Peterson Rulik Perla Denis Vacher.
CE Operating Systems Lecture 2 Low level hardware support for operating systems.
Daniel Pearson David Solomon Expert Seminars SVR311.
Windows Operating System Internals - by David A. Solomon and Mark E. Russinovich with Andreas Polze Unit OS3: Concurrency 3.3. Advanced Windows Synchronization.
Chapter 2 Process Management. 2 Objectives After finish this chapter, you will understand: the concept of a process. the process life cycle. process states.
Time Management.  Time management is concerned with OS facilities and services which measure real time.  These services include:  Keeping track of.
Embedded Real-Time Systems Processing interrupts Lecturer Department University.
1 Chapter 2: Operating-System Structures Services Interface provided to users & programmers –System calls (programmer access) –User level access to system.
SQL Database Management
Chapter 2: Computer-System Structures(Hardware)
Chapter 2: Computer-System Structures
Chapter Objectives In this chapter, you will learn:
Processes and threads.
CS 6560: Operating Systems Design
Hands-On Microsoft Windows Server 2008
Unit OS4: Scheduling and Dispatch
Unit OS2: Operating System Principles
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 2: Computer-System Structures Computer System Operation I/O Structure Storage.
Maximizing Windows 7 Performance: Troubleshooting Tips
Computer-System Architecture
Module 2: Computer-System Structures
Lecture Topics: 11/1 General Operating System Concepts Processes
Unit OS5: Memory Management
CSE 451: Operating Systems Autumn 2003 Lecture 2 Architectural Support for Operating Systems Hank Levy 596 Allen Center 1.
Module 2: Computer-System Structures
CSE 451: Operating Systems Winter 2003 Lecture 2 Architectural Support for Operating Systems Hank Levy 412 Sieg Hall 1.
Chapter 2: Computer-System Structures
Chapter 2: Computer-System Structures
Module 2: Computer-System Structures
Presentation transcript:

Windows Performance Troubleshooting and Analysis Daniel Pearson David Solomon Expert Seminars

Daniel Pearson Started working with Windows NT 3.51 Three years at Digital Equipment Corporation Supporting Intel and Alpha systems running Windows NT Seven years at Microsoft Senior Escalation Lead in Windows base team Worked in the Mobile Internet sustained engineering team Instructor for David Solomon, co-author of the Windows Internals book series

Agenda Components of performance analysis Understanding the tools for troubleshooting and analyzing performance issues Troubleshooting CPU and memory issues using various Windows tools Portions of this session are based on material developed by Mark Russinovich and David Solomon

Components of Performance Analysis Event Tracing for Windows Core component of the operating system Kernel mode data structures Used to store information about the system and system objects that can be read by various tools e.g. dt nt!_KTHREAD KernelTime CPU performance monitoring events Refer to the Intel 64 and IA-32 Architectures Software Developer’s Manual http://developer.intel.com/products/processor/manuals

Event Tracing for Windows Built in to the system High performance, low overhead and scalable 2.5% CPU usage for a sustained rate of 10,000 events/sec on a 2 GHz CPU1 Operations throughout the system that are of interest to performance are fully instrumented e.g. process and thread activity, registry I/O, disk I/O Milirud, Michael. 2008. Windows Performance Analysis: Using Windows Performance Tools. Presented at Microsoft's WinHEC conference, November 5-7, Los Angeles, CA.

Event Tracing for Windows Uses a buffering and logging mechanism implemented in the kernel Per-processor buffers that are written to disk by an asynchronous writer thread Ability to enable and disable tracing dynamically Supports a managed code provider

Sysinternals Utilities

Sysinternals Utilities Process Explorer Useful for displaying which files, registry keys and other objects processes have open and which DLLs they have loaded Process Monitor Useful for showing real-time file system, registry and process & thread activity Available for download from the TechNet site http://technet.microsoft.com/sysinternals

Resource Monitor

Resource Monitor Included with Windows Vista and greatly enhanced in Windows 7 and Windows Server 2008 R2 Allows the viewing of CPU, memory, disk and network resources as well as handles and modules in real time Ability to end, suspend and resume processes as well as to start, stop and restart Windows services Useful for identifying the highest resource consumers by individual resource type, e.g. CPU Able to list the wait chain tree of a process to determine if a process is waiting on another

Using Resource Monitor

Performance Monitor

Performance Monitor Queries performance counters that measure system state or activity Current values are read at specific intervals Performance counters are included in the operating system and can be included as part of applications Able to collect event trace data from trace providers that report actions or events Can combine multiple trace providers into a single session Configuration information can be collected from registry keys at a specific time or interval

Using Performance Monitor

Windows Performance Analyzer

Windows Performance Analyzer Part of the Windows Performance Toolkit Support for both x86, x64, and IA64 architectures Consists of three primary programs xperf.exe Used for controlling tracing and processing trace data xbootmgr.exe Automates on and off state transitions and captures traces during those transitions xperfview.exe A graphical trace visualization tool to represent data in the form of interactive graphs and summary tables

Windows Performance Analyzer Primarily uses the Event Tracing for Windows infrastructure built in to the system Can be enabled or disabled at any time without requiring a system or process restart Supports symbol decoding, sample profiling, and recording of call stacks on kernel events Designed to be used during automation All the functions of the tools are available via the command line tool xperf.exe

Support for Earlier Systems The Windows Performance Toolkit will fail to install on Windows XP and on Windows Server 2003 although data collection is supported Copy xperf.exe and perfctrl.dll Trace analysis is only supported on Windows Vista and later systems

Capturing a Performance Trace Kernel options divided into two parts Kernel Flags Identified by the use of uppercase characters e.g. PROC_THREAD, LOADER, PROFILE Kernel Groups Indentified by the use of title case characters e.g. Base, Diag, Latency, FileIO Kernel Groups are made up of a collection of Kernel Flags e.g. SysProf = PROC_THREAD+LOADER+PROFILE Flags and groups are separated by the ‘+’ token e.g. xperf.exe -on FileIO+DISK_IO_INIT

Merging of Performance Trace Data Traces can be copied to another system for analysis The trace file should be “merged” on the collection system before analysis to include additional system information xperf -d trace.etl System and symbol information Trace Merged trace Kernel trace XPerf

Using the Windows Performance Toolkit

Understanding CPU Activity Windows uses 32 priority levels The system implements a preemptive, priority driven scheduler Priority adjustments can be applied to threads in the “dynamic” range At least one runnable thread with the highest priority will be running 31 Real time 16 15 Dynamic

Context Switching A switch from one thread to another is known as a context switch Switching involves saving the hardware state of a thread and restoring the state of another When a thread is scheduled, that thread’s context switch count is also incremented The context switch count represents how often a thread begins running, not how long it ran

Time Accounting Quirks Looking at total CPU time for each process may not reveal where the system has spent its time CPU time accounting is driven by an interrupt timer which is set by the Hardware Abstraction Layer Usually at either 10 or 15 msec intervals Thread execution and context switches that happen between clock intervals are not accounted for e.g. a thread runs and enters a wait before the clock fires Thus threads may run but never get charged

Time Accounting Prior to Windows Vista Windows accounted for CPU time based on the interval clock timer Thread quantum expiration was not always fair A thread might get almost no turn Threads were also charged for interrupts that occurred while they were running Idle Idle T1 T2 T2

Time Accounting Since Windows Vista Windows Vista and later reads the Time Stamp Counter during every context switch The actual CPU cycles consumed are charged to a thread Any interrupt time is not charged to the interrupted thread Allows for more accurate quantum accounting A thread gets at least one turn and at most will be given one turn plus an additional tick Idle Idle T1 T1 T2

Troubleshooting High CPU Utilization

Understanding Memory Management Windows provides two system memory pools Nonpaged Pool and Paged Pool Used for system wide persistent data Prior to Windows Vista, pool sizes were a function of memory size and whether or not the system was configured as a server or a workstation Windows Vista introduced the concept of a dynamic system address space

Dynamic System Address Space In 32-bit Windows Vista and later, virtual memory is assigned as needed Permits larger paged, nonpaged, and session pools Components still cannot exceed 2 GB on 32-bit systems On 64-bit systems, address space regions are configured to their current maximum limits for all memory sizes

Troubleshooting Memory Leaks

Additional Information Windows Internals 5th edition Windows Performance Analysis Developer Center http://msdn.microsoft.com/performance Windows Server Performance Team Blog http://blogs.technet.com/winserverperformance Ask the Performance Team Blog http://blogs.technet.com/askperf

Additional Information David Solomon Expert Seminars offers training on Windows Internals both as public and private workshops and public webinars via the Internet Currently scheduled up and coming classes Public workshop in London, April 12th – April 16th Public webinar, April 26th & April 28th Public workshop in New York, May 3rd – May 7th Public workshop in San Francisco, November 8th – November 12th Visit http://www.solsem.com for further course descriptions and up to date information