SlideShare a Scribd company logo
1 of 83
Download to read offline
Load Test Like a Pro
Rob Harrop
Agenda
● Who am I?
● Why bother load testing?
● Load Testing Process
○ Designing load tests like a pro
○ Running load tests like a pro
○ Analysing load tests like a pro
Who Am I?
CEO @SKIPJAQ
Co-Founder @SpringSource
Why Bother?
Time is Money
Faster → Better Service
Better Service → Improved Conversion
5slatency reduction =
7-12%increased conversion
Every 1s latency reduction =
~2%increase in conversion
2.2s reduction in average latency =
15.4%increase in download conversion
Slower → Partial Outage
One hour of downtime≈
$21,000revenue lost
One hour of slowdown≈
$4,400revenue lost
But!
Slowdowns are 10x more likely
than downtime
Twiceas much revenuelost to
slowdowns
Recap
● Your organisation (likely) exists to make money
● Application performance has a big impact on revenue
● The magnitude of this impact far outweighs the
investment you will make to maintain and improve
performance
Load Testing is a Process
In Fact ...
Load Testing is a
ContinuousProcess
Purpose Design
Glory!
Run
Analyse
● Once designed, a load test is good for multiple runs
● How many runs depends on:
○ How often you run
○ How often your code changes
○ How often your audience changes
● You must revisit the design as the landscape changes
Designing a Load Test
Load Test?
Step One: Define the purpose for testing
Step Two: Construct a high-quality test plan
Purpose
● What latency do I see with X concurrent users?
● How many concurrent users can I handle before latency
exceeds Xms?
● How many concurrent users can I handle before my system
is saturated?
● Average latency is mostly useless as a metric
● Later percentiles are better: 90th, 95th, 99th, 99.9th
● Max is a useful measure but is highly susceptible to
measurement error
● For best results, consider whole distribution analysis
Measuring Latency
Measuring Latency
● You may legitimately want to answer multiple
questions at once
● Consider a load test as a series of explorations up
your load curve
Test Plan
Test Plan Model
● Traditional test plans are prescriptive and deterministic
● A great test model is descriptive and probabilistic
Prescriptive
GET /home GET /offices GET /jobs GET /team
Prescriptive
GET /home GET /offices GET /jobs GET /team
GET /home GET /offices GET /jobs GET /team
Thread 1:
Thread N:
...
This is where load
tests go to die
Descriptive
GET /home
GET /offices
GET /team
GET /jobs
10%
30%
25%
5%
Each user is different
Transition Probabilities Capture
This Difference
Descriptive
GET /home
GET /offices
GET /team
GET /jobs
10%
30%
25%
5%
1500ms
3000ms
1200ms
1400ms
Wait Times are
A Thing™
● Wait times are typically non-zero
● Wait times are drawn from a distribution
● If you don’t know the distribution, exponential is a good
fallback
● Google Analytics, MixPanel, Kiss Metrics
● Log files
● OpenZipkin, AWS X-Ray
● NewRelic, AppDynamics, Instana
Source Model Parameters From Real Data
● Snapshot and restore a data starting point for each test
● Assign/generate test data per virtual user
● Mutation workflows modify transition probabilities
● Assigned data varies based on workflow
Handling Data Mutation
Naive Mutation
GET /home
POST /signin
POST /signup
email: rob@skipjaq.com
password: correcthorsebatterystaple
Modulated Mutation
GET /home
POST /signin
POST /signup
email: rob@skipjaq.com
password: correcthorsebatterystaple
POST /signin
New?
90%
10%
email: henry@skipjaq.com
password: servantgaragefanchest
Recap
● Design with a purpose in mind
● Each user is different, capture this difference in your model
● Probabilistic models are better than prescriptive plans
● Production data is the best source of model parameters
Running a Load Test
Step One: Create a high-fidelity load test environment
Step Two: Provision enough load generation capacity
Step Three: Instrument the System Under Test
Step Four: Implement the test model for your load generator of choice
Step Five: Go!
● The closer to production the better
● Ideally, you’re already automating production provisioning
● Stubbing is acceptable, but you must do it well
The System Under Test
● Stubs must exhibit service times like real systems
● Service times and wait times are modelled the same way
● github.com/spectolabs/hoverfly
Hoverfly
● Laptops are not load generators
● Less is not more
● If in doubt, over provision
● Make sure that you’re tracking metrics from the load
generators
Load Generators
● CPU, memory, I/O
● Usage, Saturation and Errors (USE)
● Background reading: Systems Performance by Brendan
Gregg
Instrumentation
USE Metrics
Resource Utilisation Saturation Errors
CPU CPU % Run Queue Length ECC events/Failed CPUs
Memory Free/Used %
Anon. Paging/Thread
Swapping
Failed mallocs?
Network I/O RX/TX throughput
NIC events
(drops/overruns)
Disk I/O Busy % Wait Queue Length Device Errors
Implementing in JMeter
The Load Model
GET /home
GET /offices
GET /team
GET /jobs
20%
10%
20%
3500ms
3400ms
6000ms
GET
/management
25% 5000ms
Let’s Go!
Warm Up
Run With
X Users
Saturated? Analysis
X=X*Y
● Super low tech: check the results by hand
● Low tech: check a plot of the results
● High tech: fit a curve to the plot and check that
● Super high tech: take the derivative of the fitted curve
Detecting Saturation
Checking The Results
Load Level Run Time (ms) Total Requests Throughput Errors Error %
30 729400 11420 15.65670 0 0.00000000
40 752098 15256 20.28459 0 0.00000000
50 786117 19069 24.25720 0 0.00000000
60 798399 22971 28.77133 2 0.00870663
70 784018 26691 34.04386 0 0.00000000
80 819177 30459 37.18244 9 0.02954792
90 852584 34259 40.18255 0 0.00000000
100 825598 38103 46.15200 0 0.00000000
110 843654 41984 49.76448 0 0.00000000
120 871827 45751 52.47715 32 0.06994383
130 1024274 49520 48.34644 0 0.00000000
140 1165331 53468 45.88224 6 0.01122167
150 1354668 57177 42.20739 32 0.05596656
Checking a Plot
Fitting a Curve
Crosstalk
overhead
Contention
overhead
Relative capacity
Number of users
Fitting a Curve
Derivative of the Curve
Retrograde Scaling
Load Level Run Time (ms) Total Requests Throughput Errors Error %
30 729400 11420 15.65670 0 0.00000000
40 752098 15256 20.28459 0 0.00000000
50 786117 19069 24.25720 0 0.00000000
60 798399 22971 28.77133 2 0.00870663
70 784018 26691 34.04386 0 0.00000000
80 819177 30459 37.18244 9 0.02954792
90 852584 34259 40.18255 0 0.00000000
100 825598 38103 46.15200 0 0.00000000
110 843654 41984 49.76448 0 0.00000000
120 871827 45751 52.47715 32 0.06994383
130 1024274 49520 48.34644 0 0.00000000
140 1165331 53468 45.88224 6 0.01122167
150 1354668 57177 42.20739 32 0.05596656
Recap
● Testing to saturation provides you with plenty of data
● Detecting saturation is relatively simple from the outside
● Tracking internal performance metrics helps to track
saturation
Analysing a Load Test
Step Zero: Learn R
Step One: Exploratory analysis
Step Two: Answer your questions
Step Three: Link to production data
The Basic Histogram
Log Scale Histogram
Faceted Histogram
As a Timeseries
The Humble Table
Label 50%ile 90%ile 95%ile 99%ile 99.9%ile 100%ile
Home 94 116 176 852.01 1474 5599
Jobs 175 185 239.65 960.64 4719.171 7178
Management 176 181 220.2 1041.56 1490.656 1516
Offices 176 186.4 229.7 1129.76 1683.586 7190
Team 175 182 223.7 1082.86 1676.934 4647
QoS per Load Level
Load Level 50%ile 90%ile 95%ile 99%ile 99.9%ile 100%ile
60 95 177 179 409.60 1269.120 2137
70 95 177 179 541.10 1430.170 1817
80 95 177 179 619.00 1423.084 4906
90 95 178 180 843.00 1652.226 4529
100 95 178 181 870.96 1650.898 5248
110 95 178 182 934.17 1711.034 5543
120 96 178 186 952.50 1568.000 7190
130 97 180 286 1152.00 6118.215 9268
140 158 189 331 1241.33 5876.665 7608
150 169 198 318 1386.48 5150.648 9724
Labelled QoS
Label Load Level 50%ile 90%ile 95%ile 99%ile 99.9%ile 100%ile
Home 60 93 96.0 99.00 374.00 1187.021 1772
Home 70 93 96.0 101.00 463.03 1359.006 1817
Home 80 93 97.0 107.00 515.04 1422.002 4793
Home 90 93 97.0 122.00 705.04 1642.509 4478
Home 100 93 99.0 129.00 715.05 1671.005 5158
Home 110 93 100.0 140.00 864.00 1675.503 5485
Home 120 94 116.0 176.00 852.01 1474.000 5599
Home 130 94 176.0 181.00 1135.00 6176.000 9204
Home 140 94 178.0 187.00 1192.03 5879.001 7523
Home 150 96 180.0 201.00 1384.00 5658.000 9713
Recap
● Experiment with different visualisations
● A simple table might be the best visualisation you have
● Segment analysis by endpoint
● Understand your load in the context of your production
metrics
In Summary
Load Test
With Purpose
Load Test With
Real User Models
Explore Your
Load Curve
Analyse in the
Context of Real Data
Performance Matters

More Related Content

Similar to Designing and Running Performance Experiments

Provisioning and Capacity Planning Workshop (Dogpatch Labs, September 2015)
Provisioning and Capacity Planning Workshop (Dogpatch Labs, September 2015)Provisioning and Capacity Planning Workshop (Dogpatch Labs, September 2015)
Provisioning and Capacity Planning Workshop (Dogpatch Labs, September 2015)Brian Brazil
 
Vsm and wip with arena simulation
Vsm and wip with  arena simulationVsm and wip with  arena simulation
Vsm and wip with arena simulationuniceder1111
 
London web performance WPO Lessons from the field June 2013
London web performance   WPO Lessons from the field June 2013London web performance   WPO Lessons from the field June 2013
London web performance WPO Lessons from the field June 2013Stephen Thair
 
Supply chain design and operation
Supply chain design and operationSupply chain design and operation
Supply chain design and operationAngelainBay
 
Provisioning and Capacity Planning (Travel Meets Big Data)
Provisioning and Capacity Planning (Travel Meets Big Data)Provisioning and Capacity Planning (Travel Meets Big Data)
Provisioning and Capacity Planning (Travel Meets Big Data)Brian Brazil
 
The Why and How of Continuous Delivery
The Why and How of Continuous DeliveryThe Why and How of Continuous Delivery
The Why and How of Continuous DeliveryNigel McNie
 
Need for Speed: How to Performance Test the right way by Annie Bhaumik
Need for Speed: How to Performance Test the right way by Annie BhaumikNeed for Speed: How to Performance Test the right way by Annie Bhaumik
Need for Speed: How to Performance Test the right way by Annie BhaumikQA or the Highway
 
A lean automation blueprint for testing in continuous delivery
A lean automation blueprint for testing in continuous deliveryA lean automation blueprint for testing in continuous delivery
A lean automation blueprint for testing in continuous deliverySauce Labs
 
Quick guide to plan and execute a load test
Quick guide to plan and execute a load testQuick guide to plan and execute a load test
Quick guide to plan and execute a load testduke.kalra
 
Continuous Performance Testing
Continuous Performance TestingContinuous Performance Testing
Continuous Performance TestingMark Price
 
Ways to minimise performance risks in continuous delivery
Ways to minimise performance risks in continuous deliveryWays to minimise performance risks in continuous delivery
Ways to minimise performance risks in continuous deliverya32an
 
Value add: Single User Performance Testing (http://managingperformancetesting...
Value add: Single User Performance Testing (http://managingperformancetesting...Value add: Single User Performance Testing (http://managingperformancetesting...
Value add: Single User Performance Testing (http://managingperformancetesting...akbollinger
 
Designing apps for resiliency
Designing apps for resiliencyDesigning apps for resiliency
Designing apps for resiliencyMasashi Narumoto
 
From Commit to Customer in a fully automated way | DevOps | Third Bridge Group
From Commit to Customer in a fully automated way | DevOps | Third Bridge GroupFrom Commit to Customer in a fully automated way | DevOps | Third Bridge Group
From Commit to Customer in a fully automated way | DevOps | Third Bridge GroupDouglas Adams
 
Jeremy Edberg (MinOps ) - How to build a solid infrastructure for a startup t...
Jeremy Edberg (MinOps ) - How to build a solid infrastructure for a startup t...Jeremy Edberg (MinOps ) - How to build a solid infrastructure for a startup t...
Jeremy Edberg (MinOps ) - How to build a solid infrastructure for a startup t...Startupfest
 
Performance testingfromthecloud_usingBlazemeter
Performance testingfromthecloud_usingBlazemeterPerformance testingfromthecloud_usingBlazemeter
Performance testingfromthecloud_usingBlazemeterMohit Verma
 
Netflix SRE perf meetup_slides
Netflix SRE perf meetup_slidesNetflix SRE perf meetup_slides
Netflix SRE perf meetup_slidesEd Hunter
 
itSMF Presentation March 2009
itSMF Presentation March 2009itSMF Presentation March 2009
itSMF Presentation March 2009jdmoore
 
How to Flip a Switch for 55% Web Performance Gains
How to Flip a Switch for 55% Web Performance GainsHow to Flip a Switch for 55% Web Performance Gains
How to Flip a Switch for 55% Web Performance GainsCloudflare
 

Similar to Designing and Running Performance Experiments (20)

Provisioning and Capacity Planning Workshop (Dogpatch Labs, September 2015)
Provisioning and Capacity Planning Workshop (Dogpatch Labs, September 2015)Provisioning and Capacity Planning Workshop (Dogpatch Labs, September 2015)
Provisioning and Capacity Planning Workshop (Dogpatch Labs, September 2015)
 
Vsm and wip with arena simulation
Vsm and wip with  arena simulationVsm and wip with  arena simulation
Vsm and wip with arena simulation
 
London web performance WPO Lessons from the field June 2013
London web performance   WPO Lessons from the field June 2013London web performance   WPO Lessons from the field June 2013
London web performance WPO Lessons from the field June 2013
 
Supply chain design and operation
Supply chain design and operationSupply chain design and operation
Supply chain design and operation
 
Provisioning and Capacity Planning (Travel Meets Big Data)
Provisioning and Capacity Planning (Travel Meets Big Data)Provisioning and Capacity Planning (Travel Meets Big Data)
Provisioning and Capacity Planning (Travel Meets Big Data)
 
The Why and How of Continuous Delivery
The Why and How of Continuous DeliveryThe Why and How of Continuous Delivery
The Why and How of Continuous Delivery
 
Need for Speed: How to Performance Test the right way by Annie Bhaumik
Need for Speed: How to Performance Test the right way by Annie BhaumikNeed for Speed: How to Performance Test the right way by Annie Bhaumik
Need for Speed: How to Performance Test the right way by Annie Bhaumik
 
A lean automation blueprint for testing in continuous delivery
A lean automation blueprint for testing in continuous deliveryA lean automation blueprint for testing in continuous delivery
A lean automation blueprint for testing in continuous delivery
 
Quick guide to plan and execute a load test
Quick guide to plan and execute a load testQuick guide to plan and execute a load test
Quick guide to plan and execute a load test
 
Continuous Performance Testing
Continuous Performance TestingContinuous Performance Testing
Continuous Performance Testing
 
Ways to minimise performance risks in continuous delivery
Ways to minimise performance risks in continuous deliveryWays to minimise performance risks in continuous delivery
Ways to minimise performance risks in continuous delivery
 
Value add: Single User Performance Testing (http://managingperformancetesting...
Value add: Single User Performance Testing (http://managingperformancetesting...Value add: Single User Performance Testing (http://managingperformancetesting...
Value add: Single User Performance Testing (http://managingperformancetesting...
 
Designing apps for resiliency
Designing apps for resiliencyDesigning apps for resiliency
Designing apps for resiliency
 
From Commit to Customer in a fully automated way | DevOps | Third Bridge Group
From Commit to Customer in a fully automated way | DevOps | Third Bridge GroupFrom Commit to Customer in a fully automated way | DevOps | Third Bridge Group
From Commit to Customer in a fully automated way | DevOps | Third Bridge Group
 
Jeremy Edberg (MinOps ) - How to build a solid infrastructure for a startup t...
Jeremy Edberg (MinOps ) - How to build a solid infrastructure for a startup t...Jeremy Edberg (MinOps ) - How to build a solid infrastructure for a startup t...
Jeremy Edberg (MinOps ) - How to build a solid infrastructure for a startup t...
 
Performance testingfromthecloud_usingBlazemeter
Performance testingfromthecloud_usingBlazemeterPerformance testingfromthecloud_usingBlazemeter
Performance testingfromthecloud_usingBlazemeter
 
Netflix SRE perf meetup_slides
Netflix SRE perf meetup_slidesNetflix SRE perf meetup_slides
Netflix SRE perf meetup_slides
 
Selenium Success
Selenium SuccessSelenium Success
Selenium Success
 
itSMF Presentation March 2009
itSMF Presentation March 2009itSMF Presentation March 2009
itSMF Presentation March 2009
 
How to Flip a Switch for 55% Web Performance Gains
How to Flip a Switch for 55% Web Performance GainsHow to Flip a Switch for 55% Web Performance Gains
How to Flip a Switch for 55% Web Performance Gains
 

More from J On The Beach

Massively scalable ETL in real world applications: the hard way
Massively scalable ETL in real world applications: the hard wayMassively scalable ETL in real world applications: the hard way
Massively scalable ETL in real world applications: the hard wayJ On The Beach
 
Big Data On Data You Don’t Have
Big Data On Data You Don’t HaveBig Data On Data You Don’t Have
Big Data On Data You Don’t HaveJ On The Beach
 
Acoustic Time Series in Industry 4.0: Improved Reliability and Cyber-Security...
Acoustic Time Series in Industry 4.0: Improved Reliability and Cyber-Security...Acoustic Time Series in Industry 4.0: Improved Reliability and Cyber-Security...
Acoustic Time Series in Industry 4.0: Improved Reliability and Cyber-Security...J On The Beach
 
Pushing it to the edge in IoT
Pushing it to the edge in IoTPushing it to the edge in IoT
Pushing it to the edge in IoTJ On The Beach
 
Drinking from the firehose, with virtual streams and virtual actors
Drinking from the firehose, with virtual streams and virtual actorsDrinking from the firehose, with virtual streams and virtual actors
Drinking from the firehose, with virtual streams and virtual actorsJ On The Beach
 
How do we deploy? From Punched cards to Immutable server pattern
How do we deploy? From Punched cards to Immutable server patternHow do we deploy? From Punched cards to Immutable server pattern
How do we deploy? From Punched cards to Immutable server patternJ On The Beach
 
When Cloud Native meets the Financial Sector
When Cloud Native meets the Financial SectorWhen Cloud Native meets the Financial Sector
When Cloud Native meets the Financial SectorJ On The Beach
 
The big data Universe. Literally.
The big data Universe. Literally.The big data Universe. Literally.
The big data Universe. Literally.J On The Beach
 
Streaming to a New Jakarta EE
Streaming to a New Jakarta EEStreaming to a New Jakarta EE
Streaming to a New Jakarta EEJ On The Beach
 
The TIPPSS Imperative for IoT - Ensuring Trust, Identity, Privacy, Protection...
The TIPPSS Imperative for IoT - Ensuring Trust, Identity, Privacy, Protection...The TIPPSS Imperative for IoT - Ensuring Trust, Identity, Privacy, Protection...
The TIPPSS Imperative for IoT - Ensuring Trust, Identity, Privacy, Protection...J On The Beach
 
Pushing AI to the Client with WebAssembly and Blazor
Pushing AI to the Client with WebAssembly and BlazorPushing AI to the Client with WebAssembly and Blazor
Pushing AI to the Client with WebAssembly and BlazorJ On The Beach
 
Axon Server went RAFTing
Axon Server went RAFTingAxon Server went RAFTing
Axon Server went RAFTingJ On The Beach
 
The Six Pitfalls of building a Microservices Architecture (and how to avoid t...
The Six Pitfalls of building a Microservices Architecture (and how to avoid t...The Six Pitfalls of building a Microservices Architecture (and how to avoid t...
The Six Pitfalls of building a Microservices Architecture (and how to avoid t...J On The Beach
 
Madaari : Ordering For The Monkeys
Madaari : Ordering For The MonkeysMadaari : Ordering For The Monkeys
Madaari : Ordering For The MonkeysJ On The Beach
 
Servers are doomed to fail
Servers are doomed to failServers are doomed to fail
Servers are doomed to failJ On The Beach
 
Interaction Protocols: It's all about good manners
Interaction Protocols: It's all about good mannersInteraction Protocols: It's all about good manners
Interaction Protocols: It's all about good mannersJ On The Beach
 
A race of two compilers: GraalVM JIT versus HotSpot JIT C2. Which one offers ...
A race of two compilers: GraalVM JIT versus HotSpot JIT C2. Which one offers ...A race of two compilers: GraalVM JIT versus HotSpot JIT C2. Which one offers ...
A race of two compilers: GraalVM JIT versus HotSpot JIT C2. Which one offers ...J On The Beach
 
Leadership at every level
Leadership at every levelLeadership at every level
Leadership at every levelJ On The Beach
 
Machine Learning: The Bare Math Behind Libraries
Machine Learning: The Bare Math Behind LibrariesMachine Learning: The Bare Math Behind Libraries
Machine Learning: The Bare Math Behind LibrariesJ On The Beach
 

More from J On The Beach (20)

Massively scalable ETL in real world applications: the hard way
Massively scalable ETL in real world applications: the hard wayMassively scalable ETL in real world applications: the hard way
Massively scalable ETL in real world applications: the hard way
 
Big Data On Data You Don’t Have
Big Data On Data You Don’t HaveBig Data On Data You Don’t Have
Big Data On Data You Don’t Have
 
Acoustic Time Series in Industry 4.0: Improved Reliability and Cyber-Security...
Acoustic Time Series in Industry 4.0: Improved Reliability and Cyber-Security...Acoustic Time Series in Industry 4.0: Improved Reliability and Cyber-Security...
Acoustic Time Series in Industry 4.0: Improved Reliability and Cyber-Security...
 
Pushing it to the edge in IoT
Pushing it to the edge in IoTPushing it to the edge in IoT
Pushing it to the edge in IoT
 
Drinking from the firehose, with virtual streams and virtual actors
Drinking from the firehose, with virtual streams and virtual actorsDrinking from the firehose, with virtual streams and virtual actors
Drinking from the firehose, with virtual streams and virtual actors
 
How do we deploy? From Punched cards to Immutable server pattern
How do we deploy? From Punched cards to Immutable server patternHow do we deploy? From Punched cards to Immutable server pattern
How do we deploy? From Punched cards to Immutable server pattern
 
Java, Turbocharged
Java, TurbochargedJava, Turbocharged
Java, Turbocharged
 
When Cloud Native meets the Financial Sector
When Cloud Native meets the Financial SectorWhen Cloud Native meets the Financial Sector
When Cloud Native meets the Financial Sector
 
The big data Universe. Literally.
The big data Universe. Literally.The big data Universe. Literally.
The big data Universe. Literally.
 
Streaming to a New Jakarta EE
Streaming to a New Jakarta EEStreaming to a New Jakarta EE
Streaming to a New Jakarta EE
 
The TIPPSS Imperative for IoT - Ensuring Trust, Identity, Privacy, Protection...
The TIPPSS Imperative for IoT - Ensuring Trust, Identity, Privacy, Protection...The TIPPSS Imperative for IoT - Ensuring Trust, Identity, Privacy, Protection...
The TIPPSS Imperative for IoT - Ensuring Trust, Identity, Privacy, Protection...
 
Pushing AI to the Client with WebAssembly and Blazor
Pushing AI to the Client with WebAssembly and BlazorPushing AI to the Client with WebAssembly and Blazor
Pushing AI to the Client with WebAssembly and Blazor
 
Axon Server went RAFTing
Axon Server went RAFTingAxon Server went RAFTing
Axon Server went RAFTing
 
The Six Pitfalls of building a Microservices Architecture (and how to avoid t...
The Six Pitfalls of building a Microservices Architecture (and how to avoid t...The Six Pitfalls of building a Microservices Architecture (and how to avoid t...
The Six Pitfalls of building a Microservices Architecture (and how to avoid t...
 
Madaari : Ordering For The Monkeys
Madaari : Ordering For The MonkeysMadaari : Ordering For The Monkeys
Madaari : Ordering For The Monkeys
 
Servers are doomed to fail
Servers are doomed to failServers are doomed to fail
Servers are doomed to fail
 
Interaction Protocols: It's all about good manners
Interaction Protocols: It's all about good mannersInteraction Protocols: It's all about good manners
Interaction Protocols: It's all about good manners
 
A race of two compilers: GraalVM JIT versus HotSpot JIT C2. Which one offers ...
A race of two compilers: GraalVM JIT versus HotSpot JIT C2. Which one offers ...A race of two compilers: GraalVM JIT versus HotSpot JIT C2. Which one offers ...
A race of two compilers: GraalVM JIT versus HotSpot JIT C2. Which one offers ...
 
Leadership at every level
Leadership at every levelLeadership at every level
Leadership at every level
 
Machine Learning: The Bare Math Behind Libraries
Machine Learning: The Bare Math Behind LibrariesMachine Learning: The Bare Math Behind Libraries
Machine Learning: The Bare Math Behind Libraries
 

Recently uploaded

FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDGMarianaLemus7
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraDeakin University
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphNeo4j
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxnull - The Open Security Community
 

Recently uploaded (20)

FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDG
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning era
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
 

Designing and Running Performance Experiments

  • 1. Load Test Like a Pro Rob Harrop
  • 2. Agenda ● Who am I? ● Why bother load testing? ● Load Testing Process ○ Designing load tests like a pro ○ Running load tests like a pro ○ Analysing load tests like a pro
  • 3. Who Am I? CEO @SKIPJAQ Co-Founder @SpringSource
  • 5.
  • 8. Better Service → Improved Conversion
  • 10. Every 1s latency reduction = ~2%increase in conversion
  • 11. 2.2s reduction in average latency = 15.4%increase in download conversion
  • 13. One hour of downtime≈ $21,000revenue lost
  • 14. One hour of slowdown≈ $4,400revenue lost
  • 15. But!
  • 16. Slowdowns are 10x more likely than downtime
  • 17. Twiceas much revenuelost to slowdowns
  • 18. Recap ● Your organisation (likely) exists to make money ● Application performance has a big impact on revenue ● The magnitude of this impact far outweighs the investment you will make to maintain and improve performance
  • 19. Load Testing is a Process
  • 21. Load Testing is a ContinuousProcess
  • 23. ● Once designed, a load test is good for multiple runs ● How many runs depends on: ○ How often you run ○ How often your code changes ○ How often your audience changes ● You must revisit the design as the landscape changes
  • 26. Step One: Define the purpose for testing Step Two: Construct a high-quality test plan
  • 28. ● What latency do I see with X concurrent users? ● How many concurrent users can I handle before latency exceeds Xms? ● How many concurrent users can I handle before my system is saturated?
  • 29. ● Average latency is mostly useless as a metric ● Later percentiles are better: 90th, 95th, 99th, 99.9th ● Max is a useful measure but is highly susceptible to measurement error ● For best results, consider whole distribution analysis Measuring Latency
  • 31. ● You may legitimately want to answer multiple questions at once ● Consider a load test as a series of explorations up your load curve
  • 32.
  • 35. ● Traditional test plans are prescriptive and deterministic ● A great test model is descriptive and probabilistic
  • 36. Prescriptive GET /home GET /offices GET /jobs GET /team
  • 37. Prescriptive GET /home GET /offices GET /jobs GET /team GET /home GET /offices GET /jobs GET /team Thread 1: Thread N: ...
  • 38. This is where load tests go to die
  • 39. Descriptive GET /home GET /offices GET /team GET /jobs 10% 30% 25% 5%
  • 40. Each user is different
  • 42. Descriptive GET /home GET /offices GET /team GET /jobs 10% 30% 25% 5% 1500ms 3000ms 1200ms 1400ms
  • 43. Wait Times are A Thing™
  • 44. ● Wait times are typically non-zero ● Wait times are drawn from a distribution ● If you don’t know the distribution, exponential is a good fallback
  • 45. ● Google Analytics, MixPanel, Kiss Metrics ● Log files ● OpenZipkin, AWS X-Ray ● NewRelic, AppDynamics, Instana Source Model Parameters From Real Data
  • 46. ● Snapshot and restore a data starting point for each test ● Assign/generate test data per virtual user ● Mutation workflows modify transition probabilities ● Assigned data varies based on workflow Handling Data Mutation
  • 47. Naive Mutation GET /home POST /signin POST /signup email: rob@skipjaq.com password: correcthorsebatterystaple
  • 48. Modulated Mutation GET /home POST /signin POST /signup email: rob@skipjaq.com password: correcthorsebatterystaple POST /signin New? 90% 10% email: henry@skipjaq.com password: servantgaragefanchest
  • 49. Recap ● Design with a purpose in mind ● Each user is different, capture this difference in your model ● Probabilistic models are better than prescriptive plans ● Production data is the best source of model parameters
  • 51. Step One: Create a high-fidelity load test environment Step Two: Provision enough load generation capacity Step Three: Instrument the System Under Test Step Four: Implement the test model for your load generator of choice Step Five: Go!
  • 52. ● The closer to production the better ● Ideally, you’re already automating production provisioning ● Stubbing is acceptable, but you must do it well The System Under Test
  • 53. ● Stubs must exhibit service times like real systems ● Service times and wait times are modelled the same way ● github.com/spectolabs/hoverfly Hoverfly
  • 54. ● Laptops are not load generators ● Less is not more ● If in doubt, over provision ● Make sure that you’re tracking metrics from the load generators Load Generators
  • 55. ● CPU, memory, I/O ● Usage, Saturation and Errors (USE) ● Background reading: Systems Performance by Brendan Gregg Instrumentation
  • 56. USE Metrics Resource Utilisation Saturation Errors CPU CPU % Run Queue Length ECC events/Failed CPUs Memory Free/Used % Anon. Paging/Thread Swapping Failed mallocs? Network I/O RX/TX throughput NIC events (drops/overruns) Disk I/O Busy % Wait Queue Length Device Errors
  • 58. The Load Model GET /home GET /offices GET /team GET /jobs 20% 10% 20% 3500ms 3400ms 6000ms GET /management 25% 5000ms
  • 59. Let’s Go! Warm Up Run With X Users Saturated? Analysis X=X*Y
  • 60. ● Super low tech: check the results by hand ● Low tech: check a plot of the results ● High tech: fit a curve to the plot and check that ● Super high tech: take the derivative of the fitted curve Detecting Saturation
  • 61. Checking The Results Load Level Run Time (ms) Total Requests Throughput Errors Error % 30 729400 11420 15.65670 0 0.00000000 40 752098 15256 20.28459 0 0.00000000 50 786117 19069 24.25720 0 0.00000000 60 798399 22971 28.77133 2 0.00870663 70 784018 26691 34.04386 0 0.00000000 80 819177 30459 37.18244 9 0.02954792 90 852584 34259 40.18255 0 0.00000000 100 825598 38103 46.15200 0 0.00000000 110 843654 41984 49.76448 0 0.00000000 120 871827 45751 52.47715 32 0.06994383 130 1024274 49520 48.34644 0 0.00000000 140 1165331 53468 45.88224 6 0.01122167 150 1354668 57177 42.20739 32 0.05596656
  • 66. Retrograde Scaling Load Level Run Time (ms) Total Requests Throughput Errors Error % 30 729400 11420 15.65670 0 0.00000000 40 752098 15256 20.28459 0 0.00000000 50 786117 19069 24.25720 0 0.00000000 60 798399 22971 28.77133 2 0.00870663 70 784018 26691 34.04386 0 0.00000000 80 819177 30459 37.18244 9 0.02954792 90 852584 34259 40.18255 0 0.00000000 100 825598 38103 46.15200 0 0.00000000 110 843654 41984 49.76448 0 0.00000000 120 871827 45751 52.47715 32 0.06994383 130 1024274 49520 48.34644 0 0.00000000 140 1165331 53468 45.88224 6 0.01122167 150 1354668 57177 42.20739 32 0.05596656
  • 67. Recap ● Testing to saturation provides you with plenty of data ● Detecting saturation is relatively simple from the outside ● Tracking internal performance metrics helps to track saturation
  • 69. Step Zero: Learn R Step One: Exploratory analysis Step Two: Answer your questions Step Three: Link to production data
  • 74. The Humble Table Label 50%ile 90%ile 95%ile 99%ile 99.9%ile 100%ile Home 94 116 176 852.01 1474 5599 Jobs 175 185 239.65 960.64 4719.171 7178 Management 176 181 220.2 1041.56 1490.656 1516 Offices 176 186.4 229.7 1129.76 1683.586 7190 Team 175 182 223.7 1082.86 1676.934 4647
  • 75. QoS per Load Level Load Level 50%ile 90%ile 95%ile 99%ile 99.9%ile 100%ile 60 95 177 179 409.60 1269.120 2137 70 95 177 179 541.10 1430.170 1817 80 95 177 179 619.00 1423.084 4906 90 95 178 180 843.00 1652.226 4529 100 95 178 181 870.96 1650.898 5248 110 95 178 182 934.17 1711.034 5543 120 96 178 186 952.50 1568.000 7190 130 97 180 286 1152.00 6118.215 9268 140 158 189 331 1241.33 5876.665 7608 150 169 198 318 1386.48 5150.648 9724
  • 76. Labelled QoS Label Load Level 50%ile 90%ile 95%ile 99%ile 99.9%ile 100%ile Home 60 93 96.0 99.00 374.00 1187.021 1772 Home 70 93 96.0 101.00 463.03 1359.006 1817 Home 80 93 97.0 107.00 515.04 1422.002 4793 Home 90 93 97.0 122.00 705.04 1642.509 4478 Home 100 93 99.0 129.00 715.05 1671.005 5158 Home 110 93 100.0 140.00 864.00 1675.503 5485 Home 120 94 116.0 176.00 852.01 1474.000 5599 Home 130 94 176.0 181.00 1135.00 6176.000 9204 Home 140 94 178.0 187.00 1192.03 5879.001 7523 Home 150 96 180.0 201.00 1384.00 5658.000 9713
  • 77. Recap ● Experiment with different visualisations ● A simple table might be the best visualisation you have ● Segment analysis by endpoint ● Understand your load in the context of your production metrics
  • 80. Load Test With Real User Models
  • 82. Analyse in the Context of Real Data