the Flood Preparing for your WordPress site for a How to ... · Blazemeter - Visualizes the data...

40
Preparing for the Flood How to Load Test to Prepare your WordPress site for a viral event.

Transcript of the Flood Preparing for your WordPress site for a How to ... · Blazemeter - Visualizes the data...

Page 1: the Flood Preparing for your WordPress site for a How to ... · Blazemeter - Visualizes the data (can also execute load tests) jMeter - Software to help you build and tweak scenarios

Preparing for the FloodHow to Load Test to Prepare your WordPress site for a viral event.

Page 2: the Flood Preparing for your WordPress site for a How to ... · Blazemeter - Visualizes the data (can also execute load tests) jMeter - Software to help you build and tweak scenarios

Who is this idiot? My name is Robert Li.I’m a Solutions Engineer for WP Engine.

I’ve founded 3 startups and exited 1.I have a 3 year old teacup pomeranian named Chelsey.I am a long suffering Knicks fan.I love making WordPress do weird, wonderful things.

Page 3: the Flood Preparing for your WordPress site for a How to ... · Blazemeter - Visualizes the data (can also execute load tests) jMeter - Software to help you build and tweak scenarios

Takeaways1. Solutions2. Why Load Test?3. What do you need?4. (Pray to the Demo Gods)5. Demo6. How do you prepare?7. Let’s take a look

Degree of Difficulty: Nerd

Page 4: the Flood Preparing for your WordPress site for a How to ... · Blazemeter - Visualizes the data (can also execute load tests) jMeter - Software to help you build and tweak scenarios
Page 5: the Flood Preparing for your WordPress site for a How to ... · Blazemeter - Visualizes the data (can also execute load tests) jMeter - Software to help you build and tweak scenarios
Page 6: the Flood Preparing for your WordPress site for a How to ... · Blazemeter - Visualizes the data (can also execute load tests) jMeter - Software to help you build and tweak scenarios
Page 7: the Flood Preparing for your WordPress site for a How to ... · Blazemeter - Visualizes the data (can also execute load tests) jMeter - Software to help you build and tweak scenarios
Page 8: the Flood Preparing for your WordPress site for a How to ... · Blazemeter - Visualizes the data (can also execute load tests) jMeter - Software to help you build and tweak scenarios
Page 9: the Flood Preparing for your WordPress site for a How to ... · Blazemeter - Visualizes the data (can also execute load tests) jMeter - Software to help you build and tweak scenarios

The problem

Your Site

You’ve created a site with lots of cool features, that has a great user experience, and that you’ve spend tonne’s of money (or time) on.

Your Hosting

You’ve signed up to some hosting that will fit your new site, in its current state.

It works great!

The Flood

You send a shirt to an influencer, they wear it, you actually start selling stuff, which is great!

Then your site goes down.

WHAT HAPPENED...

Page 10: the Flood Preparing for your WordPress site for a How to ... · Blazemeter - Visualizes the data (can also execute load tests) jMeter - Software to help you build and tweak scenarios
Page 11: the Flood Preparing for your WordPress site for a How to ... · Blazemeter - Visualizes the data (can also execute load tests) jMeter - Software to help you build and tweak scenarios

So how many cars can I

actually fit?

Page 12: the Flood Preparing for your WordPress site for a How to ... · Blazemeter - Visualizes the data (can also execute load tests) jMeter - Software to help you build and tweak scenarios

SolutionLet’s do some load testing!

Page 13: the Flood Preparing for your WordPress site for a How to ... · Blazemeter - Visualizes the data (can also execute load tests) jMeter - Software to help you build and tweak scenarios

Why Load Test?

Page 14: the Flood Preparing for your WordPress site for a How to ... · Blazemeter - Visualizes the data (can also execute load tests) jMeter - Software to help you build and tweak scenarios

Functional Tests don’t reflect the Real World

Testing the functionality of your site or application doesn’t reflect how users will

use it in real life. They may run across bottlenecks in complex situations your

testing can’t account for.

Page 15: the Flood Preparing for your WordPress site for a How to ... · Blazemeter - Visualizes the data (can also execute load tests) jMeter - Software to help you build and tweak scenarios

Your code can behave differently under load

Any changes to code to an established website can cause it to behave

differently under load. Bugs can appear that you didn’t detect in other testing.

Page 16: the Flood Preparing for your WordPress site for a How to ... · Blazemeter - Visualizes the data (can also execute load tests) jMeter - Software to help you build and tweak scenarios

Servers perform differently under stress

When scaling to 100s, 1000s or potentially Millions of concurrent users, you may get completely different results for CPU load, error rate, I/O throughput,

and response times.

Houston we have a

problem

Page 17: the Flood Preparing for your WordPress site for a How to ... · Blazemeter - Visualizes the data (can also execute load tests) jMeter - Software to help you build and tweak scenarios

The cost of failure is extremely high.50% of users will leave if a page takes longer than 6.5s to load. 1 minute of

downtime during Black Friday costs US$4700 on average. Downtime during a peak traffic event damages brand integrity and creates a snowball effect.

https://royal.pingdom.com/page-load-time-really-affect-bounce-rate/https://www.blazemeter.com/blog/why-load-testing-is-important/

Page 18: the Flood Preparing for your WordPress site for a How to ... · Blazemeter - Visualizes the data (can also execute load tests) jMeter - Software to help you build and tweak scenarios

What do you need?

Page 19: the Flood Preparing for your WordPress site for a How to ... · Blazemeter - Visualizes the data (can also execute load tests) jMeter - Software to help you build and tweak scenarios

ExecutionHow do you execute a load test?

ReactionHow does the server react to the

load test?

Page 20: the Flood Preparing for your WordPress site for a How to ... · Blazemeter - Visualizes the data (can also execute load tests) jMeter - Software to help you build and tweak scenarios

Load Testing Terms Primer

Scenarios - A template or script of what a user might do on a site.

Virtual Users/User Agents - Simulated users

Concurrency - How many actions and users are happening and on the site at any given time

504, 502, 429 errors - When the server is either crapping itself, or protecting itself from “crapping itself”.

.yaml - The file format that holds scenarios

Page 21: the Flood Preparing for your WordPress site for a How to ... · Blazemeter - Visualizes the data (can also execute load tests) jMeter - Software to help you build and tweak scenarios

ExecutionIngredients:

Servings: 1000vu

● Taurus - Open source, creates the Virtual Users that perform scenarios.

● Blazemeter - Visualizes the data (can also execute load tests)

● jMeter - Software to help you build and tweak scenarios

● Blazemeter Chrome Extension - Records your actions on a website to start as the basis for a scenario

Page 22: the Flood Preparing for your WordPress site for a How to ... · Blazemeter - Visualizes the data (can also execute load tests) jMeter - Software to help you build and tweak scenarios

ReactionIngredients:

Servings: 1 overloaded server

htop sar -q 1

● Stackdriver/Cloudwatch - Server monitoring (GCP/AWS). OpenNMS is agnostic & open source.

● New Relic - Monitoring the application (WordPress) itself.

● Pingdom/Uptime Robot/freshping - Measures whether the website is up.

● htop/sar -q 1 - Command Line (CLI) Live monitoring.

Page 23: the Flood Preparing for your WordPress site for a How to ... · Blazemeter - Visualizes the data (can also execute load tests) jMeter - Software to help you build and tweak scenarios

CAVEATS

DO NOT LOAD TEST…

❏ On your production environment

❏ On a shared environment❏ Without telling your host’s

support/security team❏ On a site or web

application you don’t have permission to blast.

x

xx

x

Page 24: the Flood Preparing for your WordPress site for a How to ... · Blazemeter - Visualizes the data (can also execute load tests) jMeter - Software to help you build and tweak scenarios

LET’S START

Page 25: the Flood Preparing for your WordPress site for a How to ... · Blazemeter - Visualizes the data (can also execute load tests) jMeter - Software to help you build and tweak scenarios
Page 26: the Flood Preparing for your WordPress site for a How to ... · Blazemeter - Visualizes the data (can also execute load tests) jMeter - Software to help you build and tweak scenarios
Page 27: the Flood Preparing for your WordPress site for a How to ... · Blazemeter - Visualizes the data (can also execute load tests) jMeter - Software to help you build and tweak scenarios
Page 28: the Flood Preparing for your WordPress site for a How to ... · Blazemeter - Visualizes the data (can also execute load tests) jMeter - Software to help you build and tweak scenarios

How do you prepare?

Page 29: the Flood Preparing for your WordPress site for a How to ... · Blazemeter - Visualizes the data (can also execute load tests) jMeter - Software to help you build and tweak scenarios

Do as much as possible before testing

Decide what to complete and what to defer.

Bottlenecks found in functional testing? Optimize to get a true to life response.

Page 30: the Flood Preparing for your WordPress site for a How to ... · Blazemeter - Visualizes the data (can also execute load tests) jMeter - Software to help you build and tweak scenarios

Deciding Test TypeSpike - How does a system respond to a sudden increase and decrease in load? e.g. A Live Online Event

Stress - How does a system respond to consistent high intensity loads? Where does it fail? How does it recover? e.g. A Flash Sale

Soak - How does a system respond to high load over time? e.g. Black Friday

Page 31: the Flood Preparing for your WordPress site for a How to ... · Blazemeter - Visualizes the data (can also execute load tests) jMeter - Software to help you build and tweak scenarios

Creating Realistic Scenarios

Start with the user journey

Your marketing and web team are integral to generating realistic test scenarios.

Have them map out ~5 user profiles and journeys. Usually this is their funnel

● From where and how do users access the site?

● What do they do on the site?● How do they arrive? In waves?● How long do they stay?

Page 32: the Flood Preparing for your WordPress site for a How to ... · Blazemeter - Visualizes the data (can also execute load tests) jMeter - Software to help you build and tweak scenarios

Determine your KPIsWhat is acceptable? Not what is ideal. What level of existence are

you willing to accept?

Considerations:● Response Time● Error %● Ratio of failed to successful

transactions● Maximum requests per second● Apdex Score

Page 33: the Flood Preparing for your WordPress site for a How to ... · Blazemeter - Visualizes the data (can also execute load tests) jMeter - Software to help you build and tweak scenarios

Start small before scaling up big...

Do small scale testing to discover errors and bottlenecks in your own scenarios and with

your own tech stack.

Common Questions to ask yourself:

● Is the script broken?● Is it calling on a resource that

doesn’t exist or performing an impossible action?

● Is the testing platform actually the bottleneck?

● Are there optimizations I can make to improve headroom?

Page 34: the Flood Preparing for your WordPress site for a How to ... · Blazemeter - Visualizes the data (can also execute load tests) jMeter - Software to help you build and tweak scenarios

What is the tipping point?When does acceptable become unacceptable?

Page 35: the Flood Preparing for your WordPress site for a How to ... · Blazemeter - Visualizes the data (can also execute load tests) jMeter - Software to help you build and tweak scenarios

Under load is 80% usageTest for 120% usage

When number of hits/s plateaus this indicates:

● System can no longer support extra concurrent requests

● You are at max concurrent users.

Page 36: the Flood Preparing for your WordPress site for a How to ... · Blazemeter - Visualizes the data (can also execute load tests) jMeter - Software to help you build and tweak scenarios

LET’S TAKE A LOOK

Page 37: the Flood Preparing for your WordPress site for a How to ... · Blazemeter - Visualizes the data (can also execute load tests) jMeter - Software to help you build and tweak scenarios
Page 38: the Flood Preparing for your WordPress site for a How to ... · Blazemeter - Visualizes the data (can also execute load tests) jMeter - Software to help you build and tweak scenarios

WHAT DO YOU DO NOW?Analyze > Tune > Retest > Rinse and Repeat

Page 39: the Flood Preparing for your WordPress site for a How to ... · Blazemeter - Visualizes the data (can also execute load tests) jMeter - Software to help you build and tweak scenarios

https://wpengine.com/blog/preparing-for-the-holiday-rush-a-load-testing-guide/

Page 40: the Flood Preparing for your WordPress site for a How to ... · Blazemeter - Visualizes the data (can also execute load tests) jMeter - Software to help you build and tweak scenarios

Questions?Robert LiE: [email protected] P: +61-(0)-7-5613-1084SM: LinkedIn (Look Left!)https://www.linkedin.com/in/robert-liDownload: https://dsh.re/896ac