Transcript Welcome To

Presentation to the Rockville MDCFUG

“Load Testing Early and Often”

By Donald Doane

OpenDemand Systems

Session Overview

• Introduction to Load Testing Web Applications • Testing from Development to Deployment • Load Testing Over the LAN vs. the Internet • Creating a Real-World Example in ColdFusion • Load Testing Best Practices • Identifying Common Performance Bottlenecks • ColdFusion Performance Tuning Hints and Tips • Questions & Answers 2

OpenDemand Systems

The ColdFacts

• Most developers are familiar with the “concept” of load testing, but very few actually do it!

• Most common reasons for not testing are Time, Complexity & Cost ($$$ can be very expensive) • Most sites run into performance problems with only a few users (you don’t have to be Victoria’s Secret) • Most performance problems are discovered too late in the game to properly address the issues 3

OpenDemand Systems

What is a Load Test?

• Simulates multiple users to measure, define, validate and maintain optimal application performance, scalability and reliability • Serves as a compass for understanding the limits of any Web-enabled application and, subsequently, for managing its performance and growth 4

OpenDemand Systems

Why Load Test from Development to Deployment?

 Identifies problems early on before they become   costly to resolve (avoid the pyramid effect)  Prevents the “Onion-Peel” syndrome  Reduces development cycles Produces better quality, more scalable code Prevents revenue and credibility loss due to poor Web site performance  Increases customer satisfaction and retention  Enables intelligent planning for future expansion 5

OpenDemand Systems

What does it mean for your site to perform or scale well?

• Delivers page views to users in 8 seconds or less (industry standard) • Performs consistently across multiple page view requests (avoid the wack-o mole effect) • Response times scale linearly as user load increases as opposed to exponentially 6

OpenDemand Systems

Virtual User Simulation

• One-to-many relationship between user and browser requests • Browser opens multiple concurrent connections to Web server • HTTP Request-Response Thread:

GET / HTTP/1.1

Host: www.mysite.com

------------------------------ HTTP/1.1 200 OK Content-Length: 327 Content-type: text/html [BODY]

7

OpenDemand Systems Your Browser OpenLoad Appliance Virtual Users Virtual Users Your Web Site/App Virtual Users

8

OpenDemand Systems

Load Testing over the LAN vs. the Internet

LAN Testing:  Eliminates network variability due to the Internet  Saturates system rather than the network Internet Testing:  Uncovers hidden delays due to Internet weather  Exercises your pipe, routers, firewalls and load balancers in addition to the system under test  Ensures Service Providers are meeting SLAs 9

OpenDemand Systems

Load Testing Do’s

  Do Do test early and do test often establish what is and is not acceptable performance for your application  Do test from the user’s perspective - it’s the only one that counts  Do baseline and compare your findings  Do monitor your system while you test  Do test whenever there’s a change in your site’s content, code or infrastructure 10

OpenDemand Systems

Load Testing Don’ts

  Don’t Don’t wait until the last minute to test depend on your customers to do your testing for you  Don’t test under unrealistic conditions  Don’t forget that increases in table sizes, disk usage and network traffic will degrade your application’s performance over time  Don’t be so quick to throw hardware at the problems you turn up it doesn’t always help 11

OpenDemand Systems

Creating a Real-World Example in ColdFusion

Customer Case Study:  Set up a User Profile  Configure a Load Test Scenario  Schedule a Load Test  Analyze Test Results 12

OpenDemand Systems

13

OpenDemand Systems

14

OpenDemand Systems

15

OpenDemand Systems

16

OpenDemand Systems

17

OpenDemand Systems

18

OpenDemand Systems

19

OpenDemand Systems

20

OpenDemand Systems

21

OpenDemand Systems

22

OpenDemand Systems

23

OpenDemand Systems

24

OpenDemand Systems

25

OpenDemand Systems

26

OpenDemand Systems

27

OpenDemand Systems

28

OpenDemand Systems

29

OpenDemand Systems

30

OpenDemand Systems

31

OpenDemand Systems

Identifying Common Performance Bottlenecks

   Over design of Web pages (too many graphics) Bad code (avoid recursive function calls) Web server connection limit too low (IIS is set to 10 by default)  Poorly tuned Web application server (play with your Administration Server Settings)  Excessive queue lengths (more than one) & wait times (more than a few milliseconds)  Memory contention issues (paging in)  Heavy disk I/O (high service times)  Network latency (packet collisions & lost) 32

OpenDemand Systems

Performance Tuning Hints & Tips

   Observe design & coding best practices (Fusebox) Pre-load images before they are needed Validate on the client whenever possible (JavaScript or ActionScript)  Strip formatting white space, tabs, carriage returns   and line feeds from HTML (speeds up response)  Upgrade to CF5 (Up to 5x faster than CF4.5)  Tune simultaneous requests per CPU (cfstat) Turn on “Trusted Cache” & increase cache size Restart server at 5-10 unresponsive requests 33

OpenDemand Systems

Performance Tuning Hints & Tips Cont’d

   Log slow pages (remember 8-second rule) Enable Debugging (check processing time) Replace frequently referenced Custom Tags with User Defined Functions (less overhead)  Bump up your cached query limit (if you can spare the memory)  Let ColdFusion work smarter and your Database work harder (write smart SQL don’t do SELECT *)  Use stored procedures for faster execution 34

OpenDemand Systems

Test your app for FREE

 Register at http://www.opendemand.com/cf/  Test for up to 5 virtual users for FREE!

 Try-out performance tuning tips  Test again and compare results to your baseline 35

OpenDemand Systems Q&A

[email protected] http://www.opendemand.com

36