Auto-sync: 2026-04-22 04:02

This commit is contained in:
2026-04-22 04:03:04 +08:00
parent 24218550d2
commit de096f2f88
232 changed files with 16604 additions and 514 deletions

View File

@@ -0,0 +1,29 @@
# 容器资源限制
## Description
通过 Docker 的 `deploy.resources.limits` 字段对容器可使用的资源内存、CPU进行上限约束防止单一容器耗尽宿主机资源影响其他服务稳定性。
## 常用配置
```yaml
deploy:
resources:
limits:
memory: 128M # 最大内存限制
cpus: '0.5' # 最大 CPU 配额50%
```
## 典型应用场景
- it-tools Web UI128MB 内存足够运行
- Jellyfin 媒体转码:建议 2-4GB 内存
- 数据库容器MariaDB建议 512MB-2GB
- Prometheus/Grafana建议 512MB-1GB
## 注意事项
- 内存限制 `128M` 对于简单 Web UI 工具足够
- 超出限制后容器可能被 OOM Killer 终止
- 建议结合健康检查healthcheck确保服务可用性
## Used By
- [[用docker安装it-tools]]
- [[Docker-Compose]]
- [[Navidrome]](转码缓存 200MB 限制)