Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Moving to production
Search
Fabian Król
August 05, 2016
Programming
64
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Moving to production
Fabian Król
August 05, 2016
Other Decks in Programming
See All in Programming
ソニーのクラウド共通基盤の変遷とAI時代の開発スタイルに合わせた進化 / The Journey of Sony’s Common Cloud Platform and Its Evolution for AI-Native Development
kenjiyoneyama
0
270
Domain-Driven Transformation
hschwentner
2
2.3k
contenteditable と日本語入力に向き合う
colorful12
0
200
AIに “答え“を書かせるのを やめてみた
___akari11
0
120
Railsのためのパスキー実践入門 〜マルチテナントSaaSでの意思決定〜
utakaha
2
540
[2026-09-26]空論ジェネリックプロセス~テスト資産とAIで紡ぐ、再現可能なパフォーマンスチューニングの話~
tosite
0
270
Long Living Tokens, Die, Die, Die! (or: The One Ring is Banned in Modern)
sylph01
0
300
KiroのSpecで「五目並べ」を作ってみる
satoshi256kbyte
1
380
Workers Cache を知る
syumai
0
360
Everything will be SERVERLESS — 信じて運用した10年の経験値 / Everything Will be Serverless — Lessons Learned from 10 Years of Operational Experience
seike460
PRO
1
1.1k
Event is what happens
moro
2
770
Jetpack Compose Mechanisms
skydoves
3
820
Featured
See All Featured
How to audit for AI Accessibility on your Front & Back End
davetheseo
0
600
Rails Girls Zürich Keynote
gr2m
96
14k
Lightning talk: Run Django tests with GitHub Actions
sabderemane
0
300
The Curious Case for Waylosing
cassininazir
1
570
Marketing Yourself as an Engineer | Alaka | Gurzu
gurzu
0
330
Reflections from 52 weeks, 52 projects
jeffersonlam
356
22k
How To Stay Up To Date on Web Technology
chriscoyier
790
250k
Abbi's Birthday
coloredviolet
4
10k
Faster Mobile Websites
deanohume
310
32k
Building a Modern Day E-commerce SEO Strategy
aleyda
45
9.3k
Groundhog Day: Seeking Process in Gaming for Health
codingconduct
0
410
Dominate Local Search Results - an insider guide to GBP, reviews, and Local SEO
greggifford
PRO
0
370
Transcript
Moving to production Fabian Król Live Chat
Live Chat
system
project • simple proxy: chat window <—> main chat server
• http <—> protobuf • rewrite existing component
traffic requirements • 6M req/min • 700M MAU • 1.9
Gbps (95 percentile) • 3 Gbps DDoS
WHY ERLANG
WHY ERLANG pure experiment!!!1111oneone
it’s ready • 9 months of development • 1 student
• 204 commits • 9260 insertions(+)
it’s ready we just need to move it to production
it’s ready we just need to move it to production
it’s ready we just need to move it to production
#1: test • from • no tests • to •
few unit test for critical functions • public api integration testing • CI on every commit (travis)
#2: release • release quick and release often • independent
builds • easy to track • easy to rebuild old versions • one line deployment • master + develop + build from tag
#3: debug • make it easy to debug on production
#4: monitoring • system level monitoring (erld) • erlang vm
is not really unix-friendly • zabbix • os level monitoring • app level alerting • graphite • app level metrics
feature requirements • tests • metrics
moving to production
how to replace existing system • blue green deployment •
canary release √
how to replace existing system • step 1: 2% of
traffic with sticky session • •
how to replace existing system • step 1: 2% of
traffic with sticky session • step 2: 2% of traffic without sticky session •
how to replace existing system • step 1: 2% of
traffic with sticky session • step 2: 2% of traffic without sticky session • step 3: 0% of traffic for 1.5 month
– unknown artist “It’s hard to rewrite systems.”
it’s hard • reproduce all features • reproduce all bugs
- PreparedBody = re:replace(lists:droplast(Body), "\"", "\\\\\"", [global]), + Body1 =
lists:droplast(Body), + Body2 = re:replace(Body1, "\\\\", "\\\\\\\\", [global]), + PreparedBody = re:replace(Body2, "\"", "\\\\\"", [global]),
hosts • hardware √ | cloud • virtualization √ |
bare metal • 4 √ | 8 | 16 | 32 cpus
hosts: tunning • hardware √ | cloud • virtualization |
bare metal √ • 4 | 8 √ | 16 | 32 cpus
hardware comparison • 1.3x more cpus to handle traffic •
(we can go up to 1.16) • memory is not important
code comparison • erlang: 5515 LOC • c++: 15681 LOC
35% ✨
100% • 6 months • 600 commits • 7521 insertions(+)
• 5902 deletions(-)
– unknown artist “It’s hard to rewrite systems.”
erlang pros • it’s easy to write code • small
codebase • it’s easy to collect metric (?) • it allows to debug and trace on live production host
WHY ERLANG
WHY ERLANG *it works under a heavy traffic*
schedulers • one per vm thread (one per cpu) •
does it owns memory management • reductions: • process is re-scheduled after N reductions • no process can block the system
GC • each process have private heap • per proces
GC • it's quick
⚡