Periodic CPU spikes caused by default `healthcheck.js` in Node-RED Docker image

未关闭
#513 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
3/5
预计耗时
1-2 天
新手友好度
52/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
冷清
技术栈
docker, javascript, node.js

调研方向

首先定位默认的 healthcheck.js,以及每 30 秒运行一次它的 Docker 镜像配置。将当前的 node /healthcheck.js 检查与 issue 中描述的轻量级替代方案进行比较,并验证所选的 healthcheck 仍能确认服务可用性,同时避免报告的周期性 CPU 峰值。

由索引模型根据 Issue 内容生成。

描述

Periodic CPU spikes caused by default healthcheck in Node-RED Docker image

I recently tried to deliver a Node-RED Docker container to a colleague who is not very familiar with Node-RED and is quite cautious about trusting it in production.

During testing, he noticed a periodic CPU spike every 30 seconds, where CPU usage briefly jumps from ~0.5% to ~6% within less than a second.

After investigation, I found the cause is the default healthcheck.js. The Docker healthcheck executes every 30 seconds and runs node /healthcheck.js, which starts a full Node.js process and performs an HTTP request to check service availability.

While this design is functionally correct, it introduces unnecessary CPU overhead in lightweight or single-node deployments.

I would like to suggest considering a more lightweight healthcheck approach, such as a TCP port check or a lightweight HTTP probe, instead of starting a full Node.js process (node /healthcheck.js) on every check.

Image
主要语言
Shell
星标
540
派生
434
平均合并
24 分钟
30 天内合并 PR
5

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

node-red/node-red-docker 的其他 Issue

查看 node-red/node-red-docker 的全部 Issue

相似的 Issue

更多 Shell/Bash Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。