Sobes.tech
Junior — Senior

Improving Node.js service performance under high load

livecode

Task condition

There is a Node.js application that:

  1. Accepts requests from the client side;
  2. Performs server-side rendering of pages (SSR);
  3. Logs request information to the console; a separate agent on the machine collects these messages and transmits them to the logging system;
  4. When processing requests, it interacts with other backend services, gathers the received data, and returns it to the client. The problem manifests under a high number of requests per second: throttling begins. The cause is the overload of the console.log() function, which works synchronously and can block the execution thread. It is required to suggest ways to optimize the service operation to eliminate the bottleneck associated with logging and ensure stable operation under high load.