+ All Categories
Home > Software > Load-testing 101 for Startups with Artillery.io

Load-testing 101 for Startups with Artillery.io

Date post: 14-Apr-2017
Category:
Upload: hassy-veldstra
View: 1,973 times
Download: 1 times
Share this document with a friend
27
Load Testing for Startups with artillery.io Hassy Veldstra <[email protected] > @hveldstra
Transcript
Page 1: Load-testing 101 for Startups with Artillery.io

Load Testing for Startups with artillery.io

Hassy Veldstra <[email protected]>@hveldstra

Page 2: Load-testing 101 for Startups with Artillery.io

Story

Page 3: Load-testing 101 for Startups with Artillery.io

• Simulating a lot of users to see how your application behaves

Load testing

Page 4: Load-testing 101 for Startups with Artillery.io

• Simulating a lot of users to see how your application behaves• Examples:• Blog: a story on the front page of Reddit• Dice.fm: Beyoncé’s gig announced• Deliveroo: 6-9pm every day• ASOS: Black Friday

Load testing

Page 5: Load-testing 101 for Startups with Artillery.io

Goals• Analyze performance

• How fast is it / Is it fast enough?• Soak testing – finding memory leaks and other resource leaks

Page 6: Load-testing 101 for Startups with Artillery.io

Goals• Analyze performance

• How fast is it / Is it fast enough?• Soak testing – finding memory leaks and other resource leaks

• Analyze reliability• Does it degrade gracefully under stress?• Monitoring and alerting working as intended?

Page 7: Load-testing 101 for Startups with Artillery.io

Goals• Analyze performance

• How fast is it / Is it fast enough?• Soak testing – finding memory leaks and other resource leaks

• Analyze reliability• Does it degrade gracefully under stress?• Monitoring and alerting working as intended?

• Capacity testing• Can we handle the projected load with acceptable

performance with the architecture / hardware we have?

Page 8: Load-testing 101 for Startups with Artillery.io

Goals• Analyze performance

• How fast is it / Is it fast enough?• Soak testing – finding memory leaks and other resource leaks

• Analyze reliability• Does it degrade gracefully under stress?• Monitoring and alerting working as intended?

• Capacity testing• Can we handle the projected load with acceptable performance with the

architecture / hardware we have?• Analyze scalability

• How does the system scale if we add more servers / upgrade the hardware? Is it linear? Where are the bottlenecks?

Page 9: Load-testing 101 for Startups with Artillery.io

1. Best case latency2. 99th percentile latency under load3. Throughput under load

Performance Metrics

Page 10: Load-testing 101 for Startups with Artillery.io

Backend Performance

Page 11: Load-testing 101 for Startups with Artillery.io

Backend Performance1. Network performance• How long it takes for HTML/CSS/JS to

download

Page 12: Load-testing 101 for Startups with Artillery.io

Backend Performance1. Network performance• How long it takes for HTML/CSS/JS to

download2. Front-end performance• How long it takes for it to render and display• How it’s rendered and displayed (UI)

Page 13: Load-testing 101 for Startups with Artillery.io

Backend Performance1. Network performance• How long it takes for HTML/CSS/JS to download

2. Front-end performance• How long it takes for it to render and display• How it’s rendered and displayed (UI)

3. Backend performance• How long it takes for the server to process a

request

Page 14: Load-testing 101 for Startups with Artillery.io

• npm install –g artillery• artilery run my_test_script.json

How Artillery Works

Page 15: Load-testing 101 for Startups with Artillery.io

• npm install –g artillery• artilery run my_test_script.json• A test script is:

1. One or more scenarios2. One or more load phases

How Artillery Works

Page 16: Load-testing 101 for Startups with Artillery.io

• ASOS:• Load the homepage• Run a search with some keyword• Repeat three times:

• Pick a result at random and load the details for that product• Add the product to basket

• Go to checkout

Scenarios

Page 17: Load-testing 101 for Startups with Artillery.io

1. Create 10 virtual users every second for 3 minutes (warm up)

2. Ramp up to 50 virtual users a second over another 3 minutes

3. Run at 50 virtual users a second for 25 minutes

Load Phases

Page 18: Load-testing 101 for Startups with Artillery.io

2 hour plan

Page 19: Load-testing 101 for Startups with Artillery.io

2 hour plan1. Get an APM tool (e.g. New Relic)

Page 20: Load-testing 101 for Startups with Artillery.io

2 hour plan1. Get an APM tool (e.g. New Relic)2. Install an error/crash-reporting (e.g. GetSentry)

Page 21: Load-testing 101 for Startups with Artillery.io

2 hour plan1. Get an APM tool (e.g. New Relic)2. Install an error/crash-reporting (e.g. GetSentry) 3. Write a simple Artillery script (just one happy-

path from the app)

Page 22: Load-testing 101 for Startups with Artillery.io

2 hour plan1. Get an APM tool (e.g. New Relic)2. Install an error/crash-reporting (e.g. GetSentry) 3. Write a simple Artillery script (just one happy-

path from the app)4. Run that against dev/testing environment at a

low load

Page 23: Load-testing 101 for Startups with Artillery.io

2 hour plan1. Get an APM tool (e.g. New Relic)2. Install an error/crash-reporting (e.g. GetSentry) 3. Write a simple Artillery script (just one happy-

path from the app)4. Run that against dev/testing environment at a

low load5. Success!

Page 24: Load-testing 101 for Startups with Artillery.io

2 hour plan1. Get an APM tool (e.g. New Relic)2. Install an error/crash-reporting (e.g. GetSentry) 3. Write a simple Artillery script (just one happy-path

from the app)4. Run that against dev/testing environment at a low

load5. Success!6. Ramp up gradually until the traffic is at the level

you need it to be

Page 25: Load-testing 101 for Startups with Artillery.io

2 hour plan1. Any problems? Great. Now you know and can

fix them.2. No problems? Great. Now you know.

Page 26: Load-testing 101 for Startups with Artillery.io

2 hour plan1. Bonus: add a job to your CI to run the test

every day

Page 27: Load-testing 101 for Startups with Artillery.io

Q&A


Recommended