Slide 1

Slide 1 text

Scaling the unscalable A primer on scaling WordPress websites for high traffic environments NEOK 10.09.2020 by Koen Van den Wijngaert NEOK IT BV

Slide 2

Slide 2 text

You probably don't need to scale Getting the basics right NEOK 10.09.2020 01.

Slide 3

Slide 3 text

First make it run smooth. ● External resources: database, APIs, … ● Environment a. Neighbors? b. Hardware? c. Settings? d. Topology? ● Network: traffic & connections ● Disk vs. Memory ● Slow and/or compute-heavy tasks Finding bottlenecks. NEOK Getting the basics right

Slide 4

Slide 4 text

First make it run smooth. ● Optimize your database ● Be nice to your web server ● The browser is your friend ● Try some page caching ● Use caching for dynamic content a. Object caching, database caching and transients b. Storage mechanisms Start small. NEOK Getting the basics right

Slide 5

Slide 5 text

Not enough? So you want to scale your WP? Vertically Horizontally NEOK 10.09.2020 02.

Slide 6

Slide 6 text

NEOK Scaling your WP

Slide 7

Slide 7 text

Horizontal scaling ● Application ● Database ● Web server (+ reverse proxy) ● Media server ● Search Splitting your set-up into separate components NEOK Scaling your WP

Slide 8

Slide 8 text

Going all-in Going for an horizontally scalable, highly available & elastic architecture NEOK 10.09.2020 03.

Slide 9

Slide 9 text

High availability No single points of failure. NEOK Going all-in

Slide 10

Slide 10 text

Elastic architecture Adding some extra oomph during peak moments NEOK Going all-in

Slide 11

Slide 11 text

An example setup ...Easy, right? NEOK Going all-in

Slide 12

Slide 12 text

Challenges of HA There's always a catch! Load balancing Shared media Consistency NEOK 10.09.2020 04.

Slide 13

Slide 13 text

Load balancing NEOK Challenges of HA

Slide 14

Slide 14 text

NEOK Challenges of HA Shared media

Slide 15

Slide 15 text

NEOK Challenges of HA Consistency

Slide 16

Slide 16 text

Keeping track of it all Knowledge is power. NEOK 10.09.2020 05.

Slide 17

Slide 17 text

No content

Slide 18

Slide 18 text

Monitoring

Slide 19

Slide 19 text

Logging and gathering metrics Why you need it NEOK Keeping track of it all ● Monitoring ● Alerting ● Performance tuning ● (Post-mortem) analysis

Slide 20

Slide 20 text

We need a way to expose metrics about running services, and a method for gathering and storing them in a way we can actually make sense of it later. We need to display this data graphically in some sort of dashboard. NEOK Keeping track of it all

Slide 21

Slide 21 text

Metrics NEOK Keeping track of it all Gathering ● Stackdriver (GCM) ● Prometheus ● New Relic Displaying ● Google Cloud Monitoring ● Grafana ● Kibana Exposing ● http endpoints ● mysql queries ● telnet interfaces ● ...

Slide 22

Slide 22 text

But wait... How do we keep track of it all? Abstraction! Containers Orchestrators NEOK 10.09.2020 06.

Slide 23

Slide 23 text

Containers NEOK Keeping track of it all

Slide 24

Slide 24 text

Orchestrators Cluster management is hard. NEOK Keeping track of it all ● Infrastructure management (provisioning and scaling) ● Life cycle management (starting, stopping & upgrading applications, health probes) ● Auto scaling based on demand ● Keeping track of services (networking/load balancing) ● Running one-off processes ● Persistent storage ● Managing state ● Sharing configuration ● Sharing secrets

Slide 25

Slide 25 text

One orchestrator to rule them all* NEOK Keeping track of it all * Please know what you’re getting yourself into.

Slide 26

Slide 26 text

Thank you & goodbye! Koen Van den Wijngaert NEOK IT BV @vdwijgaert /vdwijngaert NEOK 10.09.2020

Slide 27

Slide 27 text

NEOK Keeping track of it all