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
The Node.js Scalability Myth
Search
Felix Geisendörfer
March 16, 2012
Programming
16
18k
The Node.js Scalability Myth
Presentation given at the BerlinJS user group on March 15, 2012.
Felix Geisendörfer
March 16, 2012
Tweet
Share
More Decks by Felix Geisendörfer
See All by Felix Geisendörfer
tus.io - Resumable File Uploads (Lightning Talk)
felixge
2
710
Programming flying robots with JavaScript
felixge
2
890
Programming flying robots with JavaScript
felixge
0
530
Programming an AR Drone Firmware with JS (de)
felixge
1
570
Faster than C?
felixge
1
1.2k
Flying robots over a 10.000 mile distance with JavaScript.
felixge
0
430
Faster than C?
felixge
1
560
The power of node.js (with quadcopters)
felixge
0
450
Faster than C?
felixge
0
360
Other Decks in Programming
See All in Programming
Go1.23で入った errorsパッケージの小さなアプデ
kuro_kurorrr
2
400
オートマトン学習しろ / Do automata learning
makenowjust
3
130
Regular Expressions, REXML, Automata Learning
makenowjust
0
220
Swiftコードバトル必勝法
toshi0383
0
170
Ebitengineの1vs1ゲーム WebRTCの活用
ponyo877
0
380
The Shape of a Service Object
inem
0
520
Patched fetch did not work
quramy
4
400
ECMAScript、Web標準の型はどう管理されているか / How ECMAScript and Web standards types are maintained
petamoriken
3
390
rbs-inlineを導入してYARDからRBSに移行する
euglena1215
1
290
Kotlin 2.0が与えるAndroid開発の進化
masayukisuda
1
420
Jakarta EE meets AI
ivargrimstad
1
540
Our Websites Need a Lifestyle Change, Not a Diet
ryantownsend
0
150
Featured
See All Featured
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
166
48k
RailsConf 2023
tenderlove
28
810
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
PRO
5
480
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
326
21k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
190
16k
The World Runs on Bad Software
bkeepers
PRO
64
11k
Gamification - CAS2011
davidbonilla
79
5k
Music & Morning Musume
bryan
46
6k
10 Git Anti Patterns You Should be Aware of
lemiorhan
653
58k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
38
9.2k
The Illustrated Children's Guide to Kubernetes
chrisshort
47
48k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
24
610
Transcript
The Node.js Scalability Myth Felix Geisendörfer 15.03.2012 at BerlinJS user
group
(@)felixge(.de)
transloadit.com (using node since v0.0.6)
core contributor
I need to build an über-scalable web service. It will
be the next big thing!
Easy! I will use node.js and MongoDB!
Easy! I will use node.js and MongoDB!
Because node.js is “scalable”, right?
None
Audience?
Backend Developers?
Are you measuring app performance in production?
1000 req / s
100 req / s
10 req / s
10 requests / per second = 864000 requests / day
10 req / s
Scalability
None
The Node.js Scalability Myth • Threads don’t scale • Event
loops do
The Node.js Scalability Myth • Threads don’t scale • Event
loops do (Probably) not true in 2012 (Very likely) not relevant
More relevant • Understanding scalability • Using the right tool
for the job
Vertical Scalability
Adding more resources to a single node
None
Vertical Scalability • CPU • GPUs • Memory • Disk
• Network
CPU
Computers of the future will have hundreds of cores!
CPU • Node is single threaded (runs on a single
CPU) • Using multiple CPUs requires multiple node processes (usually via prefork) • No shared memory
CPU (v8) • V8 compiles JS to Assembly • Just-in-time
compilation (JIT) • Does reasonably well in those language “benchmarks”
GPUs
GPUs • No support in node itself • node-cuda addon
by Kashif Rasul
Memory
Memory • No hard memory limit on 64 bit (since
node-0.6 / v8-3.6.5) • JS is a garbage collected language (avoid huge heaps) • Buffers do not count towards heap
Network
Network • Node’s network stack is a thin layer on
top of underlaying system calls • Good at fully saturating network interfaces
Disk
Disk • Done in thread pool • Unfortunately along with
DNS at this point • Throughput ok, but not ideal yet
Horizontal Scalability
Adding more nodes to a system
Horizontal Scalability • Node has no horizontal scaling specific features,
but ... • Fast networking & JSON / Buffers -> DIY
Horizontal Scalability • Simple stack (requires only build tools, python)
• Deployable without container server • Good package management via npm
Horizontal Solution “I have the full solution ...”
Horizontal Solution “... but unfortunately it did not fit on
this slide”
tl;dr • Know your requirements • There are no silver
bullets
Questions? Slides will be available at felixge.de
Thanks