The Node.js Debug Module: Advanced Usage

In a previous post, I explained the debug module and how to use it for basic debugging.  I recently used it to help me understand complex interactions between events in Leaflet and Leaflet.Editable. Before going over that, however, I’m going to lay the groundwork with a couple organizational tips that makes debug easier to use. This post assumes you have either used debug or read the previous post…. Read more

Tips for Optimizing Slow Code in Node.js

Node.js programs can be slow due to CPU or IO bound operations. On the CPU side, typically there is a “hot path” (a code that is visited often) that is not optimized. On the IO side, limits imposed by either the underlying OS or Node itself may be at fault. Or, a slow application may have nothing to do with Node; instead, an outside resource, like database queries or a slow API call, may not be optimized.

In this article, we will focus on identifying and optimizing CPU heavy operations in our codebase. We will explore taking profiles of our production application in order to analyze them and make changes to improve efficiency. Read more

Best Practices for Express in Production, Part Two: Performance and Reliability

by Hage Yaapa and C. Rand McKinney

This is a two-part blog series about some best practices for running Express applications in production. The first part was about security, and this second part focuses on performance and reliability.  It assumes you are already familiar with the basics of Node.js and web development practices and covers topics and concepts especially relevant to the production environment.

If you haven’t already, be sure to also read Part 1 on security!
Read more

Tracking Down Performance Bottlenecks in Node.js with Meteor & StrongLoop

Please note that as of Aug 3, 2015, StrongOps has been EOL’d. Check out StrongLoop Arc for the same capabilities and more.

A few weeks ago our friend Matt Debergalis from Meteor reached out and said they’d been seeing intermittent slowdowns on Percolate Studio‘s AtmosphereJS, the package management system for Meteor packages. They could reproduce the problem with enough time and load on certain applications and suspected an issue of libuv or event loop interaction with the fibers infrastructure in Meteor. Could StrongLoop lend some of it’s expertise to help get to the root of the problem? To set about investigating, we worked with the Percolate team to leverage the pre-release version of lapse, an upcoming strong-agent feature.

Upon running with lapse for some time they were able to catch the problem. For now lapse creates a log file because we don’t yet have a visualization. In analyzing the log file, the critical portions I noticed looked like this:

Read more