File tree 2 files changed +66
-19
lines changed
2 files changed +66
-19
lines changed Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ Demonstrate how to use various commands to verify resource usage in the OS.
3
3
4
4
5
5
TODO:
6
+ * cgroups
6
7
* Open sockets
7
8
* Free memory
8
9
* File handles
@@ -12,10 +13,33 @@ TODO:
12
13
* debugfs
13
14
https://github.com/raboof/nethogs
14
15
16
+
17
+ ``` sh
18
+ # booted with
19
+ cat /proc/cmdline
20
+
21
+ # built with
22
+ cat /boot/config-5.8.0-49-generic | grep CGROUP
23
+
24
+ # global limits
25
+ systemctl show
26
+ ```
27
+
15
28
## Check limits
16
29
``` sh
17
- ulimit -a
30
+ # limits inside a container
31
+ docker run -it ubuntu:20.04 /bin/bash -c " ulimit -a"
32
+
33
+ # limits on host
34
+ ulimit -a
35
+
36
+ # limits for current pid
37
+ cat /proc/$$ /limits
38
+
39
+ # show global config
40
+ systemctl show
18
41
```
42
+
19
43
## Disk
20
44
21
45
``` sh
Original file line number Diff line number Diff line change 1
- https://www.linuxjournal.com/content/everything-you-need-know-about-linux-containers-part-i-linux-control-groups-and-process
2
-
3
- https://www.linuxjournal.com/content/everything-you-need-know-about-linux-containers-part-ii-working-linux-containers-lxc
1
+ # README
2
+ Demonstrate how to work with cgroups
4
3
4
+ ## cgroups
5
+ ``` sh
6
+ # man pages
7
+ man cgroups
5
8
6
- SSH in a cgroup
7
- https://unix.stackexchange.com/questions/209199/how-to-ensure-ssh-via-cgroups-on-centos
8
-
9
- https://unix.stackexchange.com/questions/56538/controlling-priority-of-applications-using-cgroups
10
-
11
- cgroupsv2
12
- https://unix.stackexchange.com/questions/471476/how-do-i-check-cgroup-v2-is-installed-on-my-machine
9
+ # list filesystems and look at cgroups
10
+ cat /proc/filesystems
13
11
14
- ## Limits
15
- docker run -it ubuntu:20.04 /bin/bash -c "ulimit -a"
12
+ # see where they a virtually mounted
13
+ mount
14
+ ```
16
15
17
- ulimit -a
16
+ ## Install tooling
17
+ ``` sh
18
+ # install tooling
19
+ sudo apt install cgroup-tools
18
20
19
- cat /proc/$$/limits
21
+ # list cgroup tools
22
+ dpkg -L cgroup-tools | grep bin
20
23
21
- ## Cgroups
22
- ``` sh
23
- cat /proc/filesystems
24
- mount
25
24
```
26
25
26
+ ## Walk the filesystem
27
27
``` sh
28
+ # cgroups v1
28
29
ls /sys/fs/cgroup/
30
+
31
+ # cgroups v2
32
+ ls /sys/fs/cgroup/unified
29
33
```
30
34
35
+
36
+ ## Resources
37
+ https://medium.com/nttlabs/cgroup-v2-596d035be4d7
38
+
39
+
40
+ https://opensource.com/article/20/10/cgroups
41
+
42
+ https://www.linuxjournal.com/content/everything-you-need-know-about-linux-containers-part-i-linux-control-groups-and-process
43
+
44
+ https://www.linuxjournal.com/content/everything-you-need-know-about-linux-containers-part-ii-working-linux-containers-lxc
45
+
46
+
47
+ SSH in a cgroup
48
+ https://unix.stackexchange.com/questions/209199/how-to-ensure-ssh-via-cgroups-on-centos
49
+
50
+ https://unix.stackexchange.com/questions/56538/controlling-priority-of-applications-using-cgroups
51
+
52
+ cgroupsv2
53
+ https://unix.stackexchange.com/questions/471476/how-do-i-check-cgroup-v2-is-installed-on-my-machine
You can’t perform that action at this time.
0 commit comments