Effective Use of Load Testing Tools to Tune Web Applications
Upcoming SlideShare
Loading in...5
×
 

Effective Use of Load Testing Tools to Tune Web Applications

on

  • 757 views

 

Statistics

Views

Total Views
757
Views on SlideShare
756
Embed Views
1

Actions

Likes
0
Downloads
20
Comments
0

1 Embed 1

http://www.slideshare.net 1

Accessibility

Categories

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

Effective Use of Load Testing Tools to Tune Web Applications Effective Use of Load Testing Tools to Tune Web Applications Presentation Transcript

  • Effective Use of Load Testing Tools to Tune Web Applications Tom Igielski, CSTE, CPC, CI The Thomas Consulting Group, Inc. [email_address] January 8 th , 2009
  • Discussion Topics
    • Web Terminology and Architectures
    • Common Problem Areas
    • Suggested Testing Approaches
    • How Does Architecture Affect Scalability
    • Tuning Your Application
  • Application Scalability Web applications are considered “scalable” if a graph depicting Web page response times compared to the number of concurrent users accessing the system increases in a linear fashion Users Response Time Expected Acceptable Crash Ideal
  • Bottleneck
    • A limiting resource that affects the system under test
    • Typically the cause of slow or unacceptable performance
    • Affects performance and scalability of a system
    • Only one in existence at any point in time
  • Typical Web Problem Areas Application Server Hub Hub Router ISP1 Router Load Balancer ISP2 Network vs. Server issues External Datafeed Web Server Database Server Firewall Internet bottlenecks Application server issues End-user Connection issues Web Server Load balancer problems Faulty web server within a cluster Server HW, device and OS issues ISP performance and peering Content issues Errors
  • Candidate Tuning Areas
  • Why Do Bottlenecks Exist?
    • Obvious
      • Inadequate Hardware
      • Inadequate Network Capacity
      • Poor Implementation / Tuning of Databases
    • Not So Obvious
      • Poor Architecture and System Design
      • Limited Expertise in System Design / Development
      • Changing Requirements
      • Changing Project Plans
      • Not Thinking About “Load” or “Scalability” or “Performance” During Des & Dev
  • Suggested Testing Approach
    • Plan the Testing Activities
      • Develop a Strategy
      • Clearly State Your Objectives
      • Define the Scope of the Performance Test
      • Identify the Performance Requirements
      • Develop Necessary Test Cases
      • Line Up the Necessary Testing Resources
      • Define Needed Test Data and Process to Maintain
      • Identify any Necessary Tools
  • Suggested Testing Approach
    • Build the Test Team
      • QA / Testing Personnel
      • Database Administrators
      • Network Engineers
      • Application Architects
      • Developers
      • Analysts
      • SME’s
  • Suggested Testing Approach
    • Develop the Test Scripts
      • Select Busiest Pages
        • Always Include the Home Page
      • Test Most Common Business Transactions
      • Test Most Critical Business Functions
      • Test Pages that are Suspect
  • Suggested Testing Approach
    • Establish the Test Environment
      • Procure the Load Test Tool(s)
        • # Vusers Needed
        • Protocols to Support
        • Monitors Necessary
      • Procure / Configure Test Servers
      • Establish Necessary Databases
      • Create / Maintain Test Data
  • Running Load Tests
    • Start load testing software and allow the system to stabilize before adding many users
    • Start ramping up users until you see some system slowdown appear
    • Check system components for problems
      • Could be servers, application, network
  • Ideal Business Scenario 12 1 2 3 4 5 6 7 8 9 10 11 12 1 2 3 4 5 6 7 8 9 10 11 12 Customer Search 250 users, 50 / hr / user Customer Referrals 100 users, 5 / hr / user Credit Checks 500 users, 5 / hr / user Recommend Product 300 users, 5 / hr / user Loan Approval 150 users, 2 / hr / user Business Process am pm Peak Load = BP Mix for Scenario
  •  
  • Load Test Cases
    • Generally 3 Categories
      • End-to-end
      • Modular
      • Single or low number of pages
    • Modular tests of single / low number of pages work best for isolating bottlenecks
    • Create short tests that focus narrowly on problem pages or functions
    • Run scripts one at a time, with either fixed delays or no delays
  • Successful Load Tests
    • Metrics
      • Hits / Sec
      • # Virtual Users
      • Transaction Response Time
      • Transactions / Second
      • Pages / Second
      • % CPU Utilization
  • Desired Metric: Hits / Second
    • The number of requests made to the web server per second
    • How many should the application support?
    • Determine peak based on the assumption that a % of activity in a day comes within a window of a few hours
    Let H = peak hits per second Let h = # hits received over a one month period Let a = % of activity that comes during peak time Let t = peak time in hours then H = h * a / (days * t * minutes * seconds) H = h * a / (108,000 * t)
  • Desired Metric: # Virtual Users
    • How many users should the application support?
    • Determine the peak Virtual Users
      • Peak hits/second + page view times
    Let U = peak virtual users Let H = peak hits per second Let p = average number of hits / page Let v = average time a user views a page U = (H / p) * v
  • Metrics - Example h = 150,000,000 hits per month a = 10% of traffic occurs during peak time t = peak time is 2 hours p = a page consists of 6 hits v = the average view time is 30 seconds H = (h X a) / (108,000 * t) H = (150,000,000 * .1) / (108,000 X 2) H = 48 U = (H / p) * v U = (48 / 6) * 30 U = 8 * 30 U = 240 Desired Metric – 48 Hits / Sec or 240 Virtual Users
  • How # VUsers Affect Response Time
  • Performance Requirements
    • Number of “registered” users
    • Number of simultaneous users
    • Data growth rate
    • Transaction Rates
      • Pages / Sec
      • Hits / Sec
      • Business Functions / Unit of Time
    • Response time limits
    • How users will use the system
      • Business scenarios
    • Impending events that will drive use
  • Architecture and Tuning
    • Servers
      • System Utilization (CPU)
      • Memory Utilization
      • Throughput
      • Disk I/O
      • Current Connections
      • Queue
      • Queue Wait Time
    • Databases
      • Table Scans
      • Table Locks
      • Cache Hits
      • Indexes
  • Architecture and Tuning
    • Load Balancers
      • Total Concurrent Connections
      • System Utilization (CPU)
      • Throughput
      • Load Distribution
      • Load Balancing Mechanism
    • Firewalls
      • Total Concurrent Connections
      • Total Current SSL Connections
      • System Utilization (CPU)
      • Throughput
  • Example Problems
    • High server CPU usage but goals not met
      • Have servers been tuned?
      • Has application code been optimized?
      • SSL overhead?
      • Additional Hardware
    • Low server memory availability
      • Sufficient memory for application
      • Memory leak?
  •  
  •  
  •  
  •  
  • Example Problems
    • Low activity on systems but increased transaction response time
      • Look at requests queued
      • Too few connections available
    • Application server activity ↓ but response time and timeouts ↑ as observed by client
      • Check server configuration
      • Look at execute threads available
      • Network problems
  • Example Problems
    • Response times “spike” during the run
      • Set up application servers in “cluster” mode
        • Eliminates problems with garbage collection
      • Garbage Collection
        • Heap size large, incorrect garbage collection settings
    • Disk I/O and CPU high on Application Servers
      • Application or server logging levels too high
  • Affects on Response time
  • Example Problems
    • Poor Java server performance
      • Optimize the JVM
      • Check JVM switches for starting
        • Memory consumption
        • Garbage collection
        • Thread counts
      • Consider Using Multiple Instances
  •  
  •  
  • Comparing Thread Counts
  • Comparing Thread Counts
  • Example Problems
    • Web servers being used unequally with load balancer in place
      • Problem with the load balancing algorithm being used
      • Servers sending “false” busy stats back to load balancer
      • “Run away” processes on select servers
  • Load Balancing Problems
  • Example Problems
    • Slow database query response
      • Use profiling tool to identify slow queries
      • Optimize queries
        • Eliminate unnecessary sorting
        • Eliminate unnecessary triggers
        • Minimize number of temp tables
        • Use stored procedures where possible
      • Create necessary indexes
  • Database Problems
  • Monitoring Activity
  • When Things Go Well
  • When Things Go Well
  • Summary
    • Web architectures are complex and provide many areas that can be “tuned”
    • Develop a specific process for Load Testing
    • Take a surgical approach to address problems – one at a time
  • Questions?