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

NodeJS in Production

Mark Wolfe
October 22, 2014

NodeJS in Production

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

Mark Wolfe

October 22, 2014
Tweet

More Decks by Mark Wolfe

Other Decks in Technology

Transcript

  1. NodeJS In Production

    View Slide

  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

    View Slide

  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

    View Slide

  4. Operational Visibility cont.
    Get a chat room for ops events, Engineering
    hipchat
    slack
    All events go to this room
    commits + deploys + badness + gifs

    View Slide

  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

    View Slide

  6. Logging
    What happened?
    When did this happen?
    Where in our codebase did this happen?
    File and Line Number
    Visible from anywhere and searchable

    View Slide

  7. Health Checks
    Health Checks
    SQL server connection status
    Redis connection status
    Anything your app depends on to operate

    View Slide

  8. Monitoring Suite
    Pager Duty
    Pingdom
    Librato
    Bugsnag

    View Slide

  9. Demo Code!

    View Slide

  10. Memory Leaks
    Every production node app I have seen has them
    V8 Memory leaks
    Buffer leaks (fragmentation)
    Everything is Lazy

    View Slide

  11. Eliminating Leaks
    v8 profiler, learn to use it
    node-tick (more links in readme)
    Watch the v8 tuning presentations!
    Why bother?

    View Slide

  12. Questions
    CTO at Ninja Blocks http://ninjablocks.com/
    @wolfeidau on twitter
    github.com/wolfeidau

    View Slide