Urgent.News

What's breaking now, across hundreds of outlets.

Tech

I deleted a monitoring dependency that wedged my own event loop

I run a local command console that probes twelve app URLs every sixty seconds and shows live CPU/RAM/disk gauges. It used to depend on systeminformation — a popular Node package that reads OS telemetry through native bindings and, on Windows, through WMI queries. It never failed loudly. It just quietly took over. Every poll to /api/system would hang for a few hundred milliseconds. After a few…

The author of this console monitors twelve app URLs every 60 seconds, displaying live CPU, RAM, and disk gauges. For this purpose, the console relied on a popular Node package named systeminformation. This package read OS telemetry using native bindings with WMI queries on Windows. However, running systeminformation silently took over the event loop.

Every time the console polled /api/system, it would hang for a few hundred milliseconds. Over time, the entire console stopped responding, not just the telemetry route. Health probes, project catalogs, and even the root GET endpoint were affected. Restarting the process fixed the issue temporarily, but the hung poll kept piling up.

After a weekend spent chasing a Vercel edge issue, the author discovered that the real bottleneck was running on their own laptop. Utilizing systeminformation proved useful as it provided CPU, memory, disk, battery, processes, and more through a simple API. However, running it on a timer with setInterval led to calling WMI queries every two seconds.

While WMI calls did not block directly, the callbacks parsing and assigning results ran on the event loop, causing issues. When a query hung, subsequent queries stacked up, and the event loop became wedged. This behavior mimicked the app being slow instead of dead. Health probes timed out, the frontend spinner spun indefinitely, and additional logging only blamed the network.

Restarting the app worked temporarily until the issue resurfaced. To resolve this, the author replaced systeminformation with Node's built-in os module and fs.statfsSync. These modules had no native bindings, no WMI, and no possibility of hanging the event loop. The sampleSystem function used os.totalmem(), os.freemem(), and fs.statfsSync to gather system statistics. This replacement eliminated the event loop bottleneck, ensuring the console remained responsive.

Rewritten by urgent.news; may contain errors — check the original.

Source: dev.to

Read the original at dev.to →

Report a problem with this story

More in Tech

Qui té dret a gaudir de la plaça? Creant La Plaça a la HackEPS

English This is a submission for the MLH x DEV Writing Challenge What I Built It’s summer in Lleida, and the bars on a residential street want to keep their outdoor tables open later.

  • "La Plaça" game created for HackEPS 2026 in Lleida
  • Players make decisions for five fictional neighbors in shared space scenarios
  • Game engine shows long-term consequences of seemingly small choices

Storyboard first, then render: how lovideo turns a PDF into a narrated video

I'm one of the makers of lovideo , a web app that turns an idea, a script or a document into a narrated explainer video. This post is about three workflow decisions we made, and what they look like in…

  • Storyboard serves as approval gate, preventing premature video generation
  • Narration and timing adjusted after storyboard approval, final video 1:18
  • Fine editing delegated to external platform, not integrated within lovideo

Modular Monolith vs Microservices: Khi nào đội ngũ 10 người không nên tách 20 service

Có một công thức gần như trở thành "nghi thức trưởng thành" ở không ít đội ngũ kỹ thuật: hệ thống mới có vài nghìn người dùng, team backend có đúng 10 kỹ sư, nhưng trên sơ đồ kiến trúc đã chễm chệ 20…

  • 10-person engineering team struggles with 20 microservices in a second-generation monolith
  • Modular Monolith offers advantages and avoids "Spaghetti Monolith"

More from Sunday, 29 November 2026 →