Save 37% off PRO during our Black Friday Sale! »

The Node.js Scalability Myth

The Node.js Scalability Myth

Talk given at the Munich Node.js Meetup on 14.06.2012.

23968f0ca75b13463d2db5343e5c2096?s=128

Felix Geisendörfer

June 16, 2012
Tweet

Transcript

  1. The Node.js Scalability Myth Felix Geisendörfer 14.06.2012 at Munich node.js

    user group
  2. None
  3. Felix Geisendörfer

  4. transloadit.com

  5. core contributor

  6. npm modules

  7. node-formidable

  8. node-mysql

  9. ~50 modules total

  10. (@)felixge(.de)

  11. Background

  12. I need to build an über-scalable web service. It will

    be the next big thing!
  13. Easy! I will use node.js and MongoDB!

  14. Easy! I will use node.js and MongoDB!

  15. Because node.js is “scalable”, right?

  16. None
  17. This Talk

  18. #1 Consider Reality

  19. Using node for performance reasons?

  20. Measuring performance in production?

  21. 1000 req / s

  22. 100 req / s

  23. 10 req / s 10 req / s

  24. ~1 million requests per day

  25. ~1 million units of value

  26. None
  27. #2 Node Scales Vertically

  28. Adding more resources to a single node

  29. None
  30. CPU

  31. Google V8

  32. JS -> Assembly

  33. Crankshaft JIT

  34. Fast

  35. Single Threaded* * For most parts

  36. Computers of the future will have hundreds of cores!

  37. Node’s Multi-Core Story

  38. Pre-fork

  39. IPC

  40. Like Ruby, Python, PHP, etc.

  41. But ... shared memory?

  42. Your problem requires shared memory?

  43. JavaScript is not your language

  44. Good Luck

  45. Memory

  46. No hard limit on 64bit (since node-0.6 / v8-3.7)

  47. However

  48. Avoid huge heaps

  49. Disk

  50. Done in thread pool

  51. Along with DNS

  52. No sendfile()

  53. None
  54. Network

  55. None
  56. Non-blocking I/O

  57. tl;dr

  58. pre-fork & non-blocking i/o

  59. #3 Horizontal Scaling is hard

  60. CAP

  61. Network Partitions

  62. Consistency

  63. Availability

  64. Some Tips

  65. Shared Nothing

  66. Messaging

  67. Monitoring

  68. The Node.js Scalability Myth

  69. Threads do not scale Node.js scales

  70. Threads do not scale Node.js scales

  71. Node is a tool

  72. None
  73. None
  74. None
  75. If you can’t duc it F#@k it

  76. Questions? Slides will be available at felixge.de

  77. Thanks

  78. Tool Demo