fix

Node CPU 使用率高

Node.js 中的高 CPU 通常来自阻塞事件循环、死循环/紧密循环、JSON 热路径、正则表达式回溯,或单个进程承担过多工作。

Common symptoms

Likely causes

Evidence to look for

单个 Node 进程的 PID CPU 持续超过 40%
CPU 随流量突发而升高
perf 采集显示 JS/native 热点帧

What it usually means

Node 擅长处理 IO,但在主线程上执行 CPU 密集型工作会迅速导致延迟上升和资源饱和。

What to do next

  1. 1将重活转移到 worker 线程或队列
  2. 2减少请求路径中的阻塞性工作
  3. 3在横向扩展前先对热点函数进行性能分析

See what's causing your CPU

cpum.ai turns CPU, process, disk, and memory signals into plain-English explanations with evidence.

Open cpum.ai

Related

Node CPU 使用率高:原因与解决方法 | cpum.ai