Neustar Load Testing How to Maximize Load Testing



































- Slides: 35

Neustar Load Testing How to Maximize Load Testing, Capacity, Control and Analysis Matt Rodriguez 6/25/2014

Outline § Designing a web application to scale § Load Testing Techniques § Selenium Scripting § Root Cause Analysis § Mini Twitter example § Static site example

Web application scaling § Minimize the number of HTTP requests your application makes § Combine and minify javascript and CSS § Use another domain for static assets § Use image sprites § Use a CDN for static assets § Use tools like Pagespeed test and Yslow to identify issues

Web application scaling § Keep your web application stateless, § State belongs in the database/caching layer § Let’s you easily add more servers/instances as traffic increases § Identify the slowest object on your webpage using the waterfall chart. Figure out why it’s the slowest

Load Testing § Simulate a large amount of traffic to a web site or API § Internal vs External load testing § Real browsers § Raw HTTP requests § On demand load testing versus yearly package

Load Testing Goals § Quality Assurance – make this part of a regression tests before you release § Identify scaling issues § Capacity planning – figure out how much peak load your website can handle

Load Testing Techniques § Ramp up then sustain a constant load

Load Testing Techniques § Use real browsers for capacity planning § Use virtual users with real browsers to generate more load § Have a logging strategy for your application. § Test the common click paths of your application

Selenium § Tool which automates a series of actions that a browser performs § Selenium bindings to many programming languages § Neustar Load Testing uses a javascript version of Selenium § Same Load Testing script can be used to monitor your website

Mini Twit application workflow

Workflow continued

Logging in

Sending Tweets

Workflow in Action

HAR View

Root Cause Analysis § What can we learn from running a load test § View is from the client § Monitor your servers, CPU, memory usage, IOPs § Monitor your applications § Have a good logging strategy, search for exceptions and stack traces

Misconfiguration

Misconfiguration § System components are not configured to run in production § Limited number of connections to the web server § Issues could be in the webserver, application configuration, or in the database § The load test fails immediately, or fails at a lot lower number of users § You want to abort the test and diagnose the issue

Test Plan for Mini Twit

Performance Degradation

By Step

Drilling down – Object Level § Neustar load testing lets you query or retrieve a database with your load testing data § We have timings at the transaction, step and object level § This lets you perform ad hoc SQL queries to pin point the root cause of performance problems

Object level response times

Application Errors § Calls to the application are returning 500, 503, 504 error codes § There are bugs in you application § The application calls are timing out § See which steps in the script are failing. This will correspond to an API call § Look at the logs and stack traces to find the bottleneck

Application Errors Example

Application Errors

Infrastructure Issues § Not enough servers or instances § Not enough network bandwidth § Total Throughput stays constant, number of users increase and page load time increases. § Off load assets to a CDN § If you are in the Cloud make your instances larger or create more of them.

Static Site

Har View

Test Plan

Data Throughput

Response Time

Transactions

Helpful links § http: //community. neustar. biz/community/wpm/load_testing/blo g/2013/11/19/writing-your-first-script § http: //community. neustar. biz/docs/DOC-1015 § Special thanks to Neustar’s Professional Services team!

Questions? § http: //community. neustar. biz/ § https: //home. wpm. neustar. biz § matt. rodriguez@neustar. biz