You are previewing Software Performance and Scalability: A Quantitative Approach.
O'Reilly logo
Software Performance and Scalability: A Quantitative Approach

Book Description

Praise from the Reviewers:

"The practicality of the subject in a real-world situation distinguishes this book from others available on the market."

Professor Behrouz Far, University of Calgary

"This book could replace the computer organization texts now in use that every CS and CpE student must take. . . . It is much needed, well written, and thoughtful."

Professor Larry Bernstein, Stevens Institute of Technology

A distinctive, educational text onsoftware performance and scalability

This is the first book to take a quantitative approach to the subject of software performance and scalability. It brings together three unique perspectives to demonstrate how your products can be optimized and tuned for the best possible performance and scalability:

  • The Basics—introduces the computer hardware and software architectures that predetermine the performance and scalability of a software product as well as the principles of measuring the performance and scalability of a software product

  • Queuing Theory—helps you learn the performance laws and queuing models for interpreting the underlying physics behind software performance and scalability, supplemented with ready-to-apply techniques for improving the performance and scalability of a software system

  • API Profiling—shows you how to design more efficient algorithms and achieve optimized performance and scalability, aided by adopting an API profiling framework (perfBasic) built on the concept of a performance map for drilling down performance root causes at the API level

Software Performance and Scalability gives you a specialized skill set that will enable you to design and build performance into your products with immediate, measurable improvements. Complemented with real-world case studies, it is an indispensable resource for software developers, quality and performance assurance engineers, architects, and managers. It is anideal text for university courses related to computer and software performance evaluation and can also be used to supplement a course in computer organization or in queuing theory for upper-division and graduate computer science students.

Table of Contents

  1. Copyright
  2. Quantitative Software Engineering Series
  3. Preface
    1. WHY THIS BOOK
    2. WHO THIS BOOK IS FOR
    3. HOW THIS BOOK IS ORGANIZED
    4. HOW TO REACH THE AUTHOR
  4. Acknowledgments
  5. Introduction
    1. PERFORMANCE VERSUS SCALABILITY
  6. 1. The Basics
    1. 1. Hardware Platform
      1. 1.1. TURING MACHINE
      2. 1.2. VON NEUMANN MACHINE
      3. 1.3. ZUSE MACHINE
      4. 1.4. INTEL MACHINE
        1. 1.4.1. History of Intel's Chips
        2. 1.4.2. Hyperthreading
        3. 1.4.3. Intel's Multicore Microarchitecture
        4. 1.4.4. Challenges for System Monitoring Tools
      5. 1.5. SUN MACHINE
      6. 1.6. SYSTEM UNDER TEST
        1. 1.6.1. Processors
        2. 1.6.2. Motherboard
        3. 1.6.3. Chipset
        4. 1.6.4. Storage
        5. 1.6.5. RAID
        6. 1.6.6. Networking
        7. 1.6.7. Operating System
      7. 1.7. ODDS AGAINST TURING
        1. 1.7.1. Memory Leaks
        2. 1.7.2. SLAs
      8. 1.8. SIZING HARDWARE
      9. 1.9. SUMMARY
      10. 1.10. RECOMMENDED READING
      11. 1.11. EXERCISES
    2. 2. Software Platform
      1. 2.1. SOFTWARE STACK
      2. 2.2. APIs
        1. 2.2.1. Windows APIs
        2. 2.2.2. Java APIs
        3. 2.2.3. Google APIs
      3. 2.3. MULTITHREADING
      4. 2.4. CATEGORIZING SOFTWARE
        1. 2.4.1. Systems Software
        2. 2.4.2. Application Software
        3. 2.4.3. Middleware Software
      5. 2.5. ENTERPRISE COMPUTING
        1. 2.5.1. What Is Enterprise Software?
        2. 2.5.2. Enterprise Software Architecture
        3. 2.5.3. Monolithic Architecture
        4. 2.5.4. Client/Server Architecture
        5. 2.5.5. Three-Tier Architecture
        6. 2.5.6. N-Tier Architecture
        7. 2.5.7. Software Componentry
        8. 2.5.8. Service-Oriented Architecture
      6. 2.6. SUMMARY
      7. 2.7. RECOMMENDED READING
      8. 2.8. EXERCISES
    3. 3. Testing Software Performance and Scalability
      1. 3.1. SCOPE OF SOFTWARE PERFORMANCE AND SCALABILITY TESTING
        1. 3.1.1. Performance Regression Testing
        2. 3.1.2. Performance Optimization and Tuning Testing
        3. 3.1.3. Performance Benchmarking Testing
        4. 3.1.4. Scalability Testing
        5. 3.1.5. QA Testing Versus Performance Testing
        6. 3.1.6. Additional Merits of Performance Testing
      2. 3.2. SOFTWARE DEVELOPMENT PROCESS
        1. 3.2.1. Agile Software Development
        2. 3.2.2. Extreme Programming
      3. 3.3. DEFINING SOFTWARE PERFORMANCE
        1. 3.3.1. Performance Metrics for OLTP Workloads
        2. 3.3.2. Performance Metrics for Batch Jobs
      4. 3.4. STOCHASTIC NATURE OF SOFTWARE PERFORMANCE MEASUREMENTS
      5. 3.5. AMDAHL'S LAW
      6. 3.6. SOFTWARE PERFORMANCE AND SCALABILITY FACTORS
        1. 3.6.1. Hardware
        2. 3.6.2. Operating System
        3. 3.6.3. Database Statistics
        4. 3.6.4. SQL Server Parameterization
        5. 3.6.5. Database Deadlocks
        6. 3.6.6. Licensing
      7. 3.7. SYSTEM PERFORMANCE COUNTERS
        1. 3.7.1. Windows Performance Console
        2. 3.7.2. Using perfmon to Diagnose Memory Leaks
        3. 3.7.3. Using perfmon to Diagnose CPU Bottlenecks
        4. 3.7.4. Using perfmon to Diagnose Disk I/O Bottlenecks
        5. 3.7.5. Using Task Manager to Diagnose System Bottlenecks
        6. 3.7.6. UNIX Platforms
      8. 3.8. SOFTWARE PERFORMANCE DATA PRINCIPLES
      9. 3.9. SUMMARY
      10. 3.10. RECOMMENDED READING
      11. 3.11. EXERCISES
  7. 2. Applying Queuing Theory
    1. 4. Introduction to Queuing Theory
      1. 4.1. QUEUING CONCEPTS AND METRICS
        1. 4.1.1. Basic Concepts of Queuing Theory
        2. 4.1.2. Queuing Theory: From Textual Description to Mathematical Symbols
      2. 4.2. INTRODUCTION TO PROBABILITY THEORY
        1. 4.2.1. Random Variables and Distribution Functions
        2. 4.2.2. Discrete Distribution and Probability Distribution Series
        3. 4.2.3. Continuous Distribution and Distribution Density Function
      3. 4.3. APPLYING PROBABILITY THEORY TO QUEUING SYSTEMS
        1. 4.3.1. Markov Process
        2. 4.3.2. Poisson Distribution
        3. 4.3.3. Exponential Distribution Function
        4. 4.3.4. Kendall Notation
        5. 4.3.5. Queuing Node versus Queuing System
      4. 4.4. QUEUING MODELS FOR NETWORKED QUEUING SYSTEMS
        1. 4.4.1. Queuing Theory Triad I: Response Time, Throughput, and Queue Length (Little's Law)
        2. 4.4.2. M/M/1 Model (Open)
        3. 4.4.3. Queuing System: With Feedback versus Without Feedback
        4. 4.4.4. Queuing Theory Triad II: Utilization, Service Time, and Response Time
        5. 4.4.5. Multiple Parallel Queues versus Single-Queue Multiple Servers
        6. 4.4.6. M/M/m/N/N Model (Closed)
        7. 4.4.7. Finite Response Time in Reality
        8. 4.4.8. Validity of Open Models
        9. 4.4.9. Performance and Scalability Bottlenecks in a Software System
        10. 4.4.10. Genealogy of Queuing Models
      5. 4.5. SUMMARY
      6. 4.6. RECOMMENDED READING
      7. 4.7. EXERCISES
    2. 5. Case Study I: Queuing Theory Applied to SOA
      1. 5.1. INTRODUCTION TO SOA
      2. 5.2. XML WEB SERVICES
      3. 5.3. THE ANALYTICAL MODEL
      4. 5.4. SERVICE DEMAND
        1. 5.4.1. Web Services Handle Creation
        2. 5.4.2. XML SOAP Serialization/Deserialization
        3. 5.4.3. Network Latency
        4. 5.4.4. XML Web Service Provider
        5. 5.4.5. Database Server
        6. 5.4.6. Data Storage
      5. 5.5. MedRec APPLICATION
        1. 5.5.1. Exposing a Stateless Session EJB as an XML Web Service
        2. 5.5.2. Consuming an XML Web Service Using SOAP
      6. 5.6. MedRec DEPLOYMENT AND TEST SCENARIO
      7. 5.7. TEST RESULTS
        1. 5.7.1. Overhead of the XML Web Services Handle
        2. 5.7.2. Effects of Caching Web Services Handle
        3. 5.7.3. Throughput Dynamics
        4. 5.7.4. Bottleneck Analysis
      8. 5.8. COMPARING THE MODEL WITH THE MEASUREMENTS
      9. 5.9. VALIDITY OF THE SOA PERFORMANCE MODEL
      10. 5.10. SUMMARY
      11. 5.11. RECOMMENDED READING
      12. 5.12. EXERCISES
    3. 6. Case Study II: Queuing Theory Applied to Optimizing and Tuning Software Performance and Scalability
      1. 6.1. ANALYZING SOFTWARE PERFORMANCE AND SCALABILITY
        1. 6.1.1. Characterizing Performance and Scalability Problems
        2. 6.1.2. Isolating Performance and Scalability Factors
        3. 6.1.3. Applying Optimization and Tuning
      2. 6.2. EFFECTIVE OPTIMIZATION AND TUNING TECHNIQUES
        1. 6.2.1. Wait Events and Service Demands
        2. 6.2.2. Array Processing—Reducing Vi
        3. 6.2.3. Caching—Reducing Wait Time (Wi)
        4. 6.2.4. Covering Index—Reducing Service Demand (Di)
        5. 6.2.5. Cursor-Sharing—Reducing Service Demand (Di)
        6. 6.2.6. Eliminating Extraneous Logic—Reducing Service Demand (Di)
        7. 6.2.7. Faster Storage—Reducing Data Latency (Wi)
        8. 6.2.8. MPLS—Reducing Network Latency (Wi)
        9. 6.2.9. Database Double Buffering—An Anti Performance and Scalability Pattern
      3. 6.3. BALANCED QUEUING SYSTEM
      4. 6.4. SUMMARY
      5. 6.5. RECOMMENDED READING
      6. 6.6. EXERCISES
  8. 3. Applying API Profiling
    1. 7. Defining API Profiling Framework
      1. 7.1. DEFENSE LINES AGAINST SOFTWARE PERFORMANCE AND SCALABILITY DEFECTS
      2. 7.2. SOFTWARE PROGRAM EXECUTION STACK
      3. 7.3. THE PerfBasic API PROFILING FRAMEWORK
        1. 7.3.1. API Profile Logging Format
        2. 7.3.2. Performance Log Parser
        3. 7.3.3. Performance Maps
        4. 7.3.4. Performance Summarization File
      4. 7.4. SUMMARY
      5. 7.5. EXERCISES
    2. 8. Enabling API Profiling Framework
      1. 8.1. OVERALL STRUCTURE
      2. 8.2. GLOBAL PARAMETERS
      3. 8.3. MAIN LOGIC
      4. 8.4. PROCESSING FILES
      5. 8.5. ENABLING PROFILING
      6. 8.6. PROCESSING INNER CLASSES
      7. 8.7. PROCESSING COMMENTS
      8. 8.8. PROCESSING METHOD BEGIN
      9. 8.9. PROCESSING RETURN STATEMENTS
      10. 8.10. PROCESSING METHOD END
      11. 8.11. PROCESSING MAIN METHOD
      12. 8.12. TEST PROGRAM
      13. 8.13. SUMMARY
      14. 8.14. RECOMMENDED READING
      15. 8.15. EXERCISES
    3. 9. Implementing API Profiling Framework
      1. 9.1. GRAPHICS TOOL—dot
      2. 9.2. GRAPHICS TOOL—ILOG
      3. 9.3. GRAPHICS RESOLUTION
      4. 9.4. IMPLEMENTATION
        1. 9.4.1. driver
        2. 9.4.2. Global Parameters
        3. 9.4.3. logReader
        4. 9.4.4. logWriter
        5. 9.4.5. Node
        6. 9.4.6. Link
        7. 9.4.7. CallRecord
        8. 9.4.8. utility
        9. 9.4.9. parser
        10. 9.4.10. xmlProcessor
        11. 9.4.11. analyzer
        12. 9.4.12. adapter
      5. 9.5. SUMMARY
      6. 9.6. EXERCISES
    4. 10. Case Study: Applying API Profiling to Solving Software Performance and Scalability Challenges
      1. 10.1. ENABLING API PROFILING
        1. 10.1.1. Mechanism of Populating Log Entry
        2. 10.1.2. Source and Target Projects
        3. 10.1.3. Setting apf.properties File
        4. 10.1.4. Parsing Workflow
        5. 10.1.5. Verifying the Profiling-Enabled Source Code
        6. 10.1.6. Recommended Best Coding Practices
        7. 10.1.7. Enabling Non-Java Programs
      2. 10.2. API PROFILING WITH STANDARD LOGS
        1. 10.2.1. Generating API Profiling Log Data
        2. 10.2.2. Parsing API Profiling Log Data
        3. 10.2.3. Generating Performance Maps
        4. 10.2.4. Making Sense Out of Performance Maps
      3. 10.3. API PROFILING WITH CUSTOM LOGS
        1. 10.3.1. Using Adapter to Transform Custom Logs
        2. 10.3.2. Generating Performance Maps with Custom Logs
      4. 10.4. API PROFILING WITH COMBO LOGS
        1. 10.4.1. Client Side Performance Map
        2. 10.4.2. Server Side Performance Map
      5. 10.5. APPLYING API PROFILING TO SOLVING PERFORMANCE AND SCALABILITY PROBLEMS
        1. 10.5.1. Baseline
        2. 10.5.2. Optimization
        3. 10.5.3. Analysis
      6. 10.6. SUMMARY
      7. 10.7. EXERCISES
    5. A. Stochastic Equilibrium and Ergodicity
      1. A.1. BASIC CONCEPTS
        1. A.1.1. Random Variables
        2. A.1.2. Random Variable Vector
        3. A.1.3. Independent and Identical Distributions (IID)
        4. A.1.4. Stationary Processes
        5. A.1.5. Processes with Stationary Independent Increments
      2. A.2. CLASSIFICATION OF RANDOM PROCESSES
        1. A.2.1. General Renewal Processes
        2. A.2.2. Markov Renewal Processes
        3. A.2.3. Markov Processes
      3. A.3. DISCRETE-TIME MARKOV CHAINS
        1. A.3.1. Transition Probability Matrix and C–K Equations
        2. A.3.2. State Probability Matrix
        3. A.3.3. Classification of States and Chains
      4. A.4. CONTINUOUS-TIME MARKOV CHAINS
        1. A.4.1. C–K Equations
        2. A.4.2. Transition Rate Matrix
        3. A.4.3. Imbedded Markov Chains
      5. A.5. STOCHASTIC EQUILIBRIUM AND ERGODICITY
        1. A.5.1. Definition
        2. A.5.2. Limiting State Probabilities
        3. A.5.3. Stationary Equations
        4. A.5.4. Ergodic Theorems for Discrete-Time Markov Chains
      6. A.6. EXAMPLE A.1
        1. A.6.1. Ergodic Theorems for Continuous-Time Markov Chains
      7. A.7. BIRTH–DEATH CHAINS
        1. A.7.1. Transition Rate Matrix
        2. A.7.2. C–K Equations
        3. A.7.3. Limiting State Probabilities
        4. A.7.4. Ergodicity
    6. B. Memoryless Property of the Exponential Distribution
    7. C. M/M/1 Queues at Steady State
      1. C.1. REVIEW OF BIRTH–DEATH CHAINS
      2. C.2. UTILIZATION AND THROUGHPUT
      3. C.3. AVERAGE QUEUE LENGTH IN THE SYSTEM
      4. C.4. AVERAGE SYSTEM TIME
      5. C.5. AVERAGE WAIT TIME