File tree Expand file tree Collapse file tree 3 files changed +100
-4
lines changed Expand file tree Collapse file tree 3 files changed +100
-4
lines changed Original file line number Diff line number Diff line change
1
+ # README
2
+ Demonstrate how to work with cgroups
3
+
4
+ ## cgroups
5
+ ``` sh
6
+ # man pages
7
+ man cgroups
8
+
9
+ # list filesystems and look at cgroups
10
+ cat /proc/filesystems
11
+
12
+ # see where they a virtually mounted
13
+ mount
14
+ ```
15
+
16
+ ## Install tooling
17
+ ``` sh
18
+ # install tooling
19
+ sudo apt install cgroup-tools
20
+
21
+ # list cgroup tools
22
+ dpkg -L cgroup-tools | grep bin
23
+
24
+ ```
25
+
26
+ ## Walk the filesystem
27
+ ``` sh
28
+ # cgroups v1
29
+ ls /sys/fs/cgroup/
30
+
31
+ # cgroups v2
32
+ ls /sys/fs/cgroup/unified
33
+ ```
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
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
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
+
28
+ ## Check limits
29
+ ``` sh
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
41
+ ```
42
+
15
43
## Disk
16
44
17
45
``` sh
22
50
## Sockets
23
51
24
52
``` sh
53
+ # summary of all the sockets
54
+ ss -s
55
+
25
56
# listening sockets
26
57
ss -l
58
+
59
+ # listening sockets with processes
60
+ sudo ss -lp
61
+
62
+ # tcp connections with information
63
+ ss -ti
27
64
```
65
+
66
+
28
67
## Memory
29
68
30
69
``` sh
Original file line number Diff line number Diff line change @@ -159,17 +159,21 @@ Steps [README.md](./32_jq/README.md)
159
159
Demonstrates using awscli to query resources in an AWS account.
160
160
Steps [ README.md] ( ./33_awscli/README.md )
161
161
162
+ ## Example 34 - Checking Resources
163
+ Demonstrate how to use various commands to verify resource usage in the OS.
164
+ Steps [ README.md] ( ./34_checking_resources/README.md )
165
+
162
166
## Example 35 - APT and DPKG
163
167
Demonstrate examples of working with APT and DPKG
164
168
Steps [ README.md] ( ./35_apt_and_dpkg/README.md )
165
169
166
170
## Example 36 - Git Querying
167
- Demonstrates some examples of using git queries
168
- Steps [ README.md] ( ./36_git_querying/README.md )
171
+ Demonstrates some examples of using git queries
172
+ Steps [ README.md] ( ./36_git_querying/README.md )
169
173
170
174
## Example 37 - Checking Resources
171
- Demonstrate how to use various commands to verify resource usage in the OS.
172
- Steps [ README.md] ( ./37_checking_resources/README.md )
175
+ Demonstrate how to use various commands to verify resource usage in the OS.
176
+ Steps [ README.md] ( ./37_checking_resources/README.md )
173
177
174
178
## TODO:
175
179
* Globbing
You can’t perform that action at this time.
0 commit comments