scale fail: how i learned to love the downtime

21
Scale Fail or, how I learned to stop worrying and love the downtime

Upload: postgresql-experts-inc

Post on 21-Jan-2018

381 views

Category:

Technology


3 download

TRANSCRIPT

Page 1: Scale Fail: How I Learned to Love the Downtime

Scale Failor, how I learned to stop worrying

and love the downtime

Page 2: Scale Fail: How I Learned to Love the Downtime
Page 3: Scale Fail: How I Learned to Love the Downtime
Page 4: Scale Fail: How I Learned to Love the Downtime

Downtimeis

Sexy

Page 5: Scale Fail: How I Learned to Love the Downtime

1. Be Trendy

Page 6: Scale Fail: How I Learned to Love the Downtime
Page 7: Scale Fail: How I Learned to Love the Downtime
Page 8: Scale Fail: How I Learned to Love the Downtime

Resource MonitoringPerformance TestingTraffic MonitoringLoad TestingTuning Analysis

N O

Page 9: Scale Fail: How I Learned to Love the Downtime

Let History Be Your Guide● Was database to slow last time?

● The database is too slow this time.

● Did the network cards fry last time?● They're frying this time.

● Did Apache choke on memory leaks last time?● It's Apache this time.

● Fixed things by using queues at your last job?● Then fix them with queues at this job!

Page 10: Scale Fail: How I Learned to Love the Downtime

Barn Door Troubleshooting

Page 11: Scale Fail: How I Learned to Love the Downtime

Parallel Programming

NOT SEXY

Page 12: Scale Fail: How I Learned to Love the Downtime

Don'tWorryAbout

ItProgram-

ming SEXY

Page 13: Scale Fail: How I Learned to Love the Downtime

How to Single-ThreadYour Code

● Locks, Locks, Locks!● Ignore scope and memory address space● Frequently-updated single-row table● Master Control Server process● Single Master Queue● Blocking threads which wait while checking on

a remote data source

Page 14: Scale Fail: How I Learned to Love the Downtime

The Old Way: Caching

DB

AppServer

AppServer

AppServer

WebServer

WebServer

WebServer

Con

nect

ion

Cac

hin

g P

ool

Dat

a C

ache

Obj

ect

Cac

he

HT

TP

Ca

che

Page 15: Scale Fail: How I Learned to Love the Downtime

The New Way: Direct2DB

DB

WebServer

WebServer

WebServer

HT

TP

Ca

che

Page 16: Scale Fail: How I Learned to Love the Downtime

Easy to Scale

For Wimps!

● Web servers● Caches● Shared-nothing hosts● Simple App Servers

Page 17: Scale Fail: How I Learned to Love the Downtime

Hard to Scale

For Real Developers!

● Databases● Queues● Shared Filesystems● Web Frameworks

Page 18: Scale Fail: How I Learned to Love the Downtime

SPoF

Page 19: Scale Fail: How I Learned to Love the Downtime

UserDB

AppServer

AppServer

AppServer

WebServer

WebServer

WebServer

PageDB

Single Point of Failure

LoadBalancer

TaskManager

LoadBalancer

Page 20: Scale Fail: How I Learned to Love the Downtime

UserDB

AppServer

AppServer

WebServer

WebServer

WebServer

PageDB

Cascading Failure

LoadBalancer

TaskManager

LoadBalancer

Page 21: Scale Fail: How I Learned to Love the Downtime

Be Sexy:

Go Down!