Work Intent: Stop the temperature metrics query from spinning up array disks (#2017)
维护者通常 1 天内回复
@elibosley 已经在做这个了。
开始于 2026年9月23日。
评估
这个 Issue 还没有评估数据。
描述
Overview
Fix #2017. Reading disk temperatures through the metrics { temperature } query wakes every spun-down array disk. On my server (Unraid 7.3, five HDDs in the array) one request took about 50 seconds and spun up all five disks. Anything that polls temperatures, including the systemMetricsTemperature subscription, keeps the array from ever staying spun down.
The cause: DiskSensorsService.read() gets its disk list from DisksService.getDisks(), which calls diskLayout() from systeminformation. On Linux, diskLayout() runs smartctl -a -j and smartctl -H on every disk without -n standby, and that wakes them. The temperature read itself (getTemperature()) already uses smartctl -n standby, so the disk listing is the only part that wakes the disks.
To confirm the cause before asking, I tried a small local prototype and measured both paths on my server with the disks spun down:
Current (diskLayout()) |
Proposed (lsblk) |
|
|---|---|---|
| Time | ~50,700 ms | ~70 ms |
| Disks spun up | 5 of 5 | 0 of 5 |
Technical Approach
- Add
DisksService.getPhysicalDisks(), which lists disks withlsblk -J -d -b -o PATH,TYPE,SIZE,SERIAL,MODEL,TRAN.lsblkonly reads kernel metadata and never touches the disk. - It returns the same
id(serial),device,name(model) andinterfaceTypethat the temperature code uses today, so sensor IDs and names don't change. It keeps whole disks with a non-zero size and skips loop/ram devices, which matched whatdiskLayout()returned on my server. - Switch
DiskSensorsService.read()to use it. Spun-down disks are then skipped by the existingsmartctl -n standbycheck, as they are today, instead of being woken. - Move the interface-type mapping in
parseDisk()into a small shared helper so both paths map it the same way. - Tests: unit tests for
getPhysicalDisks()(parsing, filtering, no SMART calls), and a sensor test thatread()no longer callsgetDisks().
Out of scope: getDisks() (the disks query) has the same wake-up behavior through diskLayout(). I'd keep this change small and raise that separately if you want it fixed too.
Scope
- API
- Plugin
- Web UI
- Build/Deploy Process
- Documentation
Timeline & Impact
- Estimated time needed: a few days, since the prototype and tests already exist.
- Potential impacts: temperature readings only. Spun-down disks won't report a temperature, as with the current
-n standbybehavior. No schema changes.
Pre-submission Checklist
- I have searched for similar work/issues
- I understand this needs approval before starting
- I am willing to make adjustments based on feedback
- 主要语言
- TypeScript
- 星标
- 113
- 派生
- 23
- 平均合并
- 1 天 21 小时
- 30 天内合并 PR
- 12
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
unraid/api 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 70/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 88/100
维护者通常 1 天内回复
-
难度 4/5 3-5 天 新手友好度 64/100
维护者通常 1 天内回复
-
Work Intent: File Manager integration for #1599可能已有人在做 @elibosley 于 6 天前认领。 未关闭
维护者通常 1 天内回复
-
难度 3/5 1-2 天 新手友好度 58/100
维护者通常 1 天内回复
相似的 Issue
-
[Bug]: Server git tests sign fixture commits with the developer's key when run from the repo root未关闭
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 62/100
melgarafael/DeskcommCRM#2657 ·
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 85/100
MystenLabs/MemWal#1163 · 2 条评论 ·
维护者通常 1 天内回复
-
Mondriaan
难度 1/5 1 小时以内 新手友好度 88/100
knaw-huc/textannoviz#709 ·
维护者通常 1 天内回复
-
billion-context-pi
难度 2/5 1-3 小时 新手友好度 62/100
ranxianglei/billion-context#2521 · 3 条评论 ·
维护者通常 1 天内回复