Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Scaling the Unscalable

Scaling the Unscalable

A primer on scaling WordPress websites for high traffic environments.

by Koen Van den Wijngaert
NEOK IT BV

Koen Van den Wijngaert

September 10, 2020
Tweet

More Decks by Koen Van den Wijngaert

Other Decks in Technology

Transcript

  1. 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

    View full-size slide

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

    View full-size slide

  3. 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

    View full-size slide

  4. 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

    View full-size slide

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

    View full-size slide

  6. NEOK Scaling your WP

    View full-size slide

  7. Horizontal scaling

    Application

    Database

    Web server (+ reverse proxy)

    Media server

    Search
    Splitting your set-up into separate components
    NEOK Scaling your WP

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

  13. Load balancing
    NEOK Challenges of HA

    View full-size slide

  14. NEOK Challenges of HA
    Shared media

    View full-size slide

  15. NEOK Challenges of HA
    Consistency

    View full-size slide

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

    View full-size slide

  17. Logging and gathering metrics
    Why you need it
    NEOK Keeping track of it all

    Monitoring

    Alerting

    Performance tuning

    (Post-mortem) analysis

    View full-size slide

  18. 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

    View full-size slide

  19. 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

    ...

    View full-size slide

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

    View full-size slide

  21. Containers
    NEOK Keeping track of it all

    View full-size slide

  22. 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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

  25. NEOK Keeping track of it all

    View full-size slide