Table of Contents
Fetching ...

Node Compass: Multilevel Tracing and Debugging of Request Executions in JavaScript-Based Web-Servers

Herve Mbikayi Kabamba, Matthew Khouzam, Michel Dagenais

TL;DR

The paper tackles the difficulty of debugging performance in Node.js microservices by introducing a transparent, low-overhead tracing framework that reconstructs asynchronous request paths across multiple layers. It introduces a vertical trace model and a context-reconstruction approach grounded in a finite-state machine formalism, enabled by VM instrumentation, LTTng traces, and Trace Compass for analysis. The key contributions include the Nested Bounded Context Algorithm, the vertical span concept, and a State History Tree-based analysis pipeline that operates without modifying application code. Practically, the framework achieves traceability with minimal overhead, yielding insights suitable for root-cause analysis in distributed Node.js applications.

Abstract

Adequate consideration is crucial to ensure that services in a distributed application context are running satisfactorily with the resources available. Due to the asynchronous nature of tasks and the need to work with multiple layers that deliver coordinated results in a single-threaded context, analysing performance is a challenging task in event-loop-based systems. The existing performance analysis methods for environments such as Node.js rely on higher-level instrumentation but lack precision, as they cannot capture the relevant underlying application flow. As a solution, we propose a streamlined method for recovering the asynchronous execution path of requests called the Nested Bounded Context Algorithm. The proposed technique tracks the application execution flow through multiple layers and showcases it on an interactive interface for further assessment. Furthermore, we introduce the vertical span concept. This representation of a span as a multidimensional object (horizontal and vertical) with a start and end of execution, along with its sub-layers and triggered operations, enables the granular identification and diagnosis of performance issues. We proposed a new technique called the Bounded Context Tracking Algorithm for event matching and request reassembling in a multi-layer trace . The two techniques allow aligning the executions of the request in a tree-based data structure for developed visualisations. These visualisations permit performance debugging of complex performance issues in Node.js.

Node Compass: Multilevel Tracing and Debugging of Request Executions in JavaScript-Based Web-Servers

TL;DR

The paper tackles the difficulty of debugging performance in Node.js microservices by introducing a transparent, low-overhead tracing framework that reconstructs asynchronous request paths across multiple layers. It introduces a vertical trace model and a context-reconstruction approach grounded in a finite-state machine formalism, enabled by VM instrumentation, LTTng traces, and Trace Compass for analysis. The key contributions include the Nested Bounded Context Algorithm, the vertical span concept, and a State History Tree-based analysis pipeline that operates without modifying application code. Practically, the framework achieves traceability with minimal overhead, yielding insights suitable for root-cause analysis in distributed Node.js applications.

Abstract

Adequate consideration is crucial to ensure that services in a distributed application context are running satisfactorily with the resources available. Due to the asynchronous nature of tasks and the need to work with multiple layers that deliver coordinated results in a single-threaded context, analysing performance is a challenging task in event-loop-based systems. The existing performance analysis methods for environments such as Node.js rely on higher-level instrumentation but lack precision, as they cannot capture the relevant underlying application flow. As a solution, we propose a streamlined method for recovering the asynchronous execution path of requests called the Nested Bounded Context Algorithm. The proposed technique tracks the application execution flow through multiple layers and showcases it on an interactive interface for further assessment. Furthermore, we introduce the vertical span concept. This representation of a span as a multidimensional object (horizontal and vertical) with a start and end of execution, along with its sub-layers and triggered operations, enables the granular identification and diagnosis of performance issues. We proposed a new technique called the Bounded Context Tracking Algorithm for event matching and request reassembling in a multi-layer trace . The two techniques allow aligning the executions of the request in a tree-based data structure for developed visualisations. These visualisations permit performance debugging of complex performance issues in Node.js.
Paper Structure (12 sections, 7 equations, 6 figures, 1 table)

This paper contains 12 sections, 7 equations, 6 figures, 1 table.

Figures (6)

  • Figure 1: System operating architecture. Microservices are running in containers.
  • Figure 2: Example of a user trace experiment. Several trace files are aggregated and opened as experiment in TC
  • Figure 3: Finite State Machine modelling socket communication patterns.
  • Figure 4: Vertical Span Model (VSM) representation. The label “A” depicts a span as it appears in distributed tracers. The label “B” depicts a vertical span representing the flow of the request sequences in all layers.
  • Figure 5: Vertical Span Model (VSM) representation. The label “A” depicts a span as it appears in distributed tracers. The label “B” depicts a vertical span representing the flow of the request sequences in all layers.
  • ...and 1 more figures