Upgrade to Pro — share decks privately, control downloads, hide ads and more …

The Node.js Scalability Myth

The Node.js Scalability Myth

Presentation given at the BerlinJS user group on March 15, 2012.

Felix Geisendörfer

March 16, 2012
Tweet

More Decks by Felix Geisendörfer

Other Decks in Programming

Transcript

  1. The Node.js Scalability Myth • Threads don’t scale • Event

    loops do (Probably) not true in 2012 (Very likely) not relevant
  2. CPU

  3. CPU • Node is single threaded (runs on a single

    CPU) • Using multiple CPUs requires multiple node processes (usually via prefork) • No shared memory
  4. CPU (v8) • V8 compiles JS to Assembly • Just-in-time

    compilation (JIT) • Does reasonably well in those language “benchmarks”
  5. 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
  6. Network • Node’s network stack is a thin layer on

    top of underlaying system calls • Good at fully saturating network interfaces
  7. Disk • Done in thread pool • Unfortunately along with

    DNS at this point • Throughput ok, but not ideal yet
  8. Horizontal Scalability • Node has no horizontal scaling specific features,

    but ... • Fast networking & JSON / Buffers -> DIY
  9. Horizontal Scalability • Simple stack (requires only build tools, python)

    • Deployable without container server • Good package management via npm