SYS-CON MEDIA Authors: Yeshim Deniz, Zakia Bouachraoui, Liz McMillan, Janakiram MSV, Carmen Gonzalez

Blog Feed Post

The AppD Approach: Using Flame Graphs to Debug Node.js Apps

In my day job, I work to help people understand performance and reliability issues in distributed applications across a number of different technologies including Java, .NET, and Node.js. A few years ago, I started to see a rise in the adoption of Node.js, with some large organizations like PayPal making a major shift to the language. This trend has continued and I now find myself working with Node.js in my own projects on a regular basis. One of the challenges I faced when first learning to understand Node.js performance data was getting my head around the concept of the Event Loop, and which parts of the event lifecycle were the most important to pay attention to. This is where Flame Graphs came in.

Flame Graphs were invented by Brendan Gregg in 2011 while he was working to understand CPU usage and its role in diagnosing a MySQL performance issue. In doing so, Gregg created a visualization which ended up being ideally suited to helping interpret data which is sampling a stack, for example a set of Node.js stacks taken from a cycle of the Event Loop. Since 2011 these graphs have been used for a number of different purposes including looking at resource usage, method invocations and file systems.

To gather information to help understand where time is spent in Node.js, it’s common to use the V8 Profiler which is part of the Node.js V8 Engine. This collects data about the event loop including where it spends time, what it puts on the heap, and what specific function is blocking the Event Loop. Interpreting this data in raw text, or even a tree can be difficult and time consuming. The data is great, but getting insight from it relies on experience. Once a Flame Graph is used to understand this data, it becomes a lot easier to identify where bottlenecks are occuring.

The example below is intentionally simple but it follows the same basic concept Brendan invented. Across the X-Axis are samples which are periodically taken of the Event Loop using the V8 Profiler, telling us what function is currently executing. On the Y-Axis we have the stack for that function call. Now we can see where the code can be optimized. I’ve added a red box to show the data of interest. At the bottom of this section we see a call to the formatValue function, which then proceeds through formatValue and formatArray eventually leading back to this same code with a couple of levels of recursion. With this information in hand, I now know where I can get the biggest benefit to any change, and perhaps equally important, which parts of the codebase are likely to yield little improvement as they don’t contribute a significant amount of execution time.

At AppDynamics, we have been monitoring Node.js applications for some time, but we’ve recently added flame graphs to bring the value of these visualizations to our debugging process. I’ve had the chance to work with a number of our customers and they find these a great addition to our solution. It has helped remove some of the application knowledge which they needed previously to get to the root cause of event loop slowdown issues. This is helping Operations and on-call DevOps engineers to more easily triage problems with code they are unfamiliar with or didn’t develop.

You can find more information on how AppDynamics can help with identifying event loop blocking here.

Changes like this may seem small, but adding flame graphs to the existing end-to-end monitoring across multi-technology environments can have a major impact on mean time to resolution. If you’re not already using AppDynamics to monitor your Node.js applications, you can sign up for a free trial to see what you think.

The post The AppD Approach: Using Flame Graphs to Debug Node.js Apps appeared first on Application Performance Monitoring Blog | AppDynamics.

Read the original blog entry...

More Stories By AppDynamics Blog

In high-production environments where release cycles are measured in hours or minutes — not days or weeks — there's little room for mistakes and no room for confusion. Everyone has to understand what's happening, in real time, and have the means to do whatever is necessary to keep applications up and running optimally.

DevOps is a high-stakes world, but done well, it delivers the agility and performance to significantly impact business competitiveness.

Latest Stories
The standardization of container runtimes and images has sparked the creation of an almost overwhelming number of new open source projects that build on and otherwise work with these specifications. Of course, there's Kubernetes, which orchestrates and manages collections of containers. It was one of the first and best-known examples of projects that make containers truly useful for production use. However, more recently, the container ecosystem has truly exploded. A service mesh like Istio a...
Technology has changed tremendously in the last 20 years. From onion architectures to APIs to microservices to cloud and containers, the technology artifacts shipped by teams has changed. And that's not all - roles have changed too. Functional silos have been replaced by cross-functional teams, the skill sets people need to have has been redefined and the tools and approaches for how software is developed and delivered has transformed. When we move from highly defined rigid roles and systems to ...
After years of investments and acquisitions, CloudBlue was created with the goal of building the world's only hyperscale digital platform with an increasingly infinite ecosystem and proven go-to-market services. The result? An unmatched platform that helps customers streamline cloud operations, save time and money, and revolutionize their businesses overnight. Today, the platform operates in more than 45 countries and powers more than 200 of the world's largest cloud marketplaces, managing mo...
BMC has unmatched experience in IT management, supporting 92 of the Forbes Global 100, and earning recognition as an ITSM Gartner Magic Quadrant Leader for five years running. Our solutions offer speed, agility, and efficiency to tackle business challenges in the areas of service management, automation, operations, and the mainframe.
Docker and Kubernetes are key elements of modern cloud native deployment automations. After building your microservices, common practice is to create docker images and create YAML files to automate the deployment with Docker and Kubernetes. Writing these YAMLs, Dockerfile descriptors are really painful and error prone.Ballerina is a new cloud-native programing language which understands the architecture around it - the compiler is environment aware of microservices directly deployable into infra...
The widespread success of cloud computing is driving the DevOps revolution in enterprise IT. Now as never before, development teams must communicate and collaborate in a dynamic, 24/7/365 environment. There is no time to wait for long development cycles that produce software that is obsolete at launch. DevOps may be disruptive, but it is essential. DevOpsSUMMIT at CloudEXPO expands the DevOps community, enable a wide sharing of knowledge, and educate delegates and technology providers alike.
The graph represents a network of 1,329 Twitter users whose recent tweets contained "#DevOps", or who were replied to or mentioned in those tweets, taken from a data set limited to a maximum of 18,000 tweets. The network was obtained from Twitter on Thursday, 10 January 2019 at 23:50 UTC. The tweets in the network were tweeted over the 7-hour, 6-minute period from Thursday, 10 January 2019 at 16:29 UTC to Thursday, 10 January 2019 at 23:36 UTC. Additional tweets that were mentioned in this...
The platform combines the strengths of Singtel's extensive, intelligent network capabilities with Microsoft's cloud expertise to create a unique solution that sets new standards for IoT applications," said Mr Diomedes Kastanis, Head of IoT at Singtel. "Our solution provides speed, transparency and flexibility, paving the way for a more pervasive use of IoT to accelerate enterprises' digitalisation efforts. AI-powered intelligent connectivity over Microsoft Azure will be the fastest connected pat...
At CloudEXPO Silicon Valley, June 24-26, 2019, Digital Transformation (DX) is a major focus with expanded DevOpsSUMMIT and FinTechEXPO programs within the DXWorldEXPO agenda. Successful transformation requires a laser focus on being data-driven and on using all the tools available that enable transformation if they plan to survive over the long term. A total of 88% of Fortune 500 companies from a generation ago are now out of business. Only 12% still survive. Similar percentages are found throug...
Apptio fuels digital business transformation. Technology leaders use Apptio's machine learning to analyze and plan their technology spend so they can invest in products that increase the speed of business and deliver innovation. With Apptio, they translate raw costs, utilization, and billing data into business-centric views that help their organization optimize spending, plan strategically, and drive digital strategy that funds growth of the business. Technology leaders can gather instant recomm...
At CloudEXPO Silicon Valley, June 24-26, 2019, Digital Transformation (DX) is a major focus with expanded DevOpsSUMMIT and FinTechEXPO programs within the DXWorldEXPO agenda. Successful transformation requires a laser focus on being data-driven and on using all the tools available that enable transformation if they plan to survive over the long term. A total of 88% of Fortune 500 companies from a generation ago are now out of business. Only 12% still survive. Similar percentages are found throug...
In today's always-on world, customer expectations have changed. Competitive differentiation is delivered through rapid software innovations, the ability to respond to issues quickly and by releasing high-quality code with minimal interruptions. DevOps isn't some far off goal; it's methodologies and practices are a response to this demand. The demand to go faster. The demand for more uptime. The demand to innovate. In this keynote, we will cover the Nutanix Developer Stack. Built from the foundat...
As you know, enterprise IT conversation over the past year have often centered upon the open-source Kubernetes container orchestration system. In fact, Kubernetes has emerged as the key technology -- and even primary platform -- of cloud migrations for a wide variety of organizations. Kubernetes is critical to forward-looking enterprises that continue to push their IT infrastructures toward maximum functionality, scalability, and flexibility. As they do so, IT professionals are also embr...
CloudEXPO has been the M&A capital for Cloud companies for more than a decade with memorable acquisition news stories which came out of CloudEXPO expo floor. DevOpsSUMMIT New York faculty member Greg Bledsoe shared his views on IBM's Red Hat acquisition live from NASDAQ floor. Acquisition news was announced during CloudEXPO New York which took place November 12-13, 2019 in New York City.
ShieldX's CEO and Founder, Ratinder Ahuja, believes that traditional security solutions are not designed to be effective in the cloud. The role of Data Loss Prevention must evolve in order to combat the challenges of changing infrastructure associated with modernized cloud environments. Ratinder will call out the notion that security processes and controls must be equally dynamic and able to adapt for the cloud. Utilizing four key factors of automation, enterprises can remediate issues and impro...