Différences
Ci-dessous, les différences entre deux révisions de la page.
Prochaine révision | Révision précédente | ||
elearning:workbooks:debian:10:avance:l101 [2022/05/02 08:14] – created admin | elearning:workbooks:debian:10:avance:l101 [2022/05/04 09:35] (Version actuelle) – admin | ||
---|---|---|---|
Ligne 54: | Ligne 54: | ||
* 4.1 - ulimit | * 4.1 - ulimit | ||
* 4.2 - Groupes de Contrôle | * 4.2 - Groupes de Contrôle | ||
- | * La Limitation de la Mémoire | + | * CGroups v1 |
- | * La Commande cgcreate | + | * Préparation |
- | * La Commande cgdelete | + | * Présentation |
- | * Le Fichier / | + | * Limitation de la Mémoire |
- | * La Commande cgconfigparser | + | * La Commande cgcreate |
+ | * La Commande cgdelete | ||
+ | * Le Fichier / | ||
+ | * La Commande cgconfigparser | ||
=====Présentation des Fichiers Spéciaux===== | =====Présentation des Fichiers Spéciaux===== | ||
Ligne 2390: | Ligne 2393: | ||
====4.2 - Groupes de Contrôle==== | ====4.2 - Groupes de Contrôle==== | ||
+ | |||
+ | ===CGroups v1=== | ||
+ | |||
+ | ==Préparation== | ||
+ | |||
+ | Debian 11 utilise CGroups v2 par défault. Pour revenir à l' | ||
+ | |||
+ | < | ||
+ | root@debian11: | ||
+ | root@debian11: | ||
+ | # If you change this file, run ' | ||
+ | # / | ||
+ | # For full documentation of the options in this file, see: | ||
+ | # info -f grub -n ' | ||
+ | |||
+ | GRUB_DEFAULT=0 | ||
+ | GRUB_TIMEOUT=5 | ||
+ | GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian` | ||
+ | GRUB_CMDLINE_LINUX_DEFAULT=" | ||
+ | GRUB_CMDLINE_LINUX="" | ||
+ | |||
+ | # Uncomment to enable BadRAM filtering, modify to suit your needs | ||
+ | # This works with Linux (no patch required) and with any kernel that obtains | ||
+ | # the memory map information from GRUB (GNU Mach, kernel of FreeBSD ...) | ||
+ | # | ||
+ | |||
+ | # Uncomment to disable graphical terminal (grub-pc only) | ||
+ | # | ||
+ | |||
+ | # The resolution used on graphical terminal | ||
+ | # note that you can use only modes which your graphic card supports via VBE | ||
+ | # you can see them in real GRUB with the command `vbeinfo' | ||
+ | # | ||
+ | |||
+ | # Uncomment if you don't want GRUB to pass " | ||
+ | # | ||
+ | |||
+ | # Uncomment to disable generation of recovery mode menu entries | ||
+ | # | ||
+ | |||
+ | # Uncomment to get a beep at grub start | ||
+ | # | ||
+ | |||
+ | root@debian11: | ||
+ | Generating grub configuration file ... | ||
+ | Found background image: / | ||
+ | Found linux image: / | ||
+ | Found initrd image: / | ||
+ | done | ||
+ | </ | ||
+ | |||
+ | Redémarrez ensuite votre VM : | ||
+ | |||
+ | < | ||
+ | root@debian11: | ||
+ | </ | ||
+ | |||
+ | ==Présentation== | ||
Les **Groupes de Contrôles** (//Control Groups//) aussi appelés **CGroups**, | Les **Groupes de Contrôles** (//Control Groups//) aussi appelés **CGroups**, | ||
Ligne 2395: | Ligne 2456: | ||
Les groupes de contrôle sont organisés de manière hiérarchique, | Les groupes de contrôle sont organisés de manière hiérarchique, | ||
- | Ces hiérarchies multiples et séparés sont necéssaires parce que chaque hiérarchie est attaché à un ou plusieurs **sous-système(s)** aussi appelés des **Contrôleurs de Ressources** ou simplement des **Contrôleurs**. Les contrôleurs disponibles sous RHEl/CentOS 7 sont : | + | Ces hiérarchies multiples et séparés sont necéssaires parce que chaque hiérarchie est attaché à un ou plusieurs **sous-système(s)** aussi appelés des **Contrôleurs de Ressources** ou simplement des **Contrôleurs**. Les contrôleurs disponibles sous Debian 11 sont : |
* **blkio** - utilisé pour établir des limites sur l' | * **blkio** - utilisé pour établir des limites sur l' | ||
Ligne 2408: | Ligne 2469: | ||
* **hugetlb** - utilisé pour limiter des ressources sur des pages de mémoire virtuelle de grande taille. | * **hugetlb** - utilisé pour limiter des ressources sur des pages de mémoire virtuelle de grande taille. | ||
- | Pour visualiser les hiérarchies, | + | Commencez par installer le paquet |
< | < | ||
- | root@debian11: | ||
- | -bash: lssubsys: command not found | ||
- | |||
root@debian11: | root@debian11: | ||
+ | </ | ||
+ | Pour visualiser les hiérarchies, | ||
+ | |||
+ | < | ||
root@debian11: | root@debian11: | ||
- | cpuset | + | cpuset / |
- | cpu | + | cpu,cpuacct / |
- | cpuacct | + | blkio / |
- | blkio | + | memory / |
- | memory | + | devices / |
- | devices | + | freezer / |
- | freezer | + | net_cls,net_prio / |
- | net_cls | + | perf_event |
- | perf_event | + | hugetlb / |
- | net_prio | + | pids / |
- | hugetlb | + | rdma / |
- | pids | + | |
- | rdma | + | |
</ | </ | ||
Ligne 2451: | Ligne 2511: | ||
UNIT | UNIT | ||
-.slice | -.slice | ||
- | system-apache2.slice | ||
system-getty.slice | system-getty.slice | ||
system-lvm2\x2dpvscan.slice | system-lvm2\x2dpvscan.slice | ||
system-modprobe.slice | system-modprobe.slice | ||
- | system-ssh.slice | ||
system-systemd\x2dcryptsetup.slice loaded active active Cryptsetup Units Slice | system-systemd\x2dcryptsetup.slice loaded active active Cryptsetup Units Slice | ||
- | system-systemd\x2dfsck.slice | ||
system.slice | system.slice | ||
user-1000.slice | user-1000.slice | ||
Ligne 2465: | Ligne 2522: | ||
ACTIVE = The high-level unit activation state, i.e. generalization of SUB. | ACTIVE = The high-level unit activation state, i.e. generalization of SUB. | ||
SUB = The low-level unit activation state, values depend on unit type. | SUB = The low-level unit activation state, values depend on unit type. | ||
- | 11 loaded units listed. Pass --all to see loaded but inactive units, too. | + | 8 loaded units listed. Pass --all to see loaded but inactive units, too. |
To show all installed unit files use ' | To show all installed unit files use ' | ||
</ | </ | ||
Ligne 2480: | Ligne 2537: | ||
│ │ ├─app.slice | │ │ ├─app.slice | ||
│ │ │ ├─pulseaudio.service | │ │ │ ├─pulseaudio.service | ||
- | │ │ │ │ └─46798 / | + | │ │ │ │ └─974 / |
│ │ │ ├─pipewire.service | │ │ │ ├─pipewire.service | ||
- | │ │ │ │ ├─46797 / | + | │ │ │ │ ├─973 / |
- | │ │ │ │ └─46808 / | + | │ │ │ │ └─984 / |
│ │ │ └─dbus.service | │ │ │ └─dbus.service | ||
- | │ │ │ | + | │ │ │ |
│ │ └─init.scope | │ │ └─init.scope | ||
- | │ | + | │ |
- | │ | + | │ |
- | │ └─session-180.scope | + | │ ├─session-3.scope |
- | │ | + | │ │ ├─ |
- | │ | + | │ │ ├─ |
- | │ | + | │ │ ├─1000 -bash |
- | │ | + | │ │ ├─1003 su - |
- | │ | + | │ │ ├─1004 -bash |
- | │ | + | │ │ ├─1010 systemd-cgls |
- | │ | + | │ │ └─1011 less |
+ | │ | ||
+ | │ | ||
+ | │ | ||
+ | │ | ||
+ | │ | ||
├─init.scope | ├─init.scope | ||
│ └─1 /sbin/init | │ └─1 /sbin/init | ||
└─system.slice | └─system.slice | ||
├─apache2.service | ├─apache2.service | ||
- | │ ├─57689 / | + | │ ├─595 / |
- | │ ├─57690 / | + | │ ├─597 / |
- | │ └─57691 / | + | │ └─598 / |
- | ├─packagekit.service | + | |
- | │ └─56363 / | + | |
├─systemd-udevd.service | ├─systemd-udevd.service | ||
- | │ └─244 / | + | │ └─317 / |
├─cron.service | ├─cron.service | ||
- | │ └─55347 / | + | │ └─491 / |
- | ├─apache-htcacheclean.service | + | |
- | │ └─56135 / | + | |
├─polkit.service | ├─polkit.service | ||
- | │ └─55364 / | + | │ └─495 / |
+ | ├─rtkit-daemon.service | ||
+ | │ └─979 / | ||
├─auditd.service | ├─auditd.service | ||
- | │ └─55353 / | + | │ └─460 / |
├─wpa_supplicant.service | ├─wpa_supplicant.service | ||
- | │ └─55368 / | + | │ └─498 / |
├─ModemManager.service | ├─ModemManager.service | ||
- | │ └─55569 / | + | │ └─515 / |
+ | ├─inetd.service | ||
+ | │ └─694 / | ||
├─systemd-journald.service | ├─systemd-journald.service | ||
- | │ └─214 / | + | │ └─296 / |
+ | ├─mdmonitor.service | ||
+ | │ └─432 /sbin/mdadm --monitor --scan | ||
├─ssh.service | ├─ssh.service | ||
- | lines 1-50 | + | │ └─580 sshd: / |
+ | lines 1-58 | ||
[q] | [q] | ||
</ | </ | ||
Ligne 2536: | Ligne 2601: | ||
* **CPUQuota** - utilisé pour limiter le temps CPU, même quand le système ne fait rien. | * **CPUQuota** - utilisé pour limiter le temps CPU, même quand le système ne fait rien. | ||
- | ===Limitation de la Mémoire=== | + | ==Limitation de la Mémoire== |
Commencez par créer le script **hello-world.sh** qui servira à générer un processus pour travailler avec les CGroups : | Commencez par créer le script **hello-world.sh** qui servira à générer un processus pour travailler avec les CGroups : | ||
Ligne 2554: | Ligne 2619: | ||
< | < | ||
root@debian11: | root@debian11: | ||
- | root@debian11: | + | root@debian11: |
hello world | hello world | ||
^C | ^C | ||
Ligne 2562: | Ligne 2627: | ||
< | < | ||
- | root@debian11: | + | root@debian11: |
- | root@debian11: | + | |
- | total 0 | + | |
- | -r--r--r-- 1 root root 0 Apr 30 17:13 cgroup.controllers | + | |
- | -r--r--r-- 1 root root 0 Apr 30 17:13 cgroup.events | + | |
- | -rw-r--r-- 1 root root 0 Apr 30 17:13 cgroup.freeze | + | |
- | -rw-r--r-- 1 root root 0 Apr 30 17:13 cgroup.max.depth | + | |
- | -rw-r--r-- 1 root root 0 Apr 30 17:13 cgroup.max.descendants | + | |
- | -rw-r--r-- 1 root root 0 Apr 30 17:13 cgroup.procs | + | |
- | -r--r--r-- 1 root root 0 Apr 30 17:13 cgroup.stat | + | |
- | -rw-r--r-- 1 root root 0 Apr 30 17:13 cgroup.subtree_control | + | |
- | -rw-r--r-- 1 root root 0 Apr 30 17:13 cgroup.threads | + | |
- | -rw-r--r-- 1 root root 0 Apr 30 17:13 cgroup.type | + | |
- | -rw-r--r-- 1 root root 0 Apr 30 17:13 cpu.pressure | + | |
- | -r--r--r-- 1 root root 0 Apr 30 17:13 cpu.stat | + | |
- | -rw-r--r-- 1 root root 0 Apr 30 17:13 io.pressure | + | |
- | -r--r--r-- 1 root root 0 Apr 30 17:13 memory.current | + | |
- | -r--r--r-- 1 root root 0 Apr 30 17:13 memory.events | + | |
- | -r--r--r-- 1 root root 0 Apr 30 17:13 memory.events.local | + | |
- | -rw-r--r-- 1 root root 0 Apr 30 17:13 memory.high | + | |
- | -rw-r--r-- 1 root root 0 Apr 30 17:13 memory.low | + | |
- | -rw-r--r-- 1 root root 0 Apr 30 17:13 memory.max | + | |
- | -rw-r--r-- 1 root root 0 Apr 30 17:13 memory.min | + | |
- | -r--r--r-- 1 root root 0 Apr 30 17:13 memory.numa_stat | + | |
- | -rw-r--r-- 1 root root 0 Apr 30 17:13 memory.oom.group | + | |
- | -rw-r--r-- 1 root root 0 Apr 30 17:13 memory.pressure | + | |
- | -r--r--r-- 1 root root 0 Apr 30 17:13 memory.stat | + | |
- | -r--r--r-- 1 root root 0 Apr 30 17:13 memory.swap.current | + | |
- | -r--r--r-- 1 root root 0 Apr 30 17:13 memory.swap.events | + | |
- | -rw-r--r-- 1 root root 0 Apr 30 17:13 memory.swap.high | + | |
- | -rw-r--r-- 1 root root 0 Apr 30 17:13 memory.swap.max | + | |
- | -r--r--r-- 1 root root 0 Apr 30 17:13 pids.current | + | |
- | -r--r--r-- 1 root root 0 Apr 30 17:13 pids.events | + | |
- | -rw-r--r-- 1 root root 0 Apr 30 17:13 pids.max | + | |
</ | </ | ||
- | |||
- | HERE | ||
Par défaut, ce CGroup héritera de l' | Par défaut, ce CGroup héritera de l' | ||
< | < | ||
- | [root@centos8 | + | root@debian11:~# echo 40000000 > / |
- | [root@centos8 | + | root@debian11:~# cat / |
39997440 | 39997440 | ||
</ | </ | ||
Ligne 2615: | Ligne 2645: | ||
< | < | ||
- | [root@centos8 | + | root@debian11:~# ./ |
- | [1] 35148 | + | [1] 1073 |
- | + | root@debian11:~# hello world | |
- | [root@centos8 | + | |
[Entrée] | [Entrée] | ||
- | [root@centos8 | + | root@debian11:~# ps aux | grep hello-world |
- | root 35148 | + | root |
- | root 35151 | + | root |
</ | </ | ||
Ligne 2629: | Ligne 2658: | ||
< | < | ||
- | [root@centos8 | + | root@debian11:~# ps -ww -o cgroup |
CGROUP | CGROUP | ||
- | 12:memory:/ | + | 8:devices:/ |
</ | </ | ||
Ligne 2637: | Ligne 2666: | ||
< | < | ||
- | [root@centos8 | + | root@debian11:~# echo 1073 > / |
</ | </ | ||
- | Notez maintenant l' | + | Notez maintenant l' |
< | < | ||
- | [root@centos8 | + | root@debian11:~# ps -ww -o cgroup |
CGROUP | CGROUP | ||
- | 12: | + | 8: |
</ | </ | ||
Ligne 2651: | Ligne 2680: | ||
< | < | ||
- | [root@centos8 | + | root@debian11:~# cat / |
274432 | 274432 | ||
</ | </ | ||
Ligne 2658: | Ligne 2687: | ||
< | < | ||
- | [root@centos8 | + | root@debian11:~# kill 1073 |
- | [root@centos8 | + | root@debian11:~# ps aux | grep hello-world |
- | root 35307 | + | root |
[1]+ Terminated | [1]+ Terminated | ||
</ | </ | ||
Ligne 2667: | Ligne 2696: | ||
< | < | ||
- | [root@centos8 | + | root@debian11:~# mkdir / |
- | [root@centos8 | + | root@debian11:~# echo 6000 > / |
- | [root@centos8 | + | root@debian11:~# cat / |
4096 | 4096 | ||
</ | </ | ||
Ligne 2676: | Ligne 2705: | ||
< | < | ||
- | [root@centos8 | + | root@debian11:~# ./ |
- | [1] 35389 | + | [1] 1089 |
- | [root@centos8 | + | root@debian11:~# hello world |
[Entrée] | [Entrée] | ||
- | [root@centos8 | + | root@debian11:~# echo 1089 > / |
</ | </ | ||
Ligne 2688: | Ligne 2717: | ||
< | < | ||
- | [root@centos8 | + | root@debian11:~# ps aux | grep hello-world |
- | [Entrée] | + | root 1100 0.0 0.0 |
[1]+ Killed | [1]+ Killed | ||
</ | </ | ||
- | ===La Commande cgcreate=== | + | Notez la trace dans le fichier **/ |
+ | |||
+ | < | ||
+ | root@debian11: | ||
+ | May 4 06:44:43 debian11 kernel: [ 994.012423] workingset_nodereclaim 0 | ||
+ | May 4 06:44:43 debian11 kernel: [ 994.012423] pgfault 0 | ||
+ | May 4 06:44:43 debian11 kernel: [ 994.012423] pgmajfault 0 | ||
+ | May 4 06:44:43 debian11 kernel: [ 994.012423] pgrefill 0 | ||
+ | May 4 06:44:43 debian11 kernel: [ 994.012423] pgscan 0 | ||
+ | May 4 06:44:43 debian11 kernel: [ 994.012423] pgsteal 0 | ||
+ | May 4 06:44:43 debian11 kernel: [ 994.012425] Tasks state (memory values in pages): | ||
+ | May 4 06:44:43 debian11 kernel: [ 994.012426] [ pid ] | ||
+ | May 4 06:44:43 debian11 kernel: [ 994.012428] [ | ||
+ | May 4 06:44:43 debian11 kernel: [ 994.012430] oom-kill: | ||
+ | </ | ||
+ | |||
+ | ==La Commande cgcreate== | ||
Cette commande permet la création d'un CGroup : | Cette commande permet la création d'un CGroup : | ||
< | < | ||
- | [root@centos8 | + | root@debian11:~# cgcreate -g memory: |
- | [root@centos8 | + | |
+ | root@debian11:~# ls -l / | ||
total 0 | total 0 | ||
- | -rw-rw-r--. 1 root root 0 Jul 13 10:39 cgroup.clone_children | + | -rw-r--r-- 1 root root 0 May 4 06:47 cgroup.clone_children |
- | --w--w----. 1 root root 0 Jul 13 10:39 cgroup.event_control | + | --w--w--w- 1 root root 0 May 4 06:47 cgroup.event_control |
- | -rw-rw-r--. 1 root root 0 Jul 13 10:39 cgroup.procs | + | -rw-r--r-- 1 root root 0 May 4 06:47 cgroup.procs |
- | -rw-rw-r--. 1 root root 0 Jul 13 10:39 memory.failcnt | + | -rw-r--r-- 1 root root 0 May 4 06:47 memory.failcnt |
- | --w--w----. 1 root root 0 Jul 13 10:39 memory.force_empty | + | --w------- 1 root root 0 May 4 06:47 memory.force_empty |
- | -rw-rw-r--. 1 root root 0 Jul 13 10:39 memory.kmem.failcnt | + | -rw-r--r-- 1 root root 0 May 4 06:47 memory.kmem.failcnt |
- | -rw-rw-r--. 1 root root 0 Jul 13 10:39 memory.kmem.limit_in_bytes | + | -rw-r--r-- 1 root root 0 May 4 06:47 memory.kmem.limit_in_bytes |
- | -rw-rw-r--. 1 root root 0 Jul 13 10:39 memory.kmem.max_usage_in_bytes | + | -rw-r--r-- 1 root root 0 May 4 06:47 memory.kmem.max_usage_in_bytes |
- | -r--r--r--. 1 root root 0 Jul 13 10:39 memory.kmem.slabinfo | + | -r--r--r-- 1 root root 0 May 4 06:47 memory.kmem.slabinfo |
- | -rw-rw-r--. 1 root root 0 Jul 13 10:39 memory.kmem.tcp.failcnt | + | -rw-r--r-- 1 root root 0 May 4 06:47 memory.kmem.tcp.failcnt |
- | -rw-rw-r--. 1 root root 0 Jul 13 10:39 memory.kmem.tcp.limit_in_bytes | + | -rw-r--r-- 1 root root 0 May 4 06:47 memory.kmem.tcp.limit_in_bytes |
- | -rw-rw-r--. 1 root root 0 Jul 13 10:39 memory.kmem.tcp.max_usage_in_bytes | + | -rw-r--r-- 1 root root 0 May 4 06:47 memory.kmem.tcp.max_usage_in_bytes |
- | -r--r--r--. 1 root root 0 Jul 13 10:39 memory.kmem.tcp.usage_in_bytes | + | -r--r--r-- 1 root root 0 May 4 06:47 memory.kmem.tcp.usage_in_bytes |
- | -r--r--r--. 1 root root 0 Jul 13 10:39 memory.kmem.usage_in_bytes | + | -r--r--r-- 1 root root 0 May 4 06:47 memory.kmem.usage_in_bytes |
- | -rw-rw-r--. 1 root root 0 Jul 13 10:39 memory.limit_in_bytes | + | -rw-r--r-- 1 root root 0 May 4 06:47 memory.limit_in_bytes |
- | -rw-rw-r--. 1 root root 0 Jul 13 10:39 memory.max_usage_in_bytes | + | -rw-r--r-- 1 root root 0 May 4 06:47 memory.max_usage_in_bytes |
- | -rw-rw-r--. 1 root root 0 Jul 13 10:39 memory.memsw.failcnt | + | -rw-r--r-- 1 root root 0 May 4 06:47 memory.memsw.failcnt |
- | -rw-rw-r--. 1 root root 0 Jul 13 10:39 memory.memsw.limit_in_bytes | + | -rw-r--r-- 1 root root 0 May 4 06:47 memory.memsw.limit_in_bytes |
- | -rw-rw-r--. 1 root root 0 Jul 13 10:39 memory.memsw.max_usage_in_bytes | + | -rw-r--r-- 1 root root 0 May 4 06:47 memory.memsw.max_usage_in_bytes |
- | -r--r--r--. 1 root root 0 Jul 13 10:39 memory.memsw.usage_in_bytes | + | -r--r--r-- 1 root root 0 May 4 06:47 memory.memsw.usage_in_bytes |
- | -rw-rw-r--. 1 root root 0 Jul 13 10:39 memory.move_charge_at_immigrate | + | -rw-r--r-- 1 root root 0 May 4 06:47 memory.move_charge_at_immigrate |
- | -r--r--r--. 1 root root 0 Jul 13 10:39 memory.numa_stat | + | -r--r--r-- 1 root root 0 May 4 06:47 memory.numa_stat |
- | -rw-rw-r--. 1 root root 0 Jul 13 10:39 memory.oom_control | + | -rw-r--r-- 1 root root 0 May 4 06:47 memory.oom_control |
- | ----------. 1 root root 0 Jul 13 10:39 memory.pressure_level | + | ---------- 1 root root 0 May 4 06:47 memory.pressure_level |
- | -rw-rw-r--. 1 root root 0 Jul 13 10:39 memory.soft_limit_in_bytes | + | -rw-r--r-- 1 root root 0 May 4 06:47 memory.soft_limit_in_bytes |
- | -r--r--r--. 1 root root 0 Jul 13 10:39 memory.stat | + | -r--r--r-- 1 root root 0 May 4 06:47 memory.stat |
- | -rw-rw-r--. 1 root root 0 Jul 13 10:39 memory.swappiness | + | -rw-r--r-- 1 root root 0 May 4 06:47 memory.swappiness |
- | -r--r--r--. 1 root root 0 Jul 13 10:39 memory.usage_in_bytes | + | -r--r--r-- 1 root root 0 May 4 06:47 memory.usage_in_bytes |
- | -rw-rw-r--. 1 root root 0 Jul 13 10:39 memory.use_hierarchy | + | -rw-r--r-- 1 root root 0 May 4 06:47 memory.use_hierarchy |
- | -rw-rw-r--. 1 root root 0 Jul 13 10:39 notify_on_release | + | -rw-r--r-- 1 root root 0 May 4 06:47 notify_on_release |
- | -rw-rw-r--. 1 root root 0 Jul 13 10:39 tasks | + | -rw-r--r-- 1 root root 0 May 4 06:47 tasks |
</ | </ | ||
Ligne 2737: | Ligne 2783: | ||
< | < | ||
- | [root@centos8 | + | root@debian11:~# echo 40000000 > / |
</ | </ | ||
Ligne 2745: | Ligne 2791: | ||
< | < | ||
- | [root@centos8 | + | root@debian11:~# cgexec -g memory: |
- | [1] 37670 | + | [1] 1106 |
- | [root@centos8 | + | root@debian11:~# hello world |
[Entrée] | [Entrée] | ||
- | [root@centos8 | + | root@debian11:~# cat / |
+ | 1106 | ||
+ | 1107 | ||
+ | root@debian11: | ||
+ | root 1106 0.0 0.0 | ||
+ | root 1107 0.0 0.0 | ||
+ | root 1108 0.0 0.0 0 0 ? I 06:49 0:00 [kworker/ | ||
+ | root 1113 0.0 0.0 | ||
</ | </ | ||
Ligne 2759: | Ligne 2812: | ||
< | < | ||
- | [root@centos8 | + | root@debian11:~# kill 1106 |
- | root 37670 | + | root@debian11: |
- | root 37685 | + | root |
- | + | root | |
- | [root@centos8 ~]# kill 37670 | + | root |
- | + | ||
- | root@centos8 ~]# ps aux | grep *.sh | + | |
- | root 37726 | + | |
[1]+ Terminated | [1]+ Terminated | ||
- | [root@centos8 | + | root@debian11:~# cgdelete memory: |
- | [root@centos8 | + | root@debian11:~# ls -l / |
ls: cannot access '/ | ls: cannot access '/ | ||
</ | </ | ||
Ligne 2780: | Ligne 2830: | ||
< | < | ||
- | [root@centos8 | + | root@debian11:~# vi / |
- | [root@centos8 | + | root@debian11:~# cat / |
- | # | + | |
- | # Copyright IBM Corporation. 2007 | + | |
- | # | + | |
- | # Authors: | + | |
- | # This program is free software; you can redistribute it and/or modify it | + | |
- | # under the terms of version 2.1 of the GNU Lesser General Public License | + | |
- | # as published by the Free Software Foundation. | + | |
- | # | + | |
- | # This program is distributed in the hope that it would be useful, but | + | |
- | # WITHOUT ANY WARRANTY; without even the implied warranty of | + | |
- | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | + | |
- | # | + | |
- | # | + | |
- | # By default, we expect systemd mounts everything on boot, | + | |
- | # so there is not much to do. | + | |
- | # See man cgconfig.conf for further details, how to create groups | + | |
- | # on system boot using this file. | + | |
group helloworld2 { | group helloworld2 { | ||
cpu { | cpu { | ||
Ligne 2816: | Ligne 2849: | ||
< | < | ||
- | [root@centos8 | + | root@debian11:~# cgcreate -g memory: |
- | [root@centos8 | + | |
+ | root@debian11:~# ls -l / | ||
total 0 | total 0 | ||
- | -rw-rw-r--. 1 root root 0 Jul 13 10:46 cgroup.clone_children | + | -rw-r--r-- 1 root root 0 May 4 06:53 cgroup.clone_children |
- | --w--w----. 1 root root 0 Jul 13 10:46 cgroup.event_control | + | --w--w--w- 1 root root 0 May 4 06:53 cgroup.event_control |
- | -rw-rw-r--. 1 root root 0 Jul 13 10:46 cgroup.procs | + | -rw-r--r-- 1 root root 0 May 4 06:53 cgroup.procs |
- | -rw-rw-r--. 1 root root 0 Jul 13 10:46 memory.failcnt | + | -rw-r--r-- 1 root root 0 May 4 06:53 memory.failcnt |
- | --w--w----. 1 root root 0 Jul 13 10:46 memory.force_empty | + | --w------- 1 root root 0 May 4 06:53 memory.force_empty |
- | -rw-rw-r--. 1 root root 0 Jul 13 10:46 memory.kmem.failcnt | + | -rw-r--r-- 1 root root 0 May 4 06:53 memory.kmem.failcnt |
- | -rw-rw-r--. 1 root root 0 Jul 13 10:46 memory.kmem.limit_in_bytes | + | -rw-r--r-- 1 root root 0 May 4 06:53 memory.kmem.limit_in_bytes |
- | -rw-rw-r--. 1 root root 0 Jul 13 10:46 memory.kmem.max_usage_in_bytes | + | -rw-r--r-- 1 root root 0 May 4 06:53 memory.kmem.max_usage_in_bytes |
- | -r--r--r--. 1 root root 0 Jul 13 10:46 memory.kmem.slabinfo | + | -r--r--r-- 1 root root 0 May 4 06:53 memory.kmem.slabinfo |
- | -rw-rw-r--. 1 root root 0 Jul 13 10:46 memory.kmem.tcp.failcnt | + | -rw-r--r-- 1 root root 0 May 4 06:53 memory.kmem.tcp.failcnt |
- | -rw-rw-r--. 1 root root 0 Jul 13 10:46 memory.kmem.tcp.limit_in_bytes | + | -rw-r--r-- 1 root root 0 May 4 06:53 memory.kmem.tcp.limit_in_bytes |
- | -rw-rw-r--. 1 root root 0 Jul 13 10:46 memory.kmem.tcp.max_usage_in_bytes | + | -rw-r--r-- 1 root root 0 May 4 06:53 memory.kmem.tcp.max_usage_in_bytes |
- | -r--r--r--. 1 root root 0 Jul 13 10:46 memory.kmem.tcp.usage_in_bytes | + | -r--r--r-- 1 root root 0 May 4 06:53 memory.kmem.tcp.usage_in_bytes |
- | -r--r--r--. 1 root root 0 Jul 13 10:46 memory.kmem.usage_in_bytes | + | -r--r--r-- 1 root root 0 May 4 06:53 memory.kmem.usage_in_bytes |
- | -rw-rw-r--. 1 root root 0 Jul 13 10:46 memory.limit_in_bytes | + | -rw-r--r-- 1 root root 0 May 4 06:53 memory.limit_in_bytes |
- | -rw-rw-r--. 1 root root 0 Jul 13 10:46 memory.max_usage_in_bytes | + | -rw-r--r-- 1 root root 0 May 4 06:53 memory.max_usage_in_bytes |
- | -rw-rw-r--. 1 root root 0 Jul 13 10:46 memory.memsw.failcnt | + | -rw-r--r-- 1 root root 0 May 4 06:53 memory.memsw.failcnt |
- | -rw-rw-r--. 1 root root 0 Jul 13 10:46 memory.memsw.limit_in_bytes | + | -rw-r--r-- 1 root root 0 May 4 06:53 memory.memsw.limit_in_bytes |
- | -rw-rw-r--. 1 root root 0 Jul 13 10:46 memory.memsw.max_usage_in_bytes | + | -rw-r--r-- 1 root root 0 May 4 06:53 memory.memsw.max_usage_in_bytes |
- | -r--r--r--. 1 root root 0 Jul 13 10:46 memory.memsw.usage_in_bytes | + | -r--r--r-- 1 root root 0 May 4 06:53 memory.memsw.usage_in_bytes |
- | -rw-rw-r--. 1 root root 0 Jul 13 10:46 memory.move_charge_at_immigrate | + | -rw-r--r-- 1 root root 0 May 4 06:53 memory.move_charge_at_immigrate |
- | -r--r--r--. 1 root root 0 Jul 13 10:46 memory.numa_stat | + | -r--r--r-- 1 root root 0 May 4 06:53 memory.numa_stat |
- | -rw-rw-r--. 1 root root 0 Jul 13 10:46 memory.oom_control | + | -rw-r--r-- 1 root root 0 May 4 06:53 memory.oom_control |
- | ----------. 1 root root 0 Jul 13 10:46 memory.pressure_level | + | ---------- 1 root root 0 May 4 06:53 memory.pressure_level |
- | -rw-rw-r--. 1 root root 0 Jul 13 10:46 memory.soft_limit_in_bytes | + | -rw-r--r-- 1 root root 0 May 4 06:53 memory.soft_limit_in_bytes |
- | -r--r--r--. 1 root root 0 Jul 13 10:46 memory.stat | + | -r--r--r-- 1 root root 0 May 4 06:53 memory.stat |
- | -rw-rw-r--. 1 root root 0 Jul 13 10:46 memory.swappiness | + | -rw-r--r-- 1 root root 0 May 4 06:53 memory.swappiness |
- | -r--r--r--. 1 root root 0 Jul 13 10:46 memory.usage_in_bytes | + | -r--r--r-- 1 root root 0 May 4 06:53 memory.usage_in_bytes |
- | -rw-rw-r--. 1 root root 0 Jul 13 10:46 memory.use_hierarchy | + | -rw-r--r-- 1 root root 0 May 4 06:53 memory.use_hierarchy |
- | -rw-rw-r--. 1 root root 0 Jul 13 10:46 notify_on_release | + | -rw-r--r-- 1 root root 0 May 4 06:53 notify_on_release |
- | -rw-rw-r--. 1 root root 0 Jul 13 10:46 tasks | + | -rw-r--r-- 1 root root 0 May 4 06:53 tasks |
</ | </ | ||
< | < | ||
- | [root@centos8 | + | root@debian11:~# cgcreate -g cpu: |
- | [root@centos8 | + | |
+ | root@debian11:~# ls -l / | ||
total 0 | total 0 | ||
- | -rw-rw-r--. 1 root root 0 Jul 13 10:47 cgroup.clone_children | + | -rw-r--r-- 1 root root 0 May 4 06:54 cgroup.clone_children |
- | -rw-rw-r--. 1 root root 0 Jul 13 10:47 cgroup.procs | + | -rw-r--r-- 1 root root 0 May 4 06:54 cgroup.procs |
- | -r--r--r--. 1 root root 0 Jul 13 10:47 cpuacct.stat | + | -r--r--r-- 1 root root 0 May 4 06:54 cpuacct.stat |
- | -rw-rw-r--. 1 root root 0 Jul 13 10:47 cpuacct.usage | + | -rw-r--r-- 1 root root 0 May 4 06:54 cpuacct.usage |
- | -r--r--r--. 1 root root 0 Jul 13 10:47 cpuacct.usage_all | + | -r--r--r-- 1 root root 0 May 4 06:54 cpuacct.usage_all |
- | -r--r--r--. 1 root root 0 Jul 13 10:47 cpuacct.usage_percpu | + | -r--r--r-- 1 root root 0 May 4 06:54 cpuacct.usage_percpu |
- | -r--r--r--. 1 root root 0 Jul 13 10:47 cpuacct.usage_percpu_sys | + | -r--r--r-- 1 root root 0 May 4 06:54 cpuacct.usage_percpu_sys |
- | -r--r--r--. 1 root root 0 Jul 13 10:47 cpuacct.usage_percpu_user | + | -r--r--r-- 1 root root 0 May 4 06:54 cpuacct.usage_percpu_user |
- | -r--r--r--. 1 root root 0 Jul 13 10:47 cpuacct.usage_sys | + | -r--r--r-- 1 root root 0 May 4 06:54 cpuacct.usage_sys |
- | -r--r--r--. 1 root root 0 Jul 13 10:47 cpuacct.usage_user | + | -r--r--r-- 1 root root 0 May 4 06:54 cpuacct.usage_user |
- | -rw-rw-r--. 1 root root 0 Jul 13 10:47 cpu.cfs_period_us | + | -rw-r--r-- 1 root root 0 May 4 06:54 cpu.cfs_period_us |
- | -rw-rw-r--. 1 root root 0 Jul 13 10:47 cpu.cfs_quota_us | + | -rw-r--r-- 1 root root 0 May 4 06:54 cpu.cfs_quota_us |
- | -rw-rw-r--. 1 root root 0 Jul 13 10:47 cpu.rt_period_us | + | -rw-r--r-- 1 root root 0 May 4 06:54 cpu.shares |
- | -rw-rw-r--. 1 root root 0 Jul 13 10:47 cpu.rt_runtime_us | + | -r--r--r-- 1 root root 0 May 4 06:54 cpu.stat |
- | -rw-rw-r--. 1 root root 0 Jul 13 10:47 cpu.shares | + | -rw-r--r-- 1 root root 0 May 4 06:54 notify_on_release |
- | -r--r--r--. 1 root root 0 Jul 13 10:47 cpu.stat | + | -rw-r--r-- 1 root root 0 May 4 06:54 tasks |
- | -rw-rw-r--. 1 root root 0 Jul 13 10:47 notify_on_release | + | |
- | -rw-rw-r--. 1 root root 0 Jul 13 10:47 tasks | + | |
</ | </ | ||
Ligne 2881: | Ligne 2914: | ||
< | < | ||
- | [root@centos8 | + | root@debian11:~# cgconfigparser -l / |
- | [root@centos8 | + | |
+ | root@debian11:~# cat / | ||
36864 | 36864 | ||
- | [root@centos8 | + | |
+ | root@debian11:~# cat / | ||
100 | 100 | ||
</ | </ | ||
+ | |||
----- | ----- | ||
Copyright © 2022 Hugh Norris. | Copyright © 2022 Hugh Norris. |