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
To a thousand servers and beyond: scaling a mas...
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Nikolay Bachiyski
February 25, 2012
Programming
1.5k
3
Share
To a thousand servers and beyond: scaling a massive PHP application
Stories of abstraction and scaling WordPress.com. And what they have in common.
Nikolay Bachiyski
February 25, 2012
More Decks by Nikolay Bachiyski
See All by Nikolay Bachiyski
React.js for WordPress Developers
nb
0
290
Building Calypso-like Applications
nb
3
860
Else Considered Harmful
nb
2
1.1k
On Learning
nb
2
800
WordPress: To OOP or not to OOP
nb
4
8.1k
On Creeds and Manifestos
nb
2
220
Welcome to the Chaos – The Distributed Workplace
nb
3
220
Взимане на продуктови решения (Making product decisions)
nb
0
160
Other Decks in Programming
See All in Programming
GitHub Copilot CLIのいいところ
htkym
2
1.1k
TypeSpec で繋ぐ複数プロダクトの型安全
maroon8021
1
260
AIエージェントと協働するCLI開発 — BunとOpenClawで学んだこと
yoshikouki
1
220
ECR拡張スキャンでSBOMを収集して サプライチェーン攻撃の影響調査を 爆速で終わらせてみた
akihisaikeda
2
200
サーバーレスで作る、動画データ管理基盤
oyasumipants
0
290
[KCD Czech] eBPF Meets the GPU: Future of AI Infra Observability
doniacld
0
110
TSKaigi2026-静的解析への投資がAI時代のコード品質を支える ── カスタムESLintルールの設計と運用
hayatokudou
6
1.2k
Moments When Things Go Wrong
aurimas
3
120
AlarmKitで明後日起きれるアラームアプリを作る
trickart
0
160
TypeScriptだけでAIエージェントを作る フロント・エージェント・インフラのフルスタック実践
har1101
6
1.1k
Signal Forms: Beyond the Basics @ngBaguette 2026 in Paris
manfredsteyer
PRO
0
150
AI 時代のソフトウェア設計の学び方
masuda220
PRO
28
10k
Featured
See All Featured
Design in an AI World
tapps
1
220
Building a Modern Day E-commerce SEO Strategy
aleyda
45
9.1k
How to optimise 3,500 product descriptions for ecommerce in one day using ChatGPT
katarinadahlin
PRO
1
3.6k
A designer walks into a library…
pauljervisheath
211
24k
Dominate Local Search Results - an insider guide to GBP, reviews, and Local SEO
greggifford
PRO
0
180
The browser strikes back
jonoalderson
0
1.1k
Measuring & Analyzing Core Web Vitals
bluesmoon
9
840
The innovator’s Mindset - Leading Through an Era of Exponential Change - McGill University 2025
jdejongh
PRO
1
180
How Software Deployment tools have changed in the past 20 years
geshan
0
34k
The Hidden Cost of Media on the Web [PixelPalooza 2025]
tammyeverts
2
310
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
55
3.3k
Amusing Abliteration
ianozsvald
1
180
Transcript
To 1000 servers and beyond Nikolay Bachiyski PHPUK 2012
http://extrapolate.me/ @nikolayb
None
None
None
Stinson Beach, July 2007
Budapest, Oct 2011
Jul, 2007 65MM Feb, 2011 800MM PV
2 stories
Story #1
Deep Pink Meet
Don’t like?
Beer Beheader =
None
None
Abstraction
None
Beer Theory
None
Want to be better?
Get to know the abstraction below
Servers are below
Story #2 Scaling WordPress.com
None
X
Deep Pink SAD
None
X
Deep Pink SAD
None
None
Users Blogs Blogs
No joins :(
None
SELECT * FROM wp_users WHERE id=43315 SELECT * FROM wp_posts
LIMIT 10
HyperDB
None
SELECT * FROM wp_users WHERE id=43315
Query parsing
add_db_table('user', 'wp_users') Dataset Table name
add_db_server('user', 0, 1, 0,
'db42.wordpress.com',…) Dataset Partition Read Write Slave
Failover X
Can work without
http://wordpress.org/extend/plugins/hyperdb/
None
None
C C C C
$count = wp_cache_get('posts', 'counts'); if ( false !== $count )
return $count; $count = $wpdb-‐>get_results($complex_query);
Output caching
10% 90% reads writes
C C C C
C C C C
Deep Pink SAD
Datacenter
C C sane sane
C C crazy sane Update
C C crazy sane Stale!
C C crazy crazy
Deploy
trunk/
Branch in code
~100 commits a day
~100 deploys a day
to ~1000 servers
One-click
None
Fast!
wpdev@nikolay:~$ deploy wpcom Going to update from 47127 to 47128
Syncing wpcom SVN Mirrors ORD (0s)... LUV (0s)... SAT (0s)... Deploying wpcom revision 47128 ORD (3s)... SAT (5s)... LUV (6s)... Revision 47128 successfully deployed (8s)
None
None
Yeah, immediately!
Push to twitter
Push to Facebok
Stats
Spam checks
Index for search
Invalidate caches
Publish the post
ASYNC JOBS
None
$job_id = queue_async_job($data, 'encode_video');
Priorities
Deferred jobs
None
PHP & MySQL
http://code.trac.wordpress.org/wiki/JobsDocs http://code.trac.wordpress.org/browser/jobs
Integration
Hacking
None