Understanding your system
Andreas Bjärlestam 2016-03-30
_____ .__.__ / _ \ ____ |__| | ____ / /_\ \ / ___\| | | _/ __ \ / | \/ /_/ > | |_\ ___/ \____|__ /\___ /|__|____/\___ > \//_____/ \/ _____ ______ ____________/ ____\___________ _____ _____ ____ ____ ____ \____ \_/ __ \_ __ \ __\/ _ \_ __ \/ \\__ \ / \_/ ___\/ __ \ | |_> > ___/| | \/| | ( <_> ) | \/ Y Y \/ __ \| | \ \__\ ___/ | __/ \___ >__| |__| \____/|__| |__|_| (____ /___| /\___ >___ > |__| \/ \/ \/ \/ \/ \/ __ __ .__ _/ |_ ____ _______/ |_|__| ____ ____ \ __\/ __ \ / ___/\ __\ |/ \ / ___\ | | \ ___/ \___ \ | | | | | \/ /_/ > |__| \___ >____ > |__| |__|___| /\___ / \/ \/ \//_____/
Do you know on top of your head:• How many req/s your system can handle?
• What response time it has?
• How it scales?
• What the bottlenecks are?
• How stable it is over time?
Stop seeing performance tests as verification
It should be an integrated part of your development cycle
Continuously analyze your system
siege
• Quick and simple• Instant visual feedback• Good summary of most important metrics• Good enough for most scenarios
= You can work in quick iterations
When replacing a system
Get access logs from the old system
Analyze which parts of the system that generate the most load
Plot them over time to get a feeling for peaks and average load
If you replay access logs against your system with siege you can
gain a lot of insights and find problems like unhandled urls,
unnecessary redirects etc
Build a urls.txt file
Based on traffic model
Fill a file with urls that represent your expected traffic, one url per line
Think about the proportions of different types of urls
Build a urls.txt file
http://example.comhttp://example.com/user/stinahttp://example.com/user/olofhttp://example.com/user/svenhttp://example.com/user/sivhttp://example.com/user/ellenhttp://example.com/country/swedenhttp://example.com/country/norway
Build a urls.txt file
You can send POST as well
http://example.com/user/stina POST age=23http://example.com/user/stina POST a=1&b=2http://example.com/user/stina POST <./stina.txt
Put your system under continuous load from your first commit
Keep an eye on system metrics every now and then
TLDR
Stop doing performance tests like its 1999Put your system under load from day 1
Run tests interactively, be creativeGain understanding
AWS + tmux + siege is awesome!
tmux cheat sheet
> tmux new -s loadtest starts a new session named loadtest
ctrl-b + d exits session
> tmux list-sessions lists all current sessions
> tmux attach -t loadtest attaches to the session named loadtest
Top Related