SlideShare a Scribd company logo
Performance	Tes-ng	
Crash	Course
Dus$n	Whi*le
Dus-n	Whi5le
• dus-nwhi5le.com	
• @dus-nwhi5le	
• San	Francisco,	California,	USA	
• Technologist,	Traveler,	Pilot,	Skier,	Diver,	Sailor,	Golfer
Why	does	performance	ma5er?
Dustin Whittle - Performance Testing Crash Course - code.talks 2015
Performance	directly	impacts	
the	bo5om	line
Dustin Whittle - Performance Testing Crash Course - code.talks 2015
How	fast	is	fast	enough?
§ Performance	is	key	to	a	great	user	experience		
- Under	100ms	is	perceived	as	reac$ng	instantaneously	
- A	100ms	to	300ms	delay	is	percep$ble	
- 1	second	is	about	the	limit	for	the	user's	flow	of	thought	to	stay	
uninterrupted	
- Users	expect	a	site	to	load	in	2	seconds	
- AMer	3	seconds,	40%	will	abandon	your	site.	
- 10	seconds	is	about	the	limit	for	keeping	the	user's	a*en$on	
§ Modern	applica-ons	spend	more	-me	in	the	browser	than	on	the	server-side
Login
Flight Status
Search Flight
Purchase
Mobile
Big data
SOA
NOSQL
Cloud
Agile
Web
Application complexity is exploding
Up-me	is	cri-cal	for	enterprises	and	consumers
Treat	performance	as	a	feature!
Tools	of	the	trade	for	
performance	tes-ng
Understand	your	
baseline	performance
Sta-c	
vs	
Hello	World	
vs	
Applica-ons
Apache Bench
ab -c 1 -t 10 -k
http://acmedemoapp.com/
Benchmarking acmedemoapp.com (be patient)
Finished 187 requests
Server Software: Apache-Coyote/1.1
Server Hostname: acmedemoapp.com
Server Port: 80
Document Path: /
Document Length: 5217 bytes
Concurrency Level: 1
Time taken for tests: 10.039 seconds
Complete requests: 187
Failed requests: 0
Keep-Alive requests: 187
Total transferred: 1021768 bytes
HTML transferred: 975579 bytes
Requests per second: 18.63 [#/sec] (mean)
Time per request: 53.687 [ms] (mean)
ab -c 10 -t 10 -k
http://acmedemoapp.com/
Benchmarking acmedemoapp.com (be patient)
Finished 659 requests
Server Software: Apache-Coyote/1.1
Server Hostname: acmedemoapp.com
Server Port: 80
Document Path: /
Document Length: 5217 bytes
Concurrency Level: 10
Time taken for tests: 10.015 seconds
Complete requests: 659
Failed requests: 0
Keep-Alive requests: 659
Total transferred: 3600776 bytes
HTML transferred: 3438003 bytes
Requests per second: 65.80 [#/sec] (mean)
Time per request: 151.970 [ms] (mean)
Time per request: 15.197 [ms] (mean, across all
Siege
siege -c 10 -b -t 10S http://acmedemoapp.com/
** SIEGE 3.0.6
** Preparing 10 concurrent users for
battle.
The server is now under siege...
Lifting the server siege... done.
Transactions: 623 hits
Availability: 100.00 %
Elapsed time: 9.57 secs
Data transferred: 3.10 MB
Response time: 0.15 secs
Transaction rate: 65.10 trans/sec
Throughput: 0.32 MB/sec
Concurrency: 9.91
Successful transactions: 623
Failed transactions: 0
Longest transaction: 0.30
Shortest transaction: 0.10
Crawl the entire app to
discover all urls
sproxy -o ./urls.txt
SPROXY v1.02 listening on port 9001
...appending HTTP requests to: ./urls.txt
...default connection timeout: 120 seconds
wget -r -l 0 -t 1 --spider -w 1
-e "http_proxy = http://127.0.0.1:9001"
"http://acmedemoapp.com/"
sort -u -o urls.txt urls.txt
http://acmedemoapp.com/
http://acmedemoapp.com/about
http://acmedemoapp.com/cart
http://acmedemoapp.com/currency/change/EUR
http://acmedemoapp.com/currency/change/GBP
http://acmedemoapp.com/currency/change/USD
http://acmedemoapp.com/login
http://acmedemoapp.com/register/
http://acmedemoapp.com/t/brand/bookmania
http://acmedemoapp.com/t/category/books
http://acmedemoapp.com/t/category/mugs
http://acmedemoapp.com/t/category/stickers
http://acmedemoapp.com/terms-of-service
Benchmark traffic across
all unique urls with siege
siege -v -c 50 -i -t 3M -f urls.txt -d 10
** SIEGE 3.0.6
** Preparing 10 concurrent users for battle.
The server is now under siege...
Lifting the server siege... done.
Transactions: 623 hits
Availability: 100.00 %
Elapsed time: 9.57 secs
Data transferred: 3.10 MB
Response time: 0.15 secs
Transaction rate: 65.10 trans/sec
Throughput: 0.32 MB/sec
Concurrency: 9.91
Successful transactions: 623
Failed transactions: 0
Longest transaction: 0.30
Shortest transaction: 0.10
Dustin Whittle - Performance Testing Crash Course - code.talks 2015
Multi-Mechanize is an open source
framework for performance and load
testing
pip install multi-mechanize
multimech-newproject
demo
import requests
class Transaction(object):
def run(self):
r = requests.get(‘http://acmedemoapp.com/)
r.raw.read()
import mechanize
import time
class Transaction(object):
def run(self):
br = mechanize.Browser()
br.set_handle_robots(False)
start_timer = time.time()
resp = br.open(‘http://acmedemoapp.com/)
resp.read()
latency = time.time() - start_timer
self.custom_timers['homepage'] = latency
start_timer = time.time()
resp = br.open(‘http://acmedemoapp.com/cart')
resp.read()
latency = time.time() - start_timer
self.custom_timers['cart'] = latency
assert (resp.code == 200)
multimech-run demo
Dustin Whittle - Performance Testing Crash Course - code.talks 2015
What about when you need
more than one machine?
Who lives in the cloud?
Bees with Machine
Guns
A utility for arming (creating)
many bees (micro EC2 instances)
to attack (load test)
targets (web applications)
pip install
beeswithmachineguns
# ~/.boto
[Credentials]
aws_access_key_id=xxx
aws_secret_access_key=xxx
[Boto]
ec2_region_name = us-west-2
ec2_region_endpoint = ec2.us-west-2.amazonaws.com
bees up -s 2 -g default -z us-west-2b -i
ami-bc05898c -k appdynamics-
dustinwhittle-aws-us-west-2 -l ec2-user
Connecting to the hive.
Attempting to call up 2 bees.
Waiting for bees to load their machine guns...
.
.
.
.
Bee i-3828400c is ready for the attack.
Bee i-3928400d is ready for the attack.
The swarm has assembled 2 bees.
bees report
Read 2 bees from the roster.
Bee i-3828400c: running @ 54.212.22.176
Bee i-3928400d: running @ 50.112.6.191
bees attack -n 1000 -c 50 -u
http://acmedemoapp.com/
Read 2 bees from the roster.
Connecting to the hive.
Assembling bees.
Each of 2 bees will fire 500 rounds, 25 at a time.
Stinging URL so it will be cached for the attack.
Organizing the swarm.
…
Offensive complete.
Complete requests: 1000
Requests per second: 306.540000 [#/sec] (mean)
Time per request: 163.112000 [ms] (mean)
50% response time: 151.000000 [ms] (mean)
90% response time: 192.000000 [ms] (mean)
Mission Assessment: Target crushed bee offensive.
The swarm is awaiting new orders.
bees attack -n 100000 -c 1000 -u
http://acmedemoapp.com/
Read 2 bees from the roster.
Connecting to the hive.
Assembling bees.
Each of 2 bees will fire 50000 rounds, 500 at a time.
Stinging URL so it will be cached for the attack.
Organizing the swarm.
…
Offensive complete.
Complete requests: 100000
Requests per second: 502.420000 [#/sec] (mean)
Time per request: 360.114000 [ms] (mean)
50% response time: 451.000000 [ms] (mean)
90% response time: 402.000000 [ms] (mean)
Mission Assessment: Target crushed bee offensive.
The swarm is awaiting new orders.
Read 2 bees from the roster.
Connecting to the hive.
Assembling bees.
Each of 2 bees will fire 50000 rounds, 500 at a time.
Stinging URL so it will be cached for the attack.
Organizing the swarm.
Bee 0 is joining the swarm.
Bee 1 is joining the swarm.
Bee 0 is firing his machine gun. Bang bang!
Bee 0 lost sight of the target (connection timed out).
Bee 1 lost sight of the target (connection timed out).
Offensive complete.
Target timed out without fully responding to 2 bees.
No bees completed the mission. Apparently your bees are
peace-loving hippies.
The swarm is awaiting new orders.
bees down
Read 2 bees from the roster.
Connecting to the hive.
Calling off the swarm.
Stood down 2 bees.
locust.io
https://github.com/locustio/locust
pip install locustio
Dustin Whittle - Performance Testing Crash Course - code.talks 2015
Dustin Whittle - Performance Testing Crash Course - code.talks 2015
Dustin Whittle - Performance Testing Crash Course - code.talks 2015
There are many tools…
•Gatling.io	
•Wrk	
•Vegeta	
•Tsung	
•…
What about the client side?
In modern web applications more
latency comes from the client-side
than the server-side.
Dustin Whittle - Performance Testing Crash Course - code.talks 2015
Dustin Whittle - Performance Testing Crash Course - code.talks 2015
Dustin Whittle - Performance Testing Crash Course - code.talks 2015
Dustin Whittle - Performance Testing Crash Course - code.talks 2015
npm install psi
Dustin Whittle - Performance Testing Crash Course - code.talks 2015
WBench
gem install wbench
wbench
http://dustinwhittle.com/
Dustin Whittle - Performance Testing Crash Course - code.talks 2015
Automate	client-side	
performance	tes-ng	with	
Grunt/Gulp
Use	Bower	(for	dependencies),	
	Grunt/Gulp	(for	automa-on),	
and	Yeoman	(for	bootstrapping)
Dustin Whittle - Performance Testing Crash Course - code.talks 2015
How	many	people	understand	exactly	
how	fast	their	site	runs	in	produc-on?
Track	performance	in	
development	and	produc-on
Instrument	everything	=	code,	databases,	
caches,	queues,	third	party	services,	and	
infrastructure.
Dustin Whittle - Performance Testing Crash Course - code.talks 2015
Statsd + Graphite
+ Grafana
Dustin Whittle - Performance Testing Crash Course - code.talks 2015
Track performance of
end users
webpagetest.org
Dustin Whittle - Performance Testing Crash Course - code.talks 2015
Dustin Whittle - Performance Testing Crash Course - code.talks 2015
Dustin Whittle - Performance Testing Crash Course - code.talks 2015
SiteSpeed.io
Dustin Whittle - Performance Testing Crash Course - code.talks 2015
Dustin Whittle - Performance Testing Crash Course - code.talks 2015
Dustin Whittle - Performance Testing Crash Course - code.talks 2015
Dustin Whittle - Performance Testing Crash Course - code.talks 2015
Dustin Whittle - Performance Testing Crash Course - code.talks 2015
Dustin Whittle - Performance Testing Crash Course - code.talks 2015
Dustin Whittle - Performance Testing Crash Course - code.talks 2015
Dustin Whittle - Performance Testing Crash Course - code.talks 2015
Load	tes-ng	services	
	from	the	cloud
Dustin Whittle - Performance Testing Crash Course - code.talks 2015
Dustin Whittle - Performance Testing Crash Course - code.talks 2015
Dustin Whittle - Performance Testing Crash Course - code.talks 2015
Test	for	failures
• NetFlix	Simian	Army	+	Chaos	Monkey

• What	happens	if	you	lose	a	caching	layer?	
• What	happens	if	dependencies	slow	down?
Performance	Ma*ers
• Treat	performance	as	a	feature	
• Using	the	14kb	Rule	for	instant	loading	
• Markup	management	
• Elimina$ng	excess	AJAX	calls	
• Working	with	and	around	applica$on	cache	
• Developing	a	responsive	design	+	image	strategy	
• Implemen$ng	a	good	touch-first	strategy	
• Code	management	for	good	produc$on	and	development	experiences	
• Using	task	runners	to	build	and	deploy	produc$on	code
Best	Prac$ces
• Treat	performance	as	a	feature	
• Capacity	plan	and	load	test	the	server-side	
• Op-mize	and	performance	test	the	client-side	
• Understand	your	star-ng	point	
• Instrument	everything	
• Monitor	performance	in	development	and	produc-on	
• Measure	the	difference	of	every	change	
• Automate	performance	tes-ng	in	your	build	and	deployment	process	
• Understand	how	failures	impact	performance
The	protocols	are	evolving
• The	limita$ons	of	HTTP/1.X	forced	us	to	develop	various	applica$on	
workarounds	(sharding,	concatena$on,	spri$ng,	inlining,	etc.)	to	op$mize	
performance.	However,	in	the	process	we’ve	also	introduced	numerous	
regressions:	poor	caching,	unnecessary	downloads,	delayed	execu$on,	and	
more.	
• HTTP/2	eliminates	the	need	for	these	hacks	and	allows	us	to	both	simplify	our	
applica$ons	and	deliver	improved	performance.	
• You	should	unshard,	unconcat,	and	unsprite	your	assets	
• You	should	switch	from	inlining	to	server	push	
• Read	Ilya	Grigorik	awesome	book	on	browser	performance	-	h*p://hpbn.co/
h*p2
Integrate	automated	performance	tes-ng	
into	con-nuous	integra-on	for	server-side	
and	client-side
Understand	the	performance	implica-ons	
of	every	deployment	and	package	upgrade
Monitor	end	user	experience	
from	end	to	end	in	produc-on
Ques-ons?
Find	these	slides	on	SpeakerDeck
h5ps://speakerdeck.com/dus-nwhi5le
http://www.appdynamics.com/

More Related Content

PDF
Mobile Performance Testing Crash Course
PPTX
How to add a new hypervisor to CloudStack:Lessons learned from Hyper-V effort
PDF
Html5 security
PPTX
Noam Kfir - There is no Java Script - code.talks 2015
PDF
Clase 2 Tipos de imagen
PDF
Targeting Your Audience: Data Visualization to Communicate Data Insights
DOC
Caritas krijgt 3.100 euro per in België hervestigd persoon
PPTX
Proyecto
Mobile Performance Testing Crash Course
How to add a new hypervisor to CloudStack:Lessons learned from Hyper-V effort
Html5 security
Noam Kfir - There is no Java Script - code.talks 2015
Clase 2 Tipos de imagen
Targeting Your Audience: Data Visualization to Communicate Data Insights
Caritas krijgt 3.100 euro per in België hervestigd persoon
Proyecto

Viewers also liked (8)

PDF
Fenasucro & Acrocana
PDF
Final salary pension transfer the pension review service
PDF
Outils de cartographie numérique
PPTX
Советы по продуктивности от разработчиков системы учета рабочего времени сотр...
DOC
Yanina Wickmayer met noodmaatregel uit proces gehouden
DOC
Krantenredactie loog over 2 artikels
PPTX
Els valors de la pràctica clínica - Jordi Varela
PPTX
Justbeenpaid.com Presentation
Fenasucro & Acrocana
Final salary pension transfer the pension review service
Outils de cartographie numérique
Советы по продуктивности от разработчиков системы учета рабочего времени сотр...
Yanina Wickmayer met noodmaatregel uit proces gehouden
Krantenredactie loog over 2 artikels
Els valors de la pràctica clínica - Jordi Varela
Justbeenpaid.com Presentation
Ad

Similar to Dustin Whittle - Performance Testing Crash Course - code.talks 2015 (20)

PDF
Performance testing crash course (Dustin Whittle)
PDF
We started with RoR, C++, C#, nodeJS and... at the end we chose GO - Maurizio...
PDF
Load testing with Blitz
PDF
WebPerformance: Why and How? – Stefan Wintermeyer
PPTX
Failure Self Defense: Defend your App against failures in a (micro) services ...
PDF
Naked Performance With Clojure
PDF
Introduction to Marionette Collective
PPTX
Effective SOA
PDF
Techniques for Agile Performance Testing
PDF
Managing Thousands of Spark Workers in Cloud Environment with Yuhao Zheng and...
ODP
Otimizando seu projeto Rails
PDF
Docker tips-for-java-developers
DOCX
Yet another node vs php
PDF
Speed Up Testing with Monitoring Tools
PDF
Introduction to performance tuning perl web applications
ODP
Faster on Rails
PPTX
When it Absolutely, Positively, Has to be There: Reliability Guarantees in Ka...
PPT
Azure Cloud Patterns
PDF
Queue your work
PDF
Stress Test as a Culture
Performance testing crash course (Dustin Whittle)
We started with RoR, C++, C#, nodeJS and... at the end we chose GO - Maurizio...
Load testing with Blitz
WebPerformance: Why and How? – Stefan Wintermeyer
Failure Self Defense: Defend your App against failures in a (micro) services ...
Naked Performance With Clojure
Introduction to Marionette Collective
Effective SOA
Techniques for Agile Performance Testing
Managing Thousands of Spark Workers in Cloud Environment with Yuhao Zheng and...
Otimizando seu projeto Rails
Docker tips-for-java-developers
Yet another node vs php
Speed Up Testing with Monitoring Tools
Introduction to performance tuning perl web applications
Faster on Rails
When it Absolutely, Positively, Has to be There: Reliability Guarantees in Ka...
Azure Cloud Patterns
Queue your work
Stress Test as a Culture
Ad

More from AboutYouGmbH (20)

PDF
Tech talk 01.06.2017
PDF
Retention Strategies in Mobile E-Commerce
PDF
Rethinking Fashion E-Commerce
PDF
ABOUT YOU get on board
PDF
Niels Leenheer - Weird browsers - code.talks 2015
PDF
Dennis Benkert & Matthias Lübken - Patterns in a containerized world? - code....
PDF
Stefan Richter - Writing simple, readable and robust code: Examples in Java, ...
PDF
Lars Jankowfsky - Learn or Die - code.talks 2015
PDF
Dr. Jeremias Rößler - Wenn Affen Testen - Das Ende der Bananensoftware - code...
PDF
Zeljko Kvesic - Scrum in verteilten Teams / Agil über die Landesgrenzen - cod...
PDF
Uwe Friedrichsen - CRDT und mehr - über extreme Verfügbarkeit und selbstheile...
PDF
Kai Voigt - Big Data zum Anfassen - code.talks 2015
PDF
Dr. Andreas Lattner - Aufsetzen skalierbarer Prognose- und Analysedienste mit...
PDF
Marcel Hild - Spryker (e)commerce framework als Alternative zu traditioneller...
PDF
Wolfram Kriesing - EcmaScript6 for real - code.talks 2015
PDF
Stefanie Grewenig & Johannes Thönes - Internet ausdrucken mit JavaScript - c...
PDF
Alex Korotkikh - From 0 to N: Lessons Learned - code.talks 2015
PDF
Christian Haider & Helge Nowak - Mehr Demokratie durch Haushaltstransparenz ...
PDF
Bernhard Wick - appserver.io - code.talks 2015
PDF
Moritz Siuts & Robert von Massow - Data Pipeline mit Apache Kafka - code.tal...
Tech talk 01.06.2017
Retention Strategies in Mobile E-Commerce
Rethinking Fashion E-Commerce
ABOUT YOU get on board
Niels Leenheer - Weird browsers - code.talks 2015
Dennis Benkert & Matthias Lübken - Patterns in a containerized world? - code....
Stefan Richter - Writing simple, readable and robust code: Examples in Java, ...
Lars Jankowfsky - Learn or Die - code.talks 2015
Dr. Jeremias Rößler - Wenn Affen Testen - Das Ende der Bananensoftware - code...
Zeljko Kvesic - Scrum in verteilten Teams / Agil über die Landesgrenzen - cod...
Uwe Friedrichsen - CRDT und mehr - über extreme Verfügbarkeit und selbstheile...
Kai Voigt - Big Data zum Anfassen - code.talks 2015
Dr. Andreas Lattner - Aufsetzen skalierbarer Prognose- und Analysedienste mit...
Marcel Hild - Spryker (e)commerce framework als Alternative zu traditioneller...
Wolfram Kriesing - EcmaScript6 for real - code.talks 2015
Stefanie Grewenig & Johannes Thönes - Internet ausdrucken mit JavaScript - c...
Alex Korotkikh - From 0 to N: Lessons Learned - code.talks 2015
Christian Haider & Helge Nowak - Mehr Demokratie durch Haushaltstransparenz ...
Bernhard Wick - appserver.io - code.talks 2015
Moritz Siuts & Robert von Massow - Data Pipeline mit Apache Kafka - code.tal...

Recently uploaded (20)

PPTX
Mathew Digital SEO Checklist Guidlines 2025
PPTX
t_and_OpenAI_Combined_two_pressentations
PDF
Introduction to the IoT system, how the IoT system works
PPT
FIRE PREVENTION AND CONTROL PLAN- LUS.FM.MQ.OM.UTM.PLN.00014.ppt
PPTX
Database Information System - Management Information System
DOC
Rose毕业证学历认证,利物浦约翰摩尔斯大学毕业证国外本科毕业证
PPTX
artificial intelligence overview of it and more
PDF
📍 LABUAN4D EXCLUSIVE SERVER STAR GAMING ASIA NO.1 TERPOPULER DI INDONESIA ! 🌟
PDF
The Ikigai Template _ Recalibrate How You Spend Your Time.pdf
PDF
FINAL CALL-6th International Conference on Networks & IOT (NeTIOT 2025)
PPTX
Introduction to cybersecurity and digital nettiquette
PDF
mera desh ae watn.(a source of motivation and patriotism to the youth of the ...
PDF
Smart Home Technology for Health Monitoring (www.kiu.ac.ug)
PPT
415456121-Jiwratrwecdtwfdsfwgdwedvwe dbwsdjsadca-EVN.ppt
PDF
Session 1 (Week 1)fghjmgfdsfgthyjkhfdsadfghjkhgfdsa
PDF
Exploring VPS Hosting Trends for SMBs in 2025
PPT
Design_with_Watersergyerge45hrbgre4top (1).ppt
PPT
250152213-Excitation-SystemWERRT (1).ppt
PPTX
1402_iCSC_-_RESTful_Web_APIs_--_Josef_Hammer.pptx
PPTX
Power Point - Lesson 3_2.pptx grad school presentation
Mathew Digital SEO Checklist Guidlines 2025
t_and_OpenAI_Combined_two_pressentations
Introduction to the IoT system, how the IoT system works
FIRE PREVENTION AND CONTROL PLAN- LUS.FM.MQ.OM.UTM.PLN.00014.ppt
Database Information System - Management Information System
Rose毕业证学历认证,利物浦约翰摩尔斯大学毕业证国外本科毕业证
artificial intelligence overview of it and more
📍 LABUAN4D EXCLUSIVE SERVER STAR GAMING ASIA NO.1 TERPOPULER DI INDONESIA ! 🌟
The Ikigai Template _ Recalibrate How You Spend Your Time.pdf
FINAL CALL-6th International Conference on Networks & IOT (NeTIOT 2025)
Introduction to cybersecurity and digital nettiquette
mera desh ae watn.(a source of motivation and patriotism to the youth of the ...
Smart Home Technology for Health Monitoring (www.kiu.ac.ug)
415456121-Jiwratrwecdtwfdsfwgdwedvwe dbwsdjsadca-EVN.ppt
Session 1 (Week 1)fghjmgfdsfgthyjkhfdsadfghjkhgfdsa
Exploring VPS Hosting Trends for SMBs in 2025
Design_with_Watersergyerge45hrbgre4top (1).ppt
250152213-Excitation-SystemWERRT (1).ppt
1402_iCSC_-_RESTful_Web_APIs_--_Josef_Hammer.pptx
Power Point - Lesson 3_2.pptx grad school presentation

Dustin Whittle - Performance Testing Crash Course - code.talks 2015