Scaling Web Service

Junghoo Cho

cho@cs.ucla.edu

Capacity Planning

Capacity Planning: Static Content

Capacity Planning: Static Content

Capacity Planning: Static Content

Dynamic Content

Remarks on Capacity Planning

  1. Set your min acceptable service requirement
  2. Characterize the workload
  3. Remember: “premature optimization is the root of all evil”

Basic Unix Monitoring Tools

Caching

Below Database Layer

Above Database Layer

Above Application Layer

Dynamic-Page Cache Example

Edge-Side Include (ESI)

Above HTTP Layer

Above Encryption Layer

Browser Cache

Simple, Performant Setup: Example

NGINX (with microcaching)
Node/Tomcat/WordPress
Mongo/MySQL/Postgress
Linux
Hardware
(Multicore, Enough RAM, SSD)

Scaling Web Server

Scaling-Out: Google Data Center

(Video credit: CBS)

Scaling Out Web Applications

Scaling Out Each Layer

Scaling DB Layer

Scenario 1: Read-Only Access

Scenario 2: Local Read and Write

Scenario 3: Global Read and Write

Scaling Out: General Remarks

What We Learned