Slide 1

Slide 1 text

Siege and Beyond:
 An Intro to Benchmarking and Stress Tests WordCamp Vancouver 2015 Mike Schroder (DH-Shredder) WordPress Platform Lead at DreamHost @GetSource - http://www.getsource.net

Slide 2

Slide 2 text

Who Am I? • Mike Schroder, a.k.a DH-Shredder,
 a.k.a. @GetSource • Third Culture Kid, enjoy Coffee & Sailing • WordPress 3.9 Co-Lead and Core Contributor • Happy DreamHost Employee

Slide 3

Slide 3 text

What will happen if my site hits the reddit front page?

Slide 4

Slide 4 text

What if reddit doesn’t matter to me?

Slide 5

Slide 5 text

Prove how many users can access your site at one time.

Slide 6

Slide 6 text

Load Testing or Stress Testing?

Slide 7

Slide 7 text

Load Tests: Will my site run well with the expected amount of users?

Slide 8

Slide 8 text

Stress Tests: How many users before the site/infrastructure cracks?

Slide 9

Slide 9 text

Are we testing dynamic or cached requests?

Slide 10

Slide 10 text

INTERNET PHP FRONT-END CACHE

Slide 11

Slide 11 text

Varnish/Static: ~50ms

Slide 12

Slide 12 text

PHP: ~100ms (without stress)

Slide 13

Slide 13 text

PHP: ~1500ms (with stress)

Slide 14

Slide 14 text

All methods are not equal.

Slide 15

Slide 15 text

“Users/minute” does not necessarily mean “real users during a minute”.

Slide 16

Slide 16 text

There are many utilities for stress testing.

Slide 17

Slide 17 text

Let’s start with Siege.

Slide 18

Slide 18 text

You can run cached or dynamic tests.

Slide 19

Slide 19 text

It’s used only from the command line.

Slide 20

Slide 20 text

It only runs tests from one server.

Slide 21

Slide 21 text

Linux: Packages.
 Mac: Homebrew. https://www.joedog.org/siege-­‐home/

Slide 22

Slide 22 text

Primary configuration (.siegerc)

Slide 23

Slide 23 text

To run dynamic tests login-url = http://example.com/wp-login.php POST log=[user]&pwd=[password]&wp-submit=Log+In& redirect_to=http%3A%2F%2example.com%2Fwp-admin%2F&testcookie=1

Slide 24

Slide 24 text

A list of URLs.

Slide 25

Slide 25 text

List format HOST=http://example.com ${HOST}/ ${HOST}/?feed=rss2 ${HOST}/?p=41 ${HOST}/?feed=rss2 ${HOST}/?p=44 ${HOST}/ ...

Slide 26

Slide 26 text

Results Transactions: 712 hits Availability: 100.00 % Elapsed time: 59.12 secs Data transferred: 3.70 MB Response time: 1.23 secs Transaction rate: 12.04 trans/sec Throughput: 0.06 MB/sec Concurrency: 14.75 Successful transactions: 702 Failed transactions: 0 Longest transaction: 8.49 Shortest transaction: 0.20

Slide 27

Slide 27 text

Where can I find test content?

Slide 28

Slide 28 text

HHVM’s oss-performance is one option. https://github.com/hhvm/oss-­‐performance/tree/master/targets/wordpress

Slide 29

Slide 29 text

To seed from your own content, take a look at your logs, or try: http://example.com/   http://example.com/?feed=rss2   http://example.com/?p=%{*:1-­‐52}  

Slide 30

Slide 30 text

You can also use sproxy, not to be confused with stunnel.

Slide 31

Slide 31 text

Loader.io is a service to run stress tests.

Slide 32

Slide 32 text

However, it has a friendly GUI to run tests and see the results.

Slide 33

Slide 33 text

No content

Slide 34

Slide 34 text

Single data center, but from a cluster of AWS servers.

Slide 35

Slide 35 text

More complex user behavior? Try a service like LoadStorm.

Slide 36

Slide 36 text

What kinds of issues will I find?

Slide 37

Slide 37 text

How do I debug problems once they’re found?

Slide 38

Slide 38 text

Bonus: Your WordPress site runs slowly, and even more slowly as soon as you enable a persistent object-cache. Why?

Slide 39

Slide 39 text

alloptions.

Slide 40

Slide 40 text

Memcached slab size.

Slide 41

Slide 41 text

wp_options cleanup.

Slide 42

Slide 42 text

Questions? -­‐    getsource.net/tag/siege/   -­‐    joedog.org/siege-­‐manual/   -­‐    joedog.org/sproxy-­‐home/
 -­‐    github.com/hhvm/oss-­‐performance
 Mike Schroder (DH-Shredder) WordPress Platform Lead at DreamHost @GetSource - http://www.getsource.net