5 tips to ensure optimal performance of Node.js apps

June 15 2015
 


In this software-defined world, where enterprises are delivering most of their services via web applications and mobile apps, it is very important for them to ensure their customers are getting excellent experience. Node.js is rapidly becoming one of the most popular platforms for building fast and scalable web and mobile applications. The Infographic, Node.js Goes Mainstream in the Enterprise, from StrongLoop does a good job of capturing the tremendous growth. 

As we know, Node.js is a single threaded server that fires a new event that runs some code, performs some I/O and calls back when it’s done. This event-driven asynchronous calls based computing paradigm is great for I/O intensive applications like many of the web and mobile applications, but, keeping track of these multiple of asynchronous calls and associated with a business transaction is a difficult task.

I was reading an InfoWorld article, “Node.js goes pro: New opportunities — and risks“, over the weekend. In this article, Serdar Yegulalp provides great commentary on the opportunities and risks associated with Node.js powered apps. He talks about the exit of TJ Holowaychuk, creator of Koa, Express, and the Node.js-canvas project, from the Node.js development world. To Holowaychuk, Node.js is a worthy and powerful project, but “performance means nothing if your application is frail, difficult to debug, refactor and develop”, a quote from this article really highlights the challenges with Node.js application environment. 

Now that Node.js is going mainstream and enterprises are using Node.js to power their business-critical mobile and web applications, the visibility into the Node.js application infrastructure, the asynchronous calls placed through it, and its dependencies on supporting applications and hardware infrastructure have become critical for enterprises.

This is exactly where an Application Performance Management (APM) solution can help enterprises monitor their Node.js applications in real-time, drill down into call stacks, correlate transactions traversing across your distributed environment, and diagnose performance bottlenecks while running in a live production or development environment. Enterprises need this visibility in order to address potential issues before they actually impact their customers. They need a way to drill down to the source code in order to debug any performance issue that can result into poor end-user experience and may be a poor rating of their apps.

Here are 5 tips for ensuring optimal performance of your Node.js apps: 

  1. Get end-to-end visibility into your Node.js application environment: Look for an APM solution that can automatically discover application topology and interdependencies, trace key business transactions based on production application behavior and correlate them. Your solution should be able to keep track of all the asynchronous calls made in the Node.js event loop and sew them together in context with a business transaction. You should be able to visualize and prioritize the end to end business transactions performance and not just the health of the application and infrastructure nodes.
  2. Detect application errors and exceptions in real-time: Your APM solution should be able to detect the errors and exceptions thrown by application components in real time. By tracking the performance of business transactions continuously, you should be able to find slower transactions that are deviated from the normal performance range , drill down into the actual problem and fix the errors or proactively address the exceptions before they actually impact the end-users. 
  3. Monitor Applications at code-level depth: You should be able to drill down to the source code level depth to troubleshoot any application performance issue. Consider having a solution that can offer an in-depth application monitoring with detailed call graph ( see an example below ) for all these asynchronous calls made from the Node.js event loop. You should be able to easily locate hot spots and slow methods within your application code by drilling down all the way from web browser or mobile app. 

  1. Keep an eye on your end-user experience: You should be able to visually monitor your mobile and web user experience across the globe in context with the performance of your Node.js powered applications using the same them that allows you monitor your application performance . This will allow you to rapidly identify the exact offending line of code in Node.js application impacting the end-user and address them before they share their experience on social media, quit your app and rate poorly on app store and other review sites.
  2. Watch the performance of supporting databases and servers in context with your Node.js applications: Node.js is considered ideal for modern I/O intensive web applications where you make frequent non-blocking calls to databases. So, it is very important for you to watch the performance of the supporting database, servers and other supporting infrastructure in context with your Node.js applications. You should be able to drill down to the slow queries, stored procedures or the hardware infrastructure issues from the Node.js applications for rapid problem diagnosis and resolution.

AppDynamics APM solution for Node.js applications can help you with all of the above tips and much more to ensure excellent performance of your Node.js-powered web or mobile applications. Check out a FREE trial of AppDynamics today

Anand Akela
Anand Akela is Director of Product Marketing for Application Performance Management (APM) at AppDynamics. Prior to his current role, Anand was head of product marketing of APM at CA Technologies. Earlier he worked at Oracle and HP in various product marketing, product management, and engineering roles in the systems management, servers, data center energy efficiency, and enterprise software areas. Anand has more than 20 years of experience in product marketing, product management, strategic planning and software development. Anand received his MBA from The Fuqua School of Business, Duke University and a B.S. in Computer Science from Pune University in India. You can follow Anand on twitter at https://twitter.com/aakela

Thank you! Your submission has been received!

Oops! Something went wrong while submitting the form