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

NodeJS in Production

Ebf974e0dbcfe88c508df6f395661a4b?s=47 Mark Wolfe
October 22, 2014

NodeJS in Production

Talk I gave at NodeJS meetup in Melbourne about running and monitoring applications in production.

Ebf974e0dbcfe88c508df6f395661a4b?s=128

Mark Wolfe

October 22, 2014
Tweet

Transcript

  1. NodeJS In Production

  2. Some Background Ninjablocks has been using NodeJS for ~3 years

    Used in a range of web and realtime services Running on Heroku and AWS Also running on 1000s ARM devices
  3. Operational Visibility Add graphs for things business metrics! Add graphs

    for key system performance metrics Tune logging to remove noise Simple deterministic deployment process Error Monitoring
  4. Operational Visibility cont. Get a chat room for ops events,

    Engineering hipchat slack All events go to this room commits + deploys + badness + gifs
  5. Graphs Business Metrics! Orders, Payments and Signups CPU Usage /

    Load Memory Usage RSS (Resident Set Size) and V8 Heap Total / Used Event Loop Delay
  6. Logging What happened? When did this happen? Where in our

    codebase did this happen? File and Line Number Visible from anywhere and searchable
  7. Health Checks Health Checks SQL server connection status Redis connection

    status Anything your app depends on to operate
  8. Monitoring Suite Pager Duty Pingdom Librato Bugsnag

  9. Demo Code!

  10. Memory Leaks Every production node app I have seen has

    them V8 Memory leaks Buffer leaks (fragmentation) Everything is Lazy
  11. Eliminating Leaks v8 profiler, learn to use it node-tick (more

    links in readme) Watch the v8 tuning presentations! Why bother?
  12. Questions CTO at Ninja Blocks http://ninjablocks.com/ @wolfeidau on twitter github.com/wolfeidau