fix: 添加Incus在单核的宿主机上长期使用后CPU占用过高的修复方法

This commit is contained in:
spiritlhl
2025-08-26 12:59:19 +00:00
parent 326d95b646
commit dfa84c12d2
2 changed files with 76 additions and 0 deletions

View File

@@ -36,6 +36,40 @@ You need to install a scheduled task to detect and fix this issue
curl -L https://raw.githubusercontent.com/oneclickvirt/incus/main/extra_scripts/docker-coexistence.sh -o docker-coexistence.sh && chmod +x docker-coexistence.sh && bash docker-coexistence.sh
```
## Incus has high CPU usage on single-core hosts after long-term use
This high CPU usage is native to Incus, there is no workaround for it, and it can only be reproduced on single-core hosts, so you don't need to bother with multi-core hosts.
You need to install a timed task to detect and fix the problem, and check the usage every 5 minutes to see if you need to restart the Incus back-end.
* Download
```shell
curl -L https://raw.githubusercontent.com/oneclickvirt/incus/main/extra_scripts/incus_fixed_restart.sh -o incus_fixed_restart. sh && chmod +x incus_fixed_restart.sh && bash incus_fixed_restart.sh
```
* Installation
``` bash
bash incus_fixed_restart.sh install
```
will be copied to ```/usr/local/bin/incus_fixed_restart.sh``` and written to ```cron``` to run every minute.
* Uninstall
``` bash
bash incus_fixed_restart.sh uninstall
```
Removes ```cron``` tasks, script files, log files, and count files.
* Runs normally (called by cron)
``` bash
/usr/local/bin/incus_fixed_restart.sh
```
## Currently verified VPS vendors that can open containers with separate IPV6 addresses.
[kuroit](https://my.kuroit.com/aff.php?aff=5) Phoenix, USA regular

View File

@@ -44,6 +44,48 @@ curl -L https://raw.githubusercontent.com/oneclickvirt/incus/main/extra_scripts/
curl -L https://cdn.spiritlhl.net/https://raw.githubusercontent.com/oneclickvirt/incus/main/extra_scripts/docker-coexistence.sh -o docker-coexistence.sh && chmod +x docker-coexistence.sh && bash docker-coexistence.sh
```
## Incus在单核的宿主机上长期使用后CPU占用过高
这个CPU占用过高系Incus原生问题暂时没有解决方式且仅在单核宿主机上可复现多核宿主机不必理会
需要安装一个定时任务定时检测和修复这个问题每5分钟检测一遍占用看看是否需要重启Incus后端
* 下载
国际
```shell
curl -L https://raw.githubusercontent.com/oneclickvirt/incus/main/extra_scripts/incus_fixed_restart.sh -o incus_fixed_restart.sh && chmod +x incus_fixed_restart.sh && bash incus_fixed_restart.sh
```
国内
```shell
curl -L https://cdn.spiritlhl.net/https://raw.githubusercontent.com/oneclickvirt/incus/main/extra_scripts/incus_fixed_restart.sh -o incus_fixed_restart.sh && chmod +x incus_fixed_restart.sh && bash incus_fixed_restart.sh
```
* 安装
```bash
bash incus_fixed_restart.sh install
```
会复制到 ```/usr/local/bin/incus_fixed_restart.sh``` 并写入 ```cron``` 每分钟执行。
* 卸载
```bash
bash incus_fixed_restart.sh uninstall
```
会删除 ```cron``` 任务、脚本文件、日志文件和计数文件。
* 正常运行(由 cron 调用)
```bash
/usr/local/bin/incus_fixed_restart.sh
```
## 目前已验证可开带独立IPV6地址容器的VPS商家
[kuroit](https://my.kuroit.com/aff.php?aff=5) 中的 美国凤凰城 regular