Load testing, Lessons learnt and Loadzen - Martin Buhr at DevTank - 31st January 2012
-
Upload
loadzen -
Category
Technology
-
view
726 -
download
0
description
Transcript of Load testing, Lessons learnt and Loadzen - Martin Buhr at DevTank - 31st January 2012
![Page 1: Load testing, Lessons learnt and Loadzen - Martin Buhr at DevTank - 31st January 2012](https://reader033.fdocuments.us/reader033/viewer/2022060120/5591bf111a28ab9b5c8b4695/html5/thumbnails/1.jpg)
Preparing for... inclement
weather
Martin Buhr
@martinbuhr
http://loadzen.com
![Page 2: Load testing, Lessons learnt and Loadzen - Martin Buhr at DevTank - 31st January 2012](https://reader033.fdocuments.us/reader033/viewer/2022060120/5591bf111a28ab9b5c8b4695/html5/thumbnails/2.jpg)
WHO HERE HAS LOAD
TESTED THEIR APP?
So...
![Page 3: Load testing, Lessons learnt and Loadzen - Martin Buhr at DevTank - 31st January 2012](https://reader033.fdocuments.us/reader033/viewer/2022060120/5591bf111a28ab9b5c8b4695/html5/thumbnails/3.jpg)
For those that haven’t
(or don’t know)
![Page 4: Load testing, Lessons learnt and Loadzen - Martin Buhr at DevTank - 31st January 2012](https://reader033.fdocuments.us/reader033/viewer/2022060120/5591bf111a28ab9b5c8b4695/html5/thumbnails/4.jpg)
Many people may tell you...
![Page 5: Load testing, Lessons learnt and Loadzen - Martin Buhr at DevTank - 31st January 2012](https://reader033.fdocuments.us/reader033/viewer/2022060120/5591bf111a28ab9b5c8b4695/html5/thumbnails/5.jpg)
That these are your problem...
(etc)
![Page 6: Load testing, Lessons learnt and Loadzen - Martin Buhr at DevTank - 31st January 2012](https://reader033.fdocuments.us/reader033/viewer/2022060120/5591bf111a28ab9b5c8b4695/html5/thumbnails/6.jpg)
And they really can cause
trouble...
![Page 7: Load testing, Lessons learnt and Loadzen - Martin Buhr at DevTank - 31st January 2012](https://reader033.fdocuments.us/reader033/viewer/2022060120/5591bf111a28ab9b5c8b4695/html5/thumbnails/7.jpg)
We know, it happened to us:
Jive.ly
![Page 8: Load testing, Lessons learnt and Loadzen - Martin Buhr at DevTank - 31st January 2012](https://reader033.fdocuments.us/reader033/viewer/2022060120/5591bf111a28ab9b5c8b4695/html5/thumbnails/8.jpg)
Day 1:
Launch
![Page 9: Load testing, Lessons learnt and Loadzen - Martin Buhr at DevTank - 31st January 2012](https://reader033.fdocuments.us/reader033/viewer/2022060120/5591bf111a28ab9b5c8b4695/html5/thumbnails/9.jpg)
Day 2:
Sarky email to TechCrunch
![Page 10: Load testing, Lessons learnt and Loadzen - Martin Buhr at DevTank - 31st January 2012](https://reader033.fdocuments.us/reader033/viewer/2022060120/5591bf111a28ab9b5c8b4695/html5/thumbnails/10.jpg)
Day 3:
#1 on TechCrunch UK
![Page 11: Load testing, Lessons learnt and Loadzen - Martin Buhr at DevTank - 31st January 2012](https://reader033.fdocuments.us/reader033/viewer/2022060120/5591bf111a28ab9b5c8b4695/html5/thumbnails/11.jpg)
Day 3:
#1 on TechCrunch US
![Page 12: Load testing, Lessons learnt and Loadzen - Martin Buhr at DevTank - 31st January 2012](https://reader033.fdocuments.us/reader033/viewer/2022060120/5591bf111a28ab9b5c8b4695/html5/thumbnails/12.jpg)
Day 3:
#1 on Digg
![Page 13: Load testing, Lessons learnt and Loadzen - Martin Buhr at DevTank - 31st January 2012](https://reader033.fdocuments.us/reader033/viewer/2022060120/5591bf111a28ab9b5c8b4695/html5/thumbnails/13.jpg)
Shit.
![Page 14: Load testing, Lessons learnt and Loadzen - Martin Buhr at DevTank - 31st January 2012](https://reader033.fdocuments.us/reader033/viewer/2022060120/5591bf111a28ab9b5c8b4695/html5/thumbnails/14.jpg)
So what happened?
To Jive.ly:
• Traffic exploded
• Sign-ups exploded
• In-bound links exploded
• Rankings shot up
• People were buzzing
• Free press!
![Page 15: Load testing, Lessons learnt and Loadzen - Martin Buhr at DevTank - 31st January 2012](https://reader033.fdocuments.us/reader033/viewer/2022060120/5591bf111a28ab9b5c8b4695/html5/thumbnails/15.jpg)
So what really happened?
![Page 16: Load testing, Lessons learnt and Loadzen - Martin Buhr at DevTank - 31st January 2012](https://reader033.fdocuments.us/reader033/viewer/2022060120/5591bf111a28ab9b5c8b4695/html5/thumbnails/16.jpg)
We lost users
![Page 17: Load testing, Lessons learnt and Loadzen - Martin Buhr at DevTank - 31st January 2012](https://reader033.fdocuments.us/reader033/viewer/2022060120/5591bf111a28ab9b5c8b4695/html5/thumbnails/17.jpg)
They lost confidence
![Page 18: Load testing, Lessons learnt and Loadzen - Martin Buhr at DevTank - 31st January 2012](https://reader033.fdocuments.us/reader033/viewer/2022060120/5591bf111a28ab9b5c8b4695/html5/thumbnails/18.jpg)
We lost opportunities
![Page 19: Load testing, Lessons learnt and Loadzen - Martin Buhr at DevTank - 31st January 2012](https://reader033.fdocuments.us/reader033/viewer/2022060120/5591bf111a28ab9b5c8b4695/html5/thumbnails/19.jpg)
And it was expensive...
![Page 20: Load testing, Lessons learnt and Loadzen - Martin Buhr at DevTank - 31st January 2012](https://reader033.fdocuments.us/reader033/viewer/2022060120/5591bf111a28ab9b5c8b4695/html5/thumbnails/20.jpg)
:-(
![Page 21: Load testing, Lessons learnt and Loadzen - Martin Buhr at DevTank - 31st January 2012](https://reader033.fdocuments.us/reader033/viewer/2022060120/5591bf111a28ab9b5c8b4695/html5/thumbnails/21.jpg)
But that isn’t the general
case
![Page 22: Load testing, Lessons learnt and Loadzen - Martin Buhr at DevTank - 31st January 2012](https://reader033.fdocuments.us/reader033/viewer/2022060120/5591bf111a28ab9b5c8b4695/html5/thumbnails/22.jpg)
You aren’t a C10K site
![Page 23: Load testing, Lessons learnt and Loadzen - Martin Buhr at DevTank - 31st January 2012](https://reader033.fdocuments.us/reader033/viewer/2022060120/5591bf111a28ab9b5c8b4695/html5/thumbnails/23.jpg)
You’re not trying to piss off
Anonymous
![Page 24: Load testing, Lessons learnt and Loadzen - Martin Buhr at DevTank - 31st January 2012](https://reader033.fdocuments.us/reader033/viewer/2022060120/5591bf111a28ab9b5c8b4695/html5/thumbnails/24.jpg)
You’re not on TechCrunch
(yet)
![Page 25: Load testing, Lessons learnt and Loadzen - Martin Buhr at DevTank - 31st January 2012](https://reader033.fdocuments.us/reader033/viewer/2022060120/5591bf111a28ab9b5c8b4695/html5/thumbnails/25.jpg)
Remember these?
(etc)
![Page 26: Load testing, Lessons learnt and Loadzen - Martin Buhr at DevTank - 31st January 2012](https://reader033.fdocuments.us/reader033/viewer/2022060120/5591bf111a28ab9b5c8b4695/html5/thumbnails/26.jpg)
They don’t matter... yet
But these guys do...
![Page 27: Load testing, Lessons learnt and Loadzen - Martin Buhr at DevTank - 31st January 2012](https://reader033.fdocuments.us/reader033/viewer/2022060120/5591bf111a28ab9b5c8b4695/html5/thumbnails/27.jpg)
ANYONE THAT GENERATES
TRAFFIC THAT YOU DON’T
EXPECT BUT REALLY
WANT
![Page 28: Load testing, Lessons learnt and Loadzen - Martin Buhr at DevTank - 31st January 2012](https://reader033.fdocuments.us/reader033/viewer/2022060120/5591bf111a28ab9b5c8b4695/html5/thumbnails/28.jpg)
You may ask yourself:
Why should I care?
![Page 29: Load testing, Lessons learnt and Loadzen - Martin Buhr at DevTank - 31st January 2012](https://reader033.fdocuments.us/reader033/viewer/2022060120/5591bf111a28ab9b5c8b4695/html5/thumbnails/29.jpg)
Why should I care?
• Your database:
– Shared SQL server
– Unoptimised queries
– Unoptimised schemas
– Unnecessary requests
![Page 30: Load testing, Lessons learnt and Loadzen - Martin Buhr at DevTank - 31st January 2012](https://reader033.fdocuments.us/reader033/viewer/2022060120/5591bf111a28ab9b5c8b4695/html5/thumbnails/30.jpg)
Why should I care?
• Your code:
– Nested nested loops
– Inefficient iterators
– Large in-memory objects
– About a million other bad practices and shortcuts
![Page 31: Load testing, Lessons learnt and Loadzen - Martin Buhr at DevTank - 31st January 2012](https://reader033.fdocuments.us/reader033/viewer/2022060120/5591bf111a28ab9b5c8b4695/html5/thumbnails/31.jpg)
Why should I care?
• Your interface:
– Large images
– On the fly processing
– Slow JavaScript
– Slow web services
![Page 32: Load testing, Lessons learnt and Loadzen - Martin Buhr at DevTank - 31st January 2012](https://reader033.fdocuments.us/reader033/viewer/2022060120/5591bf111a28ab9b5c8b4695/html5/thumbnails/32.jpg)
All of these are exposed and
get exponentially worse the
higher your traffic
![Page 33: Load testing, Lessons learnt and Loadzen - Martin Buhr at DevTank - 31st January 2012](https://reader033.fdocuments.us/reader033/viewer/2022060120/5591bf111a28ab9b5c8b4695/html5/thumbnails/33.jpg)
For start-ups, inefficient
code is expensive
![Page 34: Load testing, Lessons learnt and Loadzen - Martin Buhr at DevTank - 31st January 2012](https://reader033.fdocuments.us/reader033/viewer/2022060120/5591bf111a28ab9b5c8b4695/html5/thumbnails/34.jpg)
For developers, it’s just
embarrassing...
![Page 35: Load testing, Lessons learnt and Loadzen - Martin Buhr at DevTank - 31st January 2012](https://reader033.fdocuments.us/reader033/viewer/2022060120/5591bf111a28ab9b5c8b4695/html5/thumbnails/35.jpg)
Which is why we load test
:-)
![Page 36: Load testing, Lessons learnt and Loadzen - Martin Buhr at DevTank - 31st January 2012](https://reader033.fdocuments.us/reader033/viewer/2022060120/5591bf111a28ab9b5c8b4695/html5/thumbnails/36.jpg)
Oh yeah...
• Your users get your service
• You make the most from your opportunities
• Users spend more on responsive sites
• You improve your bottom line
And best of all:
• You become a better developer
![Page 37: Load testing, Lessons learnt and Loadzen - Martin Buhr at DevTank - 31st January 2012](https://reader033.fdocuments.us/reader033/viewer/2022060120/5591bf111a28ab9b5c8b4695/html5/thumbnails/37.jpg)
Learnt that the hard way...
![Page 38: Load testing, Lessons learnt and Loadzen - Martin Buhr at DevTank - 31st January 2012](https://reader033.fdocuments.us/reader033/viewer/2022060120/5591bf111a28ab9b5c8b4695/html5/thumbnails/38.jpg)
That got me thinking...
Can I build my own?
![Page 39: Load testing, Lessons learnt and Loadzen - Martin Buhr at DevTank - 31st January 2012](https://reader033.fdocuments.us/reader033/viewer/2022060120/5591bf111a28ab9b5c8b4695/html5/thumbnails/39.jpg)
And that became Loadzen (let’s take a look...)
Yes I can...
![Page 40: Load testing, Lessons learnt and Loadzen - Martin Buhr at DevTank - 31st January 2012](https://reader033.fdocuments.us/reader033/viewer/2022060120/5591bf111a28ab9b5c8b4695/html5/thumbnails/40.jpg)
![Page 41: Load testing, Lessons learnt and Loadzen - Martin Buhr at DevTank - 31st January 2012](https://reader033.fdocuments.us/reader033/viewer/2022060120/5591bf111a28ab9b5c8b4695/html5/thumbnails/41.jpg)
What is it?
• Load testing in the cloud
• Multi-scenario, weighted testing
• Real-time results
• Chrome plug-in
• Pay as you test
![Page 42: Load testing, Lessons learnt and Loadzen - Martin Buhr at DevTank - 31st January 2012](https://reader033.fdocuments.us/reader033/viewer/2022060120/5591bf111a28ab9b5c8b4695/html5/thumbnails/42.jpg)
What’s it built in?
• Django (FCGI)
• MySQL
• Lighttpd
• RabbitMQ
• Pyro
• TornadIO
• SocketIO
![Page 43: Load testing, Lessons learnt and Loadzen - Martin Buhr at DevTank - 31st January 2012](https://reader033.fdocuments.us/reader033/viewer/2022060120/5591bf111a28ab9b5c8b4695/html5/thumbnails/43.jpg)
What’s it really built in?
![Page 44: Load testing, Lessons learnt and Loadzen - Martin Buhr at DevTank - 31st January 2012](https://reader033.fdocuments.us/reader033/viewer/2022060120/5591bf111a28ab9b5c8b4695/html5/thumbnails/44.jpg)
Python. Pure and Simple.
![Page 45: Load testing, Lessons learnt and Loadzen - Martin Buhr at DevTank - 31st January 2012](https://reader033.fdocuments.us/reader033/viewer/2022060120/5591bf111a28ab9b5c8b4695/html5/thumbnails/45.jpg)
Look! A diagram!
![Page 46: Load testing, Lessons learnt and Loadzen - Martin Buhr at DevTank - 31st January 2012](https://reader033.fdocuments.us/reader033/viewer/2022060120/5591bf111a28ab9b5c8b4695/html5/thumbnails/46.jpg)
![Page 47: Load testing, Lessons learnt and Loadzen - Martin Buhr at DevTank - 31st January 2012](https://reader033.fdocuments.us/reader033/viewer/2022060120/5591bf111a28ab9b5c8b4695/html5/thumbnails/47.jpg)
And what did we learn?
![Page 48: Load testing, Lessons learnt and Loadzen - Martin Buhr at DevTank - 31st January 2012](https://reader033.fdocuments.us/reader033/viewer/2022060120/5591bf111a28ab9b5c8b4695/html5/thumbnails/48.jpg)
Log everything
• Dynamic RPC is hard
• Black box code hurts, open up your systems
• When your site breaks (and it will) – you know why
![Page 49: Load testing, Lessons learnt and Loadzen - Martin Buhr at DevTank - 31st January 2012](https://reader033.fdocuments.us/reader033/viewer/2022060120/5591bf111a28ab9b5c8b4695/html5/thumbnails/49.jpg)
Real-time is awesome
• Event-based dev changes the way you think
• Queues make everything seem scalable
• But they introduce their own problems!
– Queue -> Socket -> Browser is a killer on your system
– Flow control and timing can be issues
![Page 50: Load testing, Lessons learnt and Loadzen - Martin Buhr at DevTank - 31st January 2012](https://reader033.fdocuments.us/reader033/viewer/2022060120/5591bf111a28ab9b5c8b4695/html5/thumbnails/50.jpg)
UI: Make it simple, stupid
• If your UI sucks, your code is useless
• It’s not someone else’s problem
• If it makes your users life easier, it’s worth it.
• Always think – can I make it simpler?
![Page 51: Load testing, Lessons learnt and Loadzen - Martin Buhr at DevTank - 31st January 2012](https://reader033.fdocuments.us/reader033/viewer/2022060120/5591bf111a28ab9b5c8b4695/html5/thumbnails/51.jpg)
Always think scale
• Don’t build for it, but think about it
– Cache your interface
– Use a CDN
– Make requests quick: think async
– Make sure your database is fast
– Use the right tool for the job!
![Page 52: Load testing, Lessons learnt and Loadzen - Martin Buhr at DevTank - 31st January 2012](https://reader033.fdocuments.us/reader033/viewer/2022060120/5591bf111a28ab9b5c8b4695/html5/thumbnails/52.jpg)
Pragmatism pays off
• Don’t pick tech because it’s hot
• Pick it because it solves your problem:
– Elegantly
– Efficiently
• Architect for extensibility
– You’ll deal with it sooner or later
![Page 53: Load testing, Lessons learnt and Loadzen - Martin Buhr at DevTank - 31st January 2012](https://reader033.fdocuments.us/reader033/viewer/2022060120/5591bf111a28ab9b5c8b4695/html5/thumbnails/53.jpg)
Measure Everything.
![Page 54: Load testing, Lessons learnt and Loadzen - Martin Buhr at DevTank - 31st January 2012](https://reader033.fdocuments.us/reader033/viewer/2022060120/5591bf111a28ab9b5c8b4695/html5/thumbnails/54.jpg)
Be inquisitive
• Talk to your users
• Love them (not too much!)
• They are the single most important thing to your company, react.
– Even if you can’t fix it
![Page 55: Load testing, Lessons learnt and Loadzen - Martin Buhr at DevTank - 31st January 2012](https://reader033.fdocuments.us/reader033/viewer/2022060120/5591bf111a28ab9b5c8b4695/html5/thumbnails/55.jpg)
And lastly...
![Page 56: Load testing, Lessons learnt and Loadzen - Martin Buhr at DevTank - 31st January 2012](https://reader033.fdocuments.us/reader033/viewer/2022060120/5591bf111a28ab9b5c8b4695/html5/thumbnails/56.jpg)
make stuff, be awesome.
(that’s our motto, btw)