mirror of
https://github.com/yeasy/docker_practice.git
synced 2026-03-11 12:21:17 +00:00
style(docs): standardize heading formats and numbering
- Enforce Level 1-3 structural numbering based on SUMMARY.md hierarchy - Remove structural numbering from Level 4+ headings - Eliminate single child headings by converting to bold text - Auto-inject summary text for headings with multiple children missing intro text - Exclude Appendix chapters from structural numbering - Avoid modifying code block contents - Add script to detect non-standard English usage in headers
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
## 14.3 控制组
|
||||
## 11.3 控制组
|
||||
|
||||
控制组 (Cgroups) 是 Linux 内核提供的另一种关键机制,主要用于资源的限制和审计。
|
||||
|
||||
### 什么是控制组
|
||||
### 11.3.1 什么是控制组
|
||||
|
||||
控制组 (Control Groups,简称 cgroups) 是 Linux 内核的一个特性,用于 **限制、记录和隔离** 进程组的资源使用 (CPU、内存、磁盘 I/O、网络等)。
|
||||
|
||||
@@ -31,7 +31,7 @@ flowchart LR
|
||||
|
||||
---
|
||||
|
||||
### cgroups 的历史
|
||||
### 11.3.2 cgroups 的历史
|
||||
|
||||
相关信息如下表:
|
||||
|
||||
@@ -44,7 +44,7 @@ flowchart LR
|
||||
|
||||
---
|
||||
|
||||
### cgroups 可以限制的资源
|
||||
### 11.3.3 cgroups 可以限制的资源
|
||||
|
||||
相关信息如下表:
|
||||
|
||||
@@ -58,7 +58,7 @@ flowchart LR
|
||||
|
||||
---
|
||||
|
||||
### Docker 中的资源限制
|
||||
### 11.3.4 Docker 中的资源限制
|
||||
|
||||
Docker 提供了丰富的参数来配置容器的资源限制,主要包括内存、CPU、磁盘 I/O 等。
|
||||
|
||||
@@ -142,7 +142,7 @@ $ docker run --pids-limit=100 myapp
|
||||
|
||||
---
|
||||
|
||||
### 查看容器资源使用
|
||||
### 11.3.5 查看容器资源使用
|
||||
|
||||
运行以下命令:
|
||||
|
||||
@@ -165,7 +165,7 @@ $ docker inspect mycontainer --format '{{json .HostConfig}}' | jq
|
||||
|
||||
---
|
||||
|
||||
### 资源限制的效果
|
||||
### 11.3.6 资源限制的效果
|
||||
|
||||
本节涵盖了相关内容与详细描述,主要探讨以下几个方面:
|
||||
|
||||
@@ -209,7 +209,7 @@ $ docker run --rm --cpus=1 stress --cpu 4
|
||||
|
||||
---
|
||||
|
||||
### cgroups v1 vs v2
|
||||
### 11.3.7 cgroups v1 vs v2
|
||||
|
||||
相关信息如下表:
|
||||
|
||||
@@ -245,7 +245,7 @@ nodev cgroup2
|
||||
|
||||
---
|
||||
|
||||
### 在 Compose 中设置限制
|
||||
### 11.3.8 在 Compose 中设置限制
|
||||
|
||||
在 Compose 中设置限制配置如下:
|
||||
|
||||
@@ -265,7 +265,7 @@ services:
|
||||
|
||||
---
|
||||
|
||||
### 最佳实践
|
||||
### 11.3.9 最佳实践
|
||||
|
||||
在使用 Cgroups 限制资源时,遵循一些最佳实践可以避免潜在的问题。
|
||||
|
||||
|
||||
Reference in New Issue
Block a user