Copyright © 2003, SAS Institute Inc. All rights reserved. Where's Waldo Uncovering Hard-to-Find Application Killers Claire Cates SAS Institute, Inc

Slides:



Advertisements
Similar presentations
Paging: Design Issues. Readings r Silbershatz et al: ,
Advertisements

Intel® performance analyze tools Nikita Panov Idrisov Renat.
Segmentation and Paging Considerations
IT Systems Multiprocessor System EN230-1 Justin Champion C208 –
CMPT 300: Operating Systems I Dr. Mohamed Hefeeda
Operating Systems Parallel Systems (Now basic OS knowledge)
Processes CSCI 444/544 Operating Systems Fall 2008.
1 Lecture 6 Performance Measurement and Improvement.
1: Operating Systems Overview
Copyright © 1998 Wanda Kunkle Computer Organization 1 Chapter 2.1 Introduction.
Chapter 4 Assessing and Understanding Performance
Computer Organization and Architecture
Fall 2001CS 4471 Chapter 2: Performance CS 447 Jason Bakos.
Code Generation CS 480. Can be complex To do a good job of teaching about code generation I could easily spend ten weeks But, don’t have ten weeks, so.
Operating Systems (CSCI2413) Lecture 3 Processes phones off (please)
Operating System Organization
CS364 CH08 Operating System Support TECH Computer Science Operating System Overview Scheduling Memory Management Pentium II and PowerPC Memory Management.
Layers and Views of a Computer System Operating System Services Program creation Program execution Access to I/O devices Controlled access to files System.
Basics of Operating Systems March 4, 2001 Adapted from Operating Systems Lecture Notes, Copyright 1997 Martin C. Rinard.
1 1 Profiling & Optimization David Geldreich (DREAM)
ITEC 325 Lecture 29 Memory(6). Review P2 assigned Exam 2 next Friday Demand paging –Page faults –TLB intro.
Multi-core Programming Thread Profiler. 2 Tuning Threaded Code: Intel® Thread Profiler for Explicit Threads Topics Look at Intel® Thread Profiler features.
Review of Memory Management, Virtual Memory CS448.
Introduction and Overview Questions answered in this lecture: What is an operating system? How have operating systems evolved? Why study operating systems?
Process Management. Processes Process Concept Process Scheduling Operations on Processes Interprocess Communication Examples of IPC Systems Communication.
Operating Systems.
Analyzing parallel programs with Pin Moshe Bach, Mark Charney, Robert Cohn, Elena Demikhovsky, Tevi Devor, Kim Hazelwood, Aamer Jaleel, Chi- Keung Luk,
Recursion. What is recursion? Solving a problem in terms of itself or repeating objects in a “self-similar” way A recursive function is a function that.
Computing and the Web Operating Systems. Overview n What is an Operating System n Booting the Computer n User Interfaces n Files and File Management n.
Cosc 2150: Computer Organization Chapter 6, Part 2 Virtual Memory.
Copyright © 2013, SAS Institute Inc. All rights reserved. MEMORY CACHE – PERFORMANCE CONSIDERATIONS CLAIRE CATES DISTINGUISHED DEVELOPER
© 2008, Renesas Technology America, Inc., All Rights Reserved 1 Introduction Purpose  The course describes the performance analysis and profiling tools.
CS 346 – Chapter 1 Operating system – definition Responsibilities What we find in computer systems Review of –Instruction execution –Compile – link – load.
Memory Management – Page 1 of 49CSCI 4717 – Computer Architecture Memory Management Uni-program – memory split into two parts –One for Operating System.
Process by Dr. Amin Danial Asham. References Operating System Concepts ABRAHAM SILBERSCHATZ, PETER BAER GALVIN, and GREG GAGNE.
Current Assignments Homework 2 is available and is due in three days (June 19th). Project 1 due in 6 days (June 23 rd ) Write a binomial root solver using.
Processes CS 6560: Operating Systems Design. 2 Von Neuman Model Both text (program) and data reside in memory Execution cycle Fetch instruction Decode.
Operating Systems 1 K. Salah Module 1.2: Fundamental Concepts Interrupts System Calls.
1 Computer Systems II Introduction to Processes. 2 First Two Major Computer System Evolution Steps Led to the idea of multiprogramming (multiple concurrent.
Memory management.
CSC Multiprocessor Programming, Spring, 2012 Chapter 11 – Performance and Scalability Dr. Dale E. Parson, week 12.
Processes and Virtual Memory
Computer Organization Instruction Set Architecture (ISA) Instruction Set Architecture (ISA), or simply Architecture, of a computer is the.
1 Copyright © 2005, Oracle. All rights reserved. Following a Tuning Methodology.
Single Node Optimization Computational Astrophysics.
Operating System Concepts
Interrupts and Exception Handling. Execution We are quite aware of the Fetch, Execute process of the control unit of the CPU –Fetch and instruction as.
Lecture 10 Page 1 CS 111 Online Memory Management CS 111 On-Line MS Program Operating Systems Peter Reiher.
© Janice Regan, CMPT 300, May CMPT 300 Introduction to Operating Systems Operating Systems Overview: Using Hardware.
Tuning Threaded Code with Intel® Parallel Amplifier.
Lecture 1 Page 1 CS 111 Summer 2013 Important OS Properties For real operating systems built and used by real people Differs depending on who you are talking.
Introduction to Operating Systems Concepts
Using the VTune Analyzer on Multithreaded Applications
Jim Fawcett CSE 691 – Software Modeling and Analysis Fall 2000
Processes and threads.
CS703 – Advanced Operating Systems
Atomic Operations in Hardware
Process Management Presented By Aditya Gupta Assistant Professor
William Stallings Computer Organization and Architecture
Lecture 21 Concurrency Introduction
Parallel Architectures
Threads and Data Sharing
Fast Communication and User Level Parallelism
Tonga Institute of Higher Education IT 141: Information Systems
Tonga Institute of Higher Education IT 141: Information Systems
EE 155 / Comp 122 Parallel Computing
COMP755 Advanced Operating Systems
Chapter 2: Performance CS 447 Jason Bakos Fall 2001 CS 447.
CSC Multiprocessor Programming, Spring, 2011
Chapter 13: I/O Systems “The two main jobs of a computer are I/O and [CPU] processing. In many cases, the main job is I/O, and the [CPU] processing is.
Presentation transcript:

Copyright © 2003, SAS Institute Inc. All rights reserved. Where's Waldo Uncovering Hard-to-Find Application Killers Claire Cates SAS Institute, Inc

Copyright © 2003, SAS Institute Inc. All rights reserved. 2

3 Always something different  Just like the Waldo pictures, performance is always different and not easy to find. Performance based on the test that was run Performance based on the data that was used Performance based on the hardware used Performance based on the number of users

Copyright © 2003, SAS Institute Inc. All rights reserved. 4 What is a Performance Problem  When jobs cannot execute within a required time period.  Something that makes the system run slower than it should  When a system cannot sustain expected or unexpected growth (scalability) More users More data More processors

Copyright © 2003, SAS Institute Inc. All rights reserved. 5 Causes of Performance Problems  Hardware  Software  Integration of software systems  Network  Web

Copyright © 2003, SAS Institute Inc. All rights reserved. 6 How Do You Find Performance Problems Vendor profilers Looking at system variables (cache hits, IO timings,…) Profilers that analyze the code Code reviews Network sniffers Profiles that profile the entire machine Code instrumentation

Copyright © 2003, SAS Institute Inc. All rights reserved. 7 Common Software Performance Problems Antipatterns  Excessive Memory Allocation  The Ramp  Unnecessary Processing  One Lane Bridge  How Many Times Do I have to tell you.  Unbalanced Processing  More is Less

Copyright © 2003, SAS Institute Inc. All rights reserved. 8 Excessive Memory Allocation  Memory Allocations/Frees are expensive OS calls If your system is multi-threaded, locking may need to occur  Often times memory is allocated temporarily within a function  Often times structures are allocated and freed and not reused  Memory allocations in loops.  Possible Fixes Use a stack variable instead of temporary memory allocations Maintain a free chain for structures that are used often Make one large allocation outside loop – split it within the loop

Copyright © 2003, SAS Institute Inc. All rights reserved. 9 The Ramp  When processing slows down over time  Can be caused by long lists that grow and need to be searched  Can be caused by too many resources being used  Another kind of Ramp happens when the system doesn’t scale well.  Possible fixes Use a different algorithm when you know large amounts of data will be required Make sure all resources (especially memory) are returned.

Copyright © 2003, SAS Institute Inc. All rights reserved. 10 Unnecessary Processing  Loops that contain statements that do not need to execute on each iteration of the loop  Macros that are inefficient because they are too general  Zeroing of allocated memory that does not need to be zeroed.  Inefficient algorithms  Possible fixes Rework algorithm Don’t use macros

Copyright © 2003, SAS Institute Inc. All rights reserved. 11 One Lane Bridge  Resource contention – every thread waiting on the same resource  Eventually causes a traffic jam  Possible fixes Change the algorithm to use less resources that are shared

Copyright © 2003, SAS Institute Inc. All rights reserved. 12 How Many Times Do I Have To Tell You  Calling a routine too often with the same parameters  Sometimes a routine (foo) is the hot spot yet, (foo) is fine, it is just that foo is called to often. Most common occurrence of this that I see occurs when (afoo) (bfoo) (cfoo) (foo) So cfoo is called twice and foo is called 4 times all because afoo does not know what bfoo and cfoo actually call

Copyright © 2003, SAS Institute Inc. All rights reserved. 13 Unbalanced Processing  Occurs in a multi-threaded environment running on a multi-processor machine.  When one or two threads do all the processing while other threads are idle  Possible fixes Rebalance the work in the threads so that all threads process a similar amount of work

Copyright © 2003, SAS Institute Inc. All rights reserved. 14 More is Less or Thundering Herd  Adding threads does not make a system run faster  The system spends its time thrashing  Thrashing can occur because of Excessive thread switching Destroying the system memory or I/O caches when each thread runs  Possible fixes Don’t create more threads than there is work to be done

Copyright © 2003, SAS Institute Inc. All rights reserved. 15 Common Profilers in Use at SAS  InTune – z/OS  VTune – Intel – PCs  Caliper – HP  Rational Quantify – Windows, Solaris, HP, Linux  Jprobe  OS tools – not really profilers but gives information on −System calls −IO bottlenecks −Caching problems

Copyright © 2003, SAS Institute Inc. All rights reserved. 16 SAS’s use of Quantify  Other Profilers we use Event / timer based Based more on the function level, not the source level Network traffic & other processes on the machine distorted the results  Great results from all profilers  Tips I’m using with Quantify do apply to these other tools

Copyright © 2003, SAS Institute Inc. All rights reserved. 17 Quantify differences…  Quantify Counts instruction cycles for the user code Times the system calls (can be turned off) Does not have to run on a clean machine (a machine with no other activity) – developer machine Provides performance information down to the source line level Performance can be broken down by threads

Copyright © 2003, SAS Institute Inc. All rights reserved. 18 A Little about Quantify  Quantify integrates itself with your system. As your system executes, Quantify will accumulate a mass of data. Function counts for every function used The amount of time spent in every function The amount of time spent in every function plus the amount of time spent in all its descendent routines. Full Call tree information

Copyright © 2003, SAS Institute Inc. All rights reserved. 19 Quantify Quick Overview

Copyright © 2003, SAS Institute Inc. All rights reserved. 26 Excessive Memory Allocation

Copyright © 2003, SAS Institute Inc. All rights reserved. 36 How Many Times Do I Have to Tell You?

Copyright © 2003, SAS Institute Inc. All rights reserved. 43 More Is Less

Copyright © 2003, SAS Institute Inc. All rights reserved. 47

Copyright © 2003, SAS Institute Inc. All rights reserved. 52 Unnecessary Processing

Copyright © 2003, SAS Institute Inc. All rights reserved. 55 One Lane Bridge

Copyright © 2003, SAS Institute Inc. All rights reserved. 59 Unbalanced Processing

Copyright © 2003, SAS Institute Inc. All rights reserved. 64 Ramp

Copyright © 2003, SAS Institute Inc. All rights reserved. 70 Another Useful Hint

Copyright © 2003, SAS Institute Inc. All rights reserved. 72 Summary  Profilers are useful in helping to uncover performance problems in a software application  By being patient and looking at the mass of data provided by the tools you can find out a tremendous amount about what your system is doing and how to optimize the performance.

Copyright © 2003, SAS Institute Inc. All rights reserved. 73 References  AntiPatterns – Refactoring Software, Architectures, and Projects in Crisis - Brown, Malveau, McCormick & Mowbray ISBN  New Software Performance AntiPatterns: More Ways to Shoot Yourself in the Foot. Smith & Williams CMG 2002 Paper Presentation  Computer Measurement Group

Copyright © 2003, SAS Institute Inc. All rights reserved. 74