Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Deploying, at an Unusual Scale
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Andrew Godwin
October 22, 2011
Programming
670
7
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Deploying, at an Unusual Scale
A talk I gave at DjangoCon Europe 2011, about Epio's internal architecture at that point.
Andrew Godwin
October 22, 2011
More Decks by Andrew Godwin
See All by Andrew Godwin
Reconciling Everything
andrewgodwin
1
400
Django Through The Years
andrewgodwin
0
320
Writing Maintainable Software At Scale
andrewgodwin
0
520
A Newcomer's Guide To Airflow's Architecture
andrewgodwin
0
420
Async, Python, and the Future
andrewgodwin
2
740
How To Break Django: With Async
andrewgodwin
1
830
Taking Django's ORM Async
andrewgodwin
0
850
The Long Road To Asynchrony
andrewgodwin
0
770
The Scientist & The Engineer
andrewgodwin
1
860
Other Decks in Programming
See All in Programming
自作OSでスライド発表する
uyuki234
1
3.6k
Webフレームワークの ベンチマークについて
yusukebe
0
190
例外の正しい扱い方 そのエラー try-catchして大丈夫?
jinwatanabe
0
330
気圧・高度・GPSを記録&可視化するアプリ「Koudo」を作った話
hjmkth
1
340
AI駆動開発を妨げる技術的負債の解消アプローチ / ai-refactoring-approach
minodriven
17
8.6k
これからAgentCoreを触る方へトレンドはGatewayです
har1101
6
470
AIエージェントで 変わるAndroid開発環境
takahirom
1
410
Semantic Version 単位で戦略を柔軟に変えて、パッケージアップデートを自動化する
daitasu
1
340
Go1.27で導入されるジェネリクスメソッドでできること
mackee
0
240
決定論的オーケストレーションの設計と実装 / Design and Implementation of Deterministic Orchestration
nrslib
4
1.6k
なぜ関数型プログラミングで「型」と「証明」が語られるのか #fp_matsuri
kajitack
2
430
技術記事、 専門家としてのプログラマ、 言語化
mizchi
14
7.3k
Featured
See All Featured
Leveraging Curiosity to Care for An Aging Population
cassininazir
1
310
Reflections from 52 weeks, 52 projects
jeffersonlam
356
21k
Dominate Local Search Results - an insider guide to GBP, reviews, and Local SEO
greggifford
PRO
0
200
Code Reviewing Like a Champion
maltzj
528
40k
sira's awesome portfolio website redesign presentation
elsirapls
0
290
Noah Learner - AI + Me: how we built a GSC Bulk Export data pipeline
techseoconnect
PRO
0
210
Stewardship and Sustainability of Urban and Community Forests
pwiseman
0
250
How to build a perfect <img>
jonoalderson
1
5.8k
Exploring anti-patterns in Rails
aemeredith
3
440
RailsConf 2023
tenderlove
30
1.5k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
32
3.6k
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.8k
Transcript
Deploying, At An Unusual Scale Andrew Godwin http://www.flickr.com/photos/whiskeytango/1431343034/ @andrewgodwin
Hi, I'm Andrew. Serial Python developer Django core committer Co-founder
of ep.io
Hi, I'm Andrew. Serial Python developer Django core committer Co-founder
of ep.io Occasional fast talker
""Andrew speaks English like a machine gun speaks bullets."" Reinout
van Rees
We're ep.io Python Platform-as-a-Service Easy deployment, easy upgrades PostgreSQL, Redis,
Celery, and more
Why am I here? Our Architecture How we deploy Django
How varied Django deployments are
Our Architecture
Balancer Runner Runner Runner App 1 App 2 App 3
App 2 App 4 App 1 Databases File Storage Balancer
Oh My God, It's Full of Pairs Everything is redundant
Distributed programming is Hard
Hardware Real colo'd machines Linode EC2 (pretty unreliable) (pretty reliable)
(pretty reliable) IPv6 (as much as we can)
ØMQ We used to use Redis Everything now on ZeroMQ
Eliminates SPOF* * Single Point Of Failure. What a pointless acronym.
ØMQ Usage Redundant location-resolvers (Nexus) REQ/XREP for control messages PUSH/PULL
for stats, logs PUB/SUB for heartbeats, locking
Runners Unsurprisingly, these run the code SquashFS filesystem images Virtualenvs
per app UID & permission isolation, more coming
Logging/Stats All done asynchronously using ØMQ Logs to filesystem (chunked
files) Stats to PostgreSQL database, for now
Loadbalancers Intercept all incoming HTTP requests Look up hostname (or
suffix) HTTP 1.1 compliant
Databases Shared (only for PostgreSQL) Dedicated (uses Runner framework) PostgreSQL
9, damnit
Django in the backend We use the ORM extensively Annoying
settings fiddling in __init__
www.ep.io Runs on ep.io, just like any other app* Provides
JSON API, web UI * Well not quite - App ID 0 is special - but we're working on it
WSGI It's a standard, right?
WSGI It's a standard, right? Well, yes, and it works
fine, but it's not enough for serving a Python app
Static Files CSS, images, JavaScript, etc. Needs a URL and
a directory path
Python & Dependencies Mostly filled by pip/buildout/etc packaging apparently allows
version spec
Deploying Django It makes things consistent, right?
Settings Layouts Vanilla settings.py local_settings.py configs/HOSTNAME.py Many others...
Python Paths Project-level imports App-level imports apps/ directories
Databases If it's SQL, it's PostgreSQL Redis for key-value, MongoDB
soon Some things assume a safe network
HA (High Availability) Not terribly easy with shared DBs PostgreSQL
9's sensible warm standby Redis has SLAVEOF Possibly use DRBD for general solution
Backups High Availability is NOT a backup btrfs for consistent
snapshotting Archived remote syncs No access to backups from servers
Migrations No solution yet for migration/code sync We're working on
it...
Web serving It's not like it's important or anything
gunicorn Small and lightweight Supports long-running requests Pretty stable
nginx Even more lightweight Extremely fast Really, really stable
The Load Balancer Used to be HAProxy Rewritten to custom
Python daemon eventlet used for high throughput Can't use nginx, no HTTP 1.1 for backends
Celery See: Yesterday's Talk Slightly tricky to run many We
use Redis as the backend
Management Commands First off, run as subprocess Then, a custom
PTY module Now, run as pty-wrapping subprocesses
Some General Advice If you're crazy enough to do this
Messaging's Not Enough Having a state to check is handy
Why run one, when you can run two for twice
the price? Redundancy is good. Double redundancy is better.
Always expect the worst Hope you never have to deal
with it.
The more backups, the better. Make sure you have historical
ones, too.
Django is very flexible Sometimes a little too flexible...
Your real problems will emerge later Don't over-optimise up front
for everything
Questions? Andrew Godwin
[email protected]
@andrewgodwin