Upload
postgresql-experts-inc
View
381
Download
3
Embed Size (px)
Citation preview
Scale Failor, how I learned to stop worrying
and love the downtime
Downtimeis
Sexy
1. Be Trendy
Resource MonitoringPerformance TestingTraffic MonitoringLoad TestingTuning Analysis
N O
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!
Barn Door Troubleshooting
Parallel Programming
NOT SEXY
Don'tWorryAbout
ItProgram-
ming SEXY
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
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
The New Way: Direct2DB
DB
WebServer
WebServer
WebServer
HT
TP
Ca
che
Easy to Scale
For Wimps!
● Web servers● Caches● Shared-nothing hosts● Simple App Servers
Hard to Scale
For Real Developers!
● Databases● Queues● Shared Filesystems● Web Frameworks
SPoF
UserDB
AppServer
AppServer
AppServer
WebServer
WebServer
WebServer
PageDB
Single Point of Failure
LoadBalancer
TaskManager
LoadBalancer
UserDB
AppServer
AppServer
WebServer
WebServer
WebServer
PageDB
Cascading Failure
LoadBalancer
TaskManager
LoadBalancer
Be Sexy:
Go Down!