Slide 1

Slide 1 text

Scaling WordPress With Load Testing https://boogah.org/wcsd17

Slide 2

Slide 2 text

Let's talk about performance testing

Slide 3

Slide 3 text

Why load test?

Slide 4

Slide 4 text

Common styles of performance testing

Slide 5

Slide 5 text

Stress testing

Slide 6

Slide 6 text

Spike testing

Slide 7

Slide 7 text

Endurance testing

Slide 8

Slide 8 text

Configuration testing

Slide 9

Slide 9 text

YMMV

Slide 10

Slide 10 text

Tools

Slide 11

Slide 11 text

ApacheBench

Slide 12

Slide 12 text

ApacheBench Gotchas » Single threaded. » Not good for benchmarking high capacity servers. » Works best when run from the same server as your site. » Can only hit one URL at a time. » Not much actionable data. » Not a real browser test. » No HTTP/2 support.

Slide 13

Slide 13 text

Using ApacheBench ab -n 100 -c 10 https://jasoncosper.com/ Translation: Have ApacheBench send 100 requests to my site. There should be no more than 10 requests running concurrently.

Slide 14

Slide 14 text

If you have macOS you have ApacheBench

Slide 15

Slide 15 text

Installing ApacheBench If you're using Ubuntu to do your development work: apt install apache2-utils

Slide 16

Slide 16 text

h2load

Slide 17

Slide 17 text

h2load > ApacheBench » HTTP/2 and HTTP/1.1 support out-of-the-box! » It's multithreaded! » Support for more than one URL!

Slide 18

Slide 18 text

h2load Gotchas » Limited actionable data. » Not a real browser test. » Best run from the same server as your site.

Slide 19

Slide 19 text

Using h2load h2load -n1000 -c100 -m10 https://jasoncosper.com/ https://jasoncosper.com/podcasts/ Translation: Have h2load send 1000 requests to two URLs with 100 concurrent clients. And please don't go over 10 concurrent streams.

Slide 20

Slide 20 text

h2load Output finished in 7.43s, 134.60 req/s, 3.48MB/s requests: 1000 total, 1000 started, 1000 done, 1000 succeeded, 0 failed, 0 errored, 0 timeout status codes: 1000 2xx, 0 3xx, 0 4xx, 0 5xx traffic: 25.85MB (27110684) total, 484.65KB (496284) headers (space savings 21.07%), 25.33MB (26555500) data min max mean sd +/- sd time for request: 273.54ms 6.27s 1.90s 1.13s 67.70% time for connect: 1.09s 4.21s 1.98s 723.85ms 63.00% time to 1st byte: 1.49s 4.84s 2.53s 792.93ms 66.00% req/s : 1.35 4.30 2.11 0.56 80.00%

Slide 21

Slide 21 text

Installing h2load https://boogah.org/inst-h2load

Slide 22

Slide 22 text

JMeter

Slide 23

Slide 23 text

No content

Slide 24

Slide 24 text

Apache JMeter » Created to test production web apps. » Ridiculously configurable and extendable. » Cross-platform (Mac, Windows, Linux) » Fully multithreaded. » GUI and CLI. » Distributed remote testing support.

Slide 25

Slide 25 text

Installing JMeter https://boogah.org/inst-jmeter

Slide 26

Slide 26 text

Creating test plans is easyish

Slide 27

Slide 27 text

Don't test production environments from your laptop

Slide 28

Slide 28 text

Flood IO https://flood.io/

Slide 29

Slide 29 text

BlazeMeter https://www.blazemeter.com/

Slide 30

Slide 30 text

Real world scenarios

Slide 31

Slide 31 text

Google Analytics is your friend

Slide 32

Slide 32 text

No content

Slide 33

Slide 33 text

Useful Filters » ?s » product » category » tag

Slide 34

Slide 34 text

Bringing it all together

Slide 35

Slide 35 text

WooCommerce Test Plans » Browse site. » Browse site, perform multiple searches. » Add products to cart, check out. » Log in, browse site. » Log in, visit "My Account" page. » Log in, add products to cart, check out.

Slide 36

Slide 36 text

YMMV

Slide 37

Slide 37 text

Okay, but how many users?

Slide 38

Slide 38 text

Push it to the limit

Slide 39

Slide 39 text

My limit seems kinda low

Slide 40

Slide 40 text

Questions?

Slide 41

Slide 41 text

Thanks!

Slide 42

Slide 42 text

@boogah https://jasoncosper.com/ https://hipsum.co/