Measuring and monitoring Node.JS server performance

Problem

I'm new to Node.JS, already Googled for aswers but there is a lot of ways of doing this. Do you have some sort of math to know when I'll need to scale my Node.JS server? And what tools you use for monitoring server performance and error track?

Thanks!

Problem courtesy of: Alan Hoffmeister

Solution

As @ThiefMaster said, this depends on your system. You need to monitor the requests for your site, the CPU load, memory footprint etc and decide if and when to add mode servers.

If you want to know more about Node.js performance read this good article: http://blog.3rd-eden.com/post/5809079469/theoretical-node-js-real-time-performance

If you need a Node.js metrics library, there are 2 ones which I can recommend:
https://github.com/felixge/node-measured
https://github.com/mikejihbe/metrics

Resources:

monitoring a node.js server

Solution courtesy of: alessioalex

Discussion

I recommend monitoring your event loop and if it starts to back up more than 200ms on a regular basis, you'll need to scale.

Discussion courtesy of: Dave W

This recipe can be found in it's original form on Stack Over Flow.