The Node.js Scalability Myth

The Node.js Scalability Myth

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

23968f0ca75b13463d2db5343e5c2096?s=128

Felix Geisendörfer

March 16, 2012
Tweet

Transcript

  1. 9.
  2. 10.
  3. 18.
  4. 20.

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

    loops do (Probably) not true in 2012 (Very likely) not relevant
  5. 24.
  6. 26.

    CPU

  7. 28.

    CPU • Node is single threaded (runs on a single

    CPU) • Using multiple CPUs requires multiple node processes (usually via prefork) • No shared memory
  8. 29.

    CPU (v8) • V8 compiles JS to Assembly • Just-in-time

    compilation (JIT) • Does reasonably well in those language “benchmarks”
  9. 30.
  10. 32.
  11. 33.

    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
  12. 34.
  13. 35.

    Network • Node’s network stack is a thin layer on

    top of underlaying system calls • Good at fully saturating network interfaces
  14. 36.
  15. 37.

    Disk • Done in thread pool • Unfortunately along with

    DNS at this point • Throughput ok, but not ideal yet
  16. 40.

    Horizontal Scalability • Node has no horizontal scaling specific features,

    but ... • Fast networking & JSON / Buffers -> DIY
  17. 41.

    Horizontal Scalability • Simple stack (requires only build tools, python)

    • Deployable without container server • Good package management via npm
  18. 46.