Fragen zum Cgroups-Speicher

Fragen zum Cgroups-Speicher

1) Warum zeigt die Kontrollgruppe eine höhere Anzahl an Aufgaben an als die tatsächliche Anzahl an Aufgaben?

Ex :

[root@localhost proc]# ps -aux | wc -l
421
[root@localhost proc]# cat /sys/fs/cgroup/memory/tasks | wc -l
539

2) Warum zeigt cgroup einen höheren Speicherverbrauch an als der tatsächliche Speicherverbrauch?

Ex :

[root@localhost memory]# free -h
              total        used        free      shared  buff/cache   available
Mem:            11G        425M        9.4G         38M        1.7G         10G
Swap:          2.0G        193M        1.8G
[root@localhost memory]# cat /sys/fs/cgroup/memory/memory.usage_in_bytes
1596362752

Oben können Sie sehen, dass bei „free“ 425 M als belegter Speicher angezeigt werden und bei „cgroups“ etwa 1,4 GB.

Bitte beachten Sie, dass es nur 1 Standard-Cgroup gibt, es werden keine weiteren Cgroups erstellt

3) Wie berechnet man die korrekte/angemessene Speicherauslastung für Kontrollgruppen?

Antwort1

1) Ein Multithread-Prozess hat eine einzelne Zeile in ps auxder Ausgabe, wenn jeder Thread eine Aufgabe ist. Vergleichen Sieps -auxH | wc -l

verwandte Informationen