69
Guerilla Scaling In The Wild Jake Grimley, Managing Director, Made Media Ltd.

Guerilla Scaling In The Wild - University of BirminghamApache 2.2, PHP 5.3, Silverstripe CMS Master Web Server Linux, Apache 2.2, PHP 5.3, Silverstripe CMS Load Balancer Web Server

  • Upload
    others

  • View
    3

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Guerilla Scaling In The Wild - University of BirminghamApache 2.2, PHP 5.3, Silverstripe CMS Master Web Server Linux, Apache 2.2, PHP 5.3, Silverstripe CMS Load Balancer Web Server

Guerilla Scaling In The WildJake Grimley, Managing Director, Made Media Ltd.

Page 2: Guerilla Scaling In The Wild - University of BirminghamApache 2.2, PHP 5.3, Silverstripe CMS Master Web Server Linux, Apache 2.2, PHP 5.3, Silverstripe CMS Load Balancer Web Server

Made Media Ltd.

• Digital Marketing Agency

• Web Design Agency

• Arts, Media, Advertising

• Design & Code

• Disposable Software

Page 3: Guerilla Scaling In The Wild - University of BirminghamApache 2.2, PHP 5.3, Silverstripe CMS Master Web Server Linux, Apache 2.2, PHP 5.3, Silverstripe CMS Load Balancer Web Server

Employing...

38%

19%

19%

6%

19%Developers DesignersProject Managers SysOpsManagement

Page 4: Guerilla Scaling In The Wild - University of BirminghamApache 2.2, PHP 5.3, Silverstripe CMS Master Web Server Linux, Apache 2.2, PHP 5.3, Silverstripe CMS Load Balancer Web Server

Including...

• 1 Birmingham Uni SoftEng Graduate

• And Stef Lewandowski

• And One Placement

• Working on the EuDML Project as a partner alongside Bham Uni

Page 5: Guerilla Scaling In The Wild - University of BirminghamApache 2.2, PHP 5.3, Silverstripe CMS Master Web Server Linux, Apache 2.2, PHP 5.3, Silverstripe CMS Load Balancer Web Server

Jake GrimleyManaging Director

• Studied Physics

• Learnt to Program on a ZX Spectrum

• Reasonable Grasp of OOP, REST, LAMP

• Big Picture Company Overview

Page 6: Guerilla Scaling In The Wild - University of BirminghamApache 2.2, PHP 5.3, Silverstripe CMS Master Web Server Linux, Apache 2.2, PHP 5.3, Silverstripe CMS Load Balancer Web Server

Guerilla Scaling In The Wild

Page 7: Guerilla Scaling In The Wild - University of BirminghamApache 2.2, PHP 5.3, Silverstripe CMS Master Web Server Linux, Apache 2.2, PHP 5.3, Silverstripe CMS Load Balancer Web Server
Page 8: Guerilla Scaling In The Wild - University of BirminghamApache 2.2, PHP 5.3, Silverstripe CMS Master Web Server Linux, Apache 2.2, PHP 5.3, Silverstripe CMS Load Balancer Web Server

Scalingscalability is the ability of a system, network, or process, to handle growing amounts of work in a graceful manner or its ability to be enlarged to accommodate that growth.

Page 9: Guerilla Scaling In The Wild - University of BirminghamApache 2.2, PHP 5.3, Silverstripe CMS Master Web Server Linux, Apache 2.2, PHP 5.3, Silverstripe CMS Load Balancer Web Server

Commercial Definition

Adding more users should make Total Cost of Ownership cheaper, per-user, not more expensive.

Page 10: Guerilla Scaling In The Wild - University of BirminghamApache 2.2, PHP 5.3, Silverstripe CMS Master Web Server Linux, Apache 2.2, PHP 5.3, Silverstripe CMS Load Balancer Web Server

In The Wild

Page 11: Guerilla Scaling In The Wild - University of BirminghamApache 2.2, PHP 5.3, Silverstripe CMS Master Web Server Linux, Apache 2.2, PHP 5.3, Silverstripe CMS Load Balancer Web Server

Guerilla

Page 12: Guerilla Scaling In The Wild - University of BirminghamApache 2.2, PHP 5.3, Silverstripe CMS Master Web Server Linux, Apache 2.2, PHP 5.3, Silverstripe CMS Load Balancer Web Server

Real World

• Client may not consider scaling at all. Problem not feature.

• Timescales tight

• Limited opportunities to test and learn

• Hardware scale-out not always possible

• Your reputation on the line

Page 13: Guerilla Scaling In The Wild - University of BirminghamApache 2.2, PHP 5.3, Silverstripe CMS Master Web Server Linux, Apache 2.2, PHP 5.3, Silverstripe CMS Load Balancer Web Server

Case Study 1

Page 14: Guerilla Scaling In The Wild - University of BirminghamApache 2.2, PHP 5.3, Silverstripe CMS Master Web Server Linux, Apache 2.2, PHP 5.3, Silverstripe CMS Load Balancer Web Server

Embarrassing Bodies

• Channel 4’s most successful multi-platform project

• 1 episode: 4m viewers, 150 thousand web users, 1.2m page views

Page 15: Guerilla Scaling In The Wild - University of BirminghamApache 2.2, PHP 5.3, Silverstripe CMS Master Web Server Linux, Apache 2.2, PHP 5.3, Silverstripe CMS Load Balancer Web Server

Things we’d rather they didn’t ask

• Would you like to look at some boobs?

• Do you want to take an autism test? (38,000 users in 1 minute)

Page 16: Guerilla Scaling In The Wild - University of BirminghamApache 2.2, PHP 5.3, Silverstripe CMS Master Web Server Linux, Apache 2.2, PHP 5.3, Silverstripe CMS Load Balancer Web Server
Page 17: Guerilla Scaling In The Wild - University of BirminghamApache 2.2, PHP 5.3, Silverstripe CMS Master Web Server Linux, Apache 2.2, PHP 5.3, Silverstripe CMS Load Balancer Web Server

Scaling Up / Scaling Out

Up

Quickest‘Big Iron’

Hit Limits Fast

Out

Preferable‘Unlimited’

Requires Planning

App

Page 18: Guerilla Scaling In The Wild - University of BirminghamApache 2.2, PHP 5.3, Silverstripe CMS Master Web Server Linux, Apache 2.2, PHP 5.3, Silverstripe CMS Load Balancer Web Server

Embarrassing Bodies

Web Server

Database Server

Reverse Proxy

Firewall

Varnish

Smoothwall

Apache (PHP)

MySQL

Page 19: Guerilla Scaling In The Wild - University of BirminghamApache 2.2, PHP 5.3, Silverstripe CMS Master Web Server Linux, Apache 2.2, PHP 5.3, Silverstripe CMS Load Balancer Web Server

Optimise Last

• Chances are you won’t need to

• Servers are cheaper than programmers

• You don’t know how much you need to optimise when you start

• You don’t know where the bottlenecks will be

• But don’t be reckless

Page 20: Guerilla Scaling In The Wild - University of BirminghamApache 2.2, PHP 5.3, Silverstripe CMS Master Web Server Linux, Apache 2.2, PHP 5.3, Silverstripe CMS Load Balancer Web Server

Cache FIRST

Edge Cache / CDN

Reverse Proxy

Application

Object Cache (Memcached)

Database (Query Cache)

Page 21: Guerilla Scaling In The Wild - University of BirminghamApache 2.2, PHP 5.3, Silverstripe CMS Master Web Server Linux, Apache 2.2, PHP 5.3, Silverstripe CMS Load Balancer Web Server

Caching

• Start from front and work backwards

• Works best with high read-to-write ratio

• Low levels of personalisation

Page 22: Guerilla Scaling In The Wild - University of BirminghamApache 2.2, PHP 5.3, Silverstripe CMS Master Web Server Linux, Apache 2.2, PHP 5.3, Silverstripe CMS Load Balancer Web Server

“There are only two hard problems in Computer Science cache invalidation and naming things.”

Phil Karlton

Ultimately, this strategy will run out of steam

Page 23: Guerilla Scaling In The Wild - University of BirminghamApache 2.2, PHP 5.3, Silverstripe CMS Master Web Server Linux, Apache 2.2, PHP 5.3, Silverstripe CMS Load Balancer Web Server

HTTP Optimisations• Minimise HTTP requests

• Add Expires / Cache-Control headers

• Don’t start an Application process when you don’t need one

• Offload Images / Javascript etc. to S3

• Cache output into flat files

• Optimise Connection Limits and space child processes

• Be careful with Keep-alive

Page 24: Guerilla Scaling In The Wild - University of BirminghamApache 2.2, PHP 5.3, Silverstripe CMS Master Web Server Linux, Apache 2.2, PHP 5.3, Silverstripe CMS Load Balancer Web Server

Connection Pooling

• Ideal: Connection established, Request served, Connection closed

• Connections expensive to open. Then hold-open RAM.

• Too many connections. Server will lock-up

• Too few connections, requests will be denied

• We want to safe-guard against lock-up whilst refusing as few requests as possible

• Default configurations are conservative

Page 25: Guerilla Scaling In The Wild - University of BirminghamApache 2.2, PHP 5.3, Silverstripe CMS Master Web Server Linux, Apache 2.2, PHP 5.3, Silverstripe CMS Load Balancer Web Server

Stick to REST

• REST was designed by smarter people than you

• Distributed caching is built in by design

• Understand the difference between GET and POST

• Stateless systems scale better

Page 26: Guerilla Scaling In The Wild - University of BirminghamApache 2.2, PHP 5.3, Silverstripe CMS Master Web Server Linux, Apache 2.2, PHP 5.3, Silverstripe CMS Load Balancer Web Server

Distributed Caching

Cache-Control: max-age=86400, must-revalidatemax-age=86400The number of seconds the resource will be considered fresh, similar to the Expires header except the number of seconds from now is used rather than a specific date/time.

s-maxage=86400The same as max-age, except that it only applies to shared caches.

publicMakes the response always cacheable even if it wouldn't normally be cacheable (behind authentication, etc.)

no-cacheForces caches ask the server for validation before releasing a cached copy, so if the server says that the cached version is still fresh it is served from the cache.

must-revalidateForces caches to obey any freshness information you give them about a resource.

proxy-revalidateThe same as must-revalidate except that it only applies to shared (proxy) caches.

Page 27: Guerilla Scaling In The Wild - University of BirminghamApache 2.2, PHP 5.3, Silverstripe CMS Master Web Server Linux, Apache 2.2, PHP 5.3, Silverstripe CMS Load Balancer Web Server

GET/POST

Client

Cache

App

DB

Get

Post

Page 28: Guerilla Scaling In The Wild - University of BirminghamApache 2.2, PHP 5.3, Silverstripe CMS Master Web Server Linux, Apache 2.2, PHP 5.3, Silverstripe CMS Load Balancer Web Server

State stored in Application

Client

App2

DB

App1 App3 App4 App5

Load Balancer

Sticky Session

Page 29: Guerilla Scaling In The Wild - University of BirminghamApache 2.2, PHP 5.3, Silverstripe CMS Master Web Server Linux, Apache 2.2, PHP 5.3, Silverstripe CMS Load Balancer Web Server

Stateless

Client

App2

DB

App1 App3 App4 App5

Round Robin

App6

Page 30: Guerilla Scaling In The Wild - University of BirminghamApache 2.2, PHP 5.3, Silverstripe CMS Master Web Server Linux, Apache 2.2, PHP 5.3, Silverstripe CMS Load Balancer Web Server

Stateless?

• Store session state on client (encrypted cookie)

• Push session state down into database (now we have a database scaling problem)

Page 31: Guerilla Scaling In The Wild - University of BirminghamApache 2.2, PHP 5.3, Silverstripe CMS Master Web Server Linux, Apache 2.2, PHP 5.3, Silverstripe CMS Load Balancer Web Server

Case Study 2

Page 32: Guerilla Scaling In The Wild - University of BirminghamApache 2.2, PHP 5.3, Silverstripe CMS Master Web Server Linux, Apache 2.2, PHP 5.3, Silverstripe CMS Load Balancer Web Server

Embarrassing Bodies Live• Live post-broadcast show with video streaming

• User generated content:

• Images

• Comments

• Polls

• Votes

• 40 transactions/second

Page 33: Guerilla Scaling In The Wild - University of BirminghamApache 2.2, PHP 5.3, Silverstripe CMS Master Web Server Linux, Apache 2.2, PHP 5.3, Silverstripe CMS Load Balancer Web Server

Scaling Out

Page 34: Guerilla Scaling In The Wild - University of BirminghamApache 2.2, PHP 5.3, Silverstripe CMS Master Web Server Linux, Apache 2.2, PHP 5.3, Silverstripe CMS Load Balancer Web Server
Page 35: Guerilla Scaling In The Wild - University of BirminghamApache 2.2, PHP 5.3, Silverstripe CMS Master Web Server Linux, Apache 2.2, PHP 5.3, Silverstripe CMS Load Balancer Web Server

• Smart Client built in Javascript

• Poll for JSON data-update

• JSON distributed across EC2 varnish instances (GET)

• All POST requests filtered through one server

• Doctor’s Waiting Room (Velvet Rope Policy)

Pragmatic Architecture

Page 36: Guerilla Scaling In The Wild - University of BirminghamApache 2.2, PHP 5.3, Silverstripe CMS Master Web Server Linux, Apache 2.2, PHP 5.3, Silverstripe CMS Load Balancer Web Server

De-Normalise

Aggregate Query

Aggregate Query

Aggregate Query

Page 37: Guerilla Scaling In The Wild - University of BirminghamApache 2.2, PHP 5.3, Silverstripe CMS Master Web Server Linux, Apache 2.2, PHP 5.3, Silverstripe CMS Load Balancer Web Server

Votes

Poll Total

Aggregate Query

1 simple query

Data mining/reporting

Page 38: Guerilla Scaling In The Wild - University of BirminghamApache 2.2, PHP 5.3, Silverstripe CMS Master Web Server Linux, Apache 2.2, PHP 5.3, Silverstripe CMS Load Balancer Web Server

• JSON feed included ‘refresh-time’ variable and ‘drop-%’ variable

• Primary Concern: Keep the site (and video feed) up

• ‘Red, Yellow, Green’. ‘Defcon 1, Defcon 2

• Triumph of Pragmatism over theory

One Massive Hack

Page 39: Guerilla Scaling In The Wild - University of BirminghamApache 2.2, PHP 5.3, Silverstripe CMS Master Web Server Linux, Apache 2.2, PHP 5.3, Silverstripe CMS Load Balancer Web Server

Votes

Poll Total

Aggregate Query

X Scaling Factor

Page 40: Guerilla Scaling In The Wild - University of BirminghamApache 2.2, PHP 5.3, Silverstripe CMS Master Web Server Linux, Apache 2.2, PHP 5.3, Silverstripe CMS Load Balancer Web Server

War Room

Page 41: Guerilla Scaling In The Wild - University of BirminghamApache 2.2, PHP 5.3, Silverstripe CMS Master Web Server Linux, Apache 2.2, PHP 5.3, Silverstripe CMS Load Balancer Web Server

War Room

• Live monitoring

• Roles assigned

• Recovery, failure and escalation procedures

Page 42: Guerilla Scaling In The Wild - University of BirminghamApache 2.2, PHP 5.3, Silverstripe CMS Master Web Server Linux, Apache 2.2, PHP 5.3, Silverstripe CMS Load Balancer Web Server

Success

• Site stayed up

• Failed to pay attention to moderation tool (5 users)

• Grand strategy paid off

• Subsequent broadcasts, no hacks.

Page 43: Guerilla Scaling In The Wild - University of BirminghamApache 2.2, PHP 5.3, Silverstripe CMS Master Web Server Linux, Apache 2.2, PHP 5.3, Silverstripe CMS Load Balancer Web Server

Grown-up Database Scaling

• Clustering

• Sharding

Page 44: Guerilla Scaling In The Wild - University of BirminghamApache 2.2, PHP 5.3, Silverstripe CMS Master Web Server Linux, Apache 2.2, PHP 5.3, Silverstripe CMS Load Balancer Web Server

Clustering

Page 45: Guerilla Scaling In The Wild - University of BirminghamApache 2.2, PHP 5.3, Silverstripe CMS Master Web Server Linux, Apache 2.2, PHP 5.3, Silverstripe CMS Load Balancer Web Server

Sharding

Page 46: Guerilla Scaling In The Wild - University of BirminghamApache 2.2, PHP 5.3, Silverstripe CMS Master Web Server Linux, Apache 2.2, PHP 5.3, Silverstripe CMS Load Balancer Web Server

NoSQL

Page 47: Guerilla Scaling In The Wild - University of BirminghamApache 2.2, PHP 5.3, Silverstripe CMS Master Web Server Linux, Apache 2.2, PHP 5.3, Silverstripe CMS Load Balancer Web Server

The Cloud

• Trivial to set up multiple servers with different roles

• We use Amazon EC2

• Managed via Chef or Puppet

Page 48: Guerilla Scaling In The Wild - University of BirminghamApache 2.2, PHP 5.3, Silverstripe CMS Master Web Server Linux, Apache 2.2, PHP 5.3, Silverstripe CMS Load Balancer Web Server

Web Servervarnish, Linux,

Apache 2.2, PHP 5.3, Silverstripe CMS

Master Web ServerLinux, Apache 2.2, PHP

5.3, Silverstripe CMS

Load Balancer

Web Servervarnish, Linux,

Apache 2.2, PHP 5.3, Silverstripe CMS

MySQL Slave(read)

MySQL Slave(read)

Akamai NetStorage(Static asset files)

MySQL Master(read/write)

HAProxy

memcache

Internet

Web ServerSurvey

varnish, Linux, Apache 2.2, PHP 5.3

Images/Filespushed via FTP

HTTPS

Page 49: Guerilla Scaling In The Wild - University of BirminghamApache 2.2, PHP 5.3, Silverstripe CMS Master Web Server Linux, Apache 2.2, PHP 5.3, Silverstripe CMS Load Balancer Web Server

Case Study 3

Page 50: Guerilla Scaling In The Wild - University of BirminghamApache 2.2, PHP 5.3, Silverstripe CMS Master Web Server Linux, Apache 2.2, PHP 5.3, Silverstripe CMS Load Balancer Web Server

Glyndebourne

• Opera Tickets, Known for failure online

• Dedicated International Audience, 1,000 loyal fans queued at midnight

• Credit Card Transactions, c. £0.5m in one night

• Many dependencies, points of failure

Page 51: Guerilla Scaling In The Wild - University of BirminghamApache 2.2, PHP 5.3, Silverstripe CMS Master Web Server Linux, Apache 2.2, PHP 5.3, Silverstripe CMS Load Balancer Web Server

Backstage CMS

Varnish Webcache

Tessitura APIMagento e-Commerce

SSL

Unified Shopping Basket

Unified User Accounts

MySQL Database

Purchase Path & Membership Pages

Waiting Room

Marketing Pages Merchandise Pages

Restaurant System

Car Park System

Fulfillment System

Booksolve

Email System (Campaign Monitor)

Google Analytics

Third-Party SAAS

Open-Source Software

Proprietary Software

Custom/Adapted Development

Tessitura

DAM

CDN Edge Servers

Media Player

Geotargetting

Page 52: Guerilla Scaling In The Wild - University of BirminghamApache 2.2, PHP 5.3, Silverstripe CMS Master Web Server Linux, Apache 2.2, PHP 5.3, Silverstripe CMS Load Balancer Web Server

Identify Bottlenecks

Page 53: Guerilla Scaling In The Wild - University of BirminghamApache 2.2, PHP 5.3, Silverstripe CMS Master Web Server Linux, Apache 2.2, PHP 5.3, Silverstripe CMS Load Balancer Web Server

Scalable Tessitura Ticketing Path

Anonymous

BrowserWaiting Room

Personalised

BackstageTicketing Pages

2000 requests / second 300 requests / second 2000 requests / second

Cache

360

48 requests / secondTarget

SSL

User

Journey

Backstage

Tessitura

Page 54: Guerilla Scaling In The Wild - University of BirminghamApache 2.2, PHP 5.3, Silverstripe CMS Master Web Server Linux, Apache 2.2, PHP 5.3, Silverstripe CMS Load Balancer Web Server

Queues

• Velvet Rope Policy (Doctor’s Waiting Room)

• Rabbit MQ, Amazon Simple Queue Service

• Send requests for completion later (e.g. billing credit cards)

Page 55: Guerilla Scaling In The Wild - University of BirminghamApache 2.2, PHP 5.3, Silverstripe CMS Master Web Server Linux, Apache 2.2, PHP 5.3, Silverstripe CMS Load Balancer Web Server

Load Testing

“So did it pass the load test? No? Oh.”

Page 56: Guerilla Scaling In The Wild - University of BirminghamApache 2.2, PHP 5.3, Silverstripe CMS Master Web Server Linux, Apache 2.2, PHP 5.3, Silverstripe CMS Load Balancer Web Server

Commercial Load Testing

• Expensive

• Difficult to simulate 500,000 real users

• All or nothing

• Won’t tell you much

• Should confirm what you know, not be your first sign something is wrong

Page 57: Guerilla Scaling In The Wild - University of BirminghamApache 2.2, PHP 5.3, Silverstripe CMS Master Web Server Linux, Apache 2.2, PHP 5.3, Silverstripe CMS Load Balancer Web Server

Test Plan

• Load testing integrated into development process

• Business criteria. Number of checkouts, not requests/second.

• Help your client understand

Page 58: Guerilla Scaling In The Wild - University of BirminghamApache 2.2, PHP 5.3, Silverstripe CMS Master Web Server Linux, Apache 2.2, PHP 5.3, Silverstripe CMS Load Balancer Web Server

Component Test First

• Apache Bench (ab)

• Break down chain into components

• Identify bottlenecks

• Requests/second. 100% complete without errors.

Page 59: Guerilla Scaling In The Wild - University of BirminghamApache 2.2, PHP 5.3, Silverstripe CMS Master Web Server Linux, Apache 2.2, PHP 5.3, Silverstripe CMS Load Balancer Web Server

ApacheBenchCopyright (c) 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/Copyright (c) 1998-2002 The Apache Software Foundation, http://www.apache.org/Benchmarking www.cyberciti.biz (be patient).....doneServer Software:Server Hostname: www.somewhere.comServer Port: 80Document Path: /Document Length: 16289 bytesConcurrency Level: 1Time taken for tests: 16.885975 secondsComplete requests: 10Failed requests: 0Write errors: 0Total transferred: 166570 bytesHTML transferred: 162890 bytesRequests per second: 0.59 [#/sec] (mean)Time per request: 1688.597 [ms] (mean)Time per request: 1688.597 [ms] (mean, across all concurrent requests)Transfer rate: 9.59 [Kbytes/sec] receivedConnection Times (ms) min mean[+/-sd] median maxConnect: 353 375 16.1 386 391Processing: 1240 1312 52.1 1339 1369Waiting: 449 472 16.2 476 499Total: 1593 1687 67.7 1730 1756Percentage of the requests served within a certain time (ms) 50% 1730 66% 1733 75% 1741 80% 1753 90% 1756 95% 1756 98% 1756 99% 1756 100% 1756 (longest request)

Page 60: Guerilla Scaling In The Wild - University of BirminghamApache 2.2, PHP 5.3, Silverstripe CMS Master Web Server Linux, Apache 2.2, PHP 5.3, Silverstripe CMS Load Balancer Web Server

Component Tests

• Suspect one part of the process?

• Write a script that just does that part

• Load test that part in isolation

• It’s like bug fixing

Page 61: Guerilla Scaling In The Wild - University of BirminghamApache 2.2, PHP 5.3, Silverstripe CMS Master Web Server Linux, Apache 2.2, PHP 5.3, Silverstripe CMS Load Balancer Web Server

Scalable Tessitura Ticketing Path

Anonymous

BrowserWaiting Room

Personalised

BackstageTicketing Pages

2000 requests / second 300 requests / second 2000 requests / second

Cache

360

48 requests / secondTarget

SSL

User

Journey

Backstage

Tessitura

Page 62: Guerilla Scaling In The Wild - University of BirminghamApache 2.2, PHP 5.3, Silverstripe CMS Master Web Server Linux, Apache 2.2, PHP 5.3, Silverstripe CMS Load Balancer Web Server

Selenium: Better Testing

Page 63: Guerilla Scaling In The Wild - University of BirminghamApache 2.2, PHP 5.3, Silverstripe CMS Master Web Server Linux, Apache 2.2, PHP 5.3, Silverstripe CMS Load Balancer Web Server
Page 64: Guerilla Scaling In The Wild - University of BirminghamApache 2.2, PHP 5.3, Silverstripe CMS Master Web Server Linux, Apache 2.2, PHP 5.3, Silverstripe CMS Load Balancer Web Server

Bring It Together in the BrowserWidgetisation

Page 65: Guerilla Scaling In The Wild - University of BirminghamApache 2.2, PHP 5.3, Silverstripe CMS Master Web Server Linux, Apache 2.2, PHP 5.3, Silverstripe CMS Load Balancer Web Server

Service Service Service

Web Layer

User

Browser

Natural Integrator Approach

Page 66: Guerilla Scaling In The Wild - University of BirminghamApache 2.2, PHP 5.3, Silverstripe CMS Master Web Server Linux, Apache 2.2, PHP 5.3, Silverstripe CMS Load Balancer Web Server

Service Service Service

Web Layer

User

Browser

Web Layer

Web Layer

Easily Cacheable (CMS)

Heavily Personalised (E-Commerce)

Might Scale Better

Page 67: Guerilla Scaling In The Wild - University of BirminghamApache 2.2, PHP 5.3, Silverstripe CMS Master Web Server Linux, Apache 2.2, PHP 5.3, Silverstripe CMS Load Balancer Web Server
Page 68: Guerilla Scaling In The Wild - University of BirminghamApache 2.2, PHP 5.3, Silverstripe CMS Master Web Server Linux, Apache 2.2, PHP 5.3, Silverstripe CMS Load Balancer Web Server

When it all goes wrong

• Fail gracefully

• Have an escalation plan

• A good use of your time

Page 69: Guerilla Scaling In The Wild - University of BirminghamApache 2.2, PHP 5.3, Silverstripe CMS Master Web Server Linux, Apache 2.2, PHP 5.3, Silverstripe CMS Load Balancer Web Server

Essay Topics• Twitter famously couldn’t scale their architecture to keep pace with growth. Discuss

the architectural differences between a blogging platform and a messaging platform. Research the early architectural design of Twitter, and describe an architecture that might have scaled better.

• Consider one of your other university projects; something with a data-schema or an Entity Relationship Diagram. Consider challenges you might have scaling that system to many thousands of users. Where would the bottlenecks be? What optimisations or compromises could you make?

• Imagine you were tasked with delivering a high-volume live chat-room over the web (something like Google+ perhaps, or my EB Live Case Study). Research and compare modern approaches to delivering the project. [hint: look-up Web Sockets and node.js]. Compare with a simple polling approach and discuss with reference to REST.