Podman統計とシステム状態が異なるメモリ使用量を表示するのはなぜですか?

Podman統計とシステム状態が異なるメモリ使用量を表示するのはなぜですか?

最初は複数のプロセスを作成して終了し、lxmlメモリリークを防止しようとしましたが失敗しました。

だから、新しいアイデアを試す前にサービスファイルにを設定しましたOOMPolicy=stopMemoryMax=2G

私の意図は、Podman統計のメモリ使用量が2Gに達すると、systemdのOOM-killerが(カーネルのSIGKILLの代わりに)停止を送信することです。だから再起動します。

ただし、メモリ使用量podman stats164.9MBですがsystemctl status、結果はですMemory: 756.0K (high: 1.8G max: 2.0G available: 1.8G)。 (高い部分は無視してください。ちょうど試してみました--runtime。)

もちろん、実験を通して何かを見せることができますが、メモリの説明を聞きたいです。 Unixには、私がまだ理解していない動作の理由があるからです。

$podman stats

ID            NAME                                              CPU %       MEM USAGE / LIMIT  MEM %       NET IO             BLOCK IO    PIDS        CPU TIME     AVG CPU %

254d65607347  memory_leaking_lxml_container                                   0.09%       164.9MB / 33.29GB  0.50%       40.84MB / 2.479MB  0B / 0B     14          21.501493s   0.84%

$systemctl status --user container-memory_leaking_lxml_container.service 

● container-memory_leaking_lxml_container.service - Podman container-memory_leaking_lxml_container.service
     Loaded: loaded (/home/shelf/.config/systemd/user/container-memory_leaking_lxml_container.service; enabled; preset: disabled)
    Drop-In: /run/user/1000/systemd/user.control/container-memory_leaking_lxml_container.service.d
             └─50-MemoryHigh.conf
     Active: active (running) since Thu 2023-10-26 02:43:46 KST; 13s ago
       Docs: man:podman-generate-systemd(1)
   Main PID: 10403 (conmon)
      Tasks: 1 (limit: 202744)
     Memory: 756.0K (high: 1.8G max: 2.0G available: 1.8G)
        CPU: 88ms
     CGroup: /user.slice/user-1000.slice/[email protected]/app.slice/container-memory_leaking_lxml_container.service
             └─10403 /usr/bin/conmon --api-version 1 -c 6a4a037a7cca7641188ea145446e8fac2ba6a76ccf81ebce7a9d52cb80e31265 -u 6a4a037a7cca7641188ea145446e8fac2ba6a76ccf81ebce7a9d52cb80e31265 -r /usr/bin/crun -b /home/shelf/.local/share/cont>

もう一つのケースは「42.84MB」と「80.9M」だ。

af8cfa352332  taskwarrior-webui  0.01%       42.84MB / 12.26GB  0.35%       2.42kB / 430B  0B / 0B     23          959.476ms   0.01%
[shelf@localhost ~]$ systemctl --user status container-taskwarrior-webui.service 
● container-taskwarrior-webui.service - Podman container-287516d806e5dec732bb2152568304950343e98c75cd05f8ade36826a2d292e2.service
     Loaded: loaded (/home/shelf/.config/systemd/user/container-taskwarrior-webui.service; enabled; preset: disabled)
     Active: active (running) since Thu 2023-10-26 01:19:24 KST; 2h 19min ago
       Docs: man:podman-generate-systemd(1)
   Main PID: 1801 (conmon)
      Tasks: 16 (limit: 74601)
     Memory: 80.9M
        CPU: 695ms
     CGroup: /user.slice/user-1000.slice/[email protected]/app.slice/container-taskwarrior-webui.service
             ├─1735 /usr/bin/slirp4netns --disable-host-loopback --mtu=65520 --enable-sandbox --enable-seccomp --enable-ipv6 -c -e 3 -r 4 --netns-type=path /run/user/1000/netns/netns-cb5acc65-4f8a-650e-6ae6-68e4fc909e11 tap0
             ├─1738 rootlessport
             ├─1745 rootlessport-child
             ├─1777 /usr/bin/fuse-overlayfs -o "lowerdir=/home/shelf/.local/share/containers/storage/overlay/l/24YP66TL5NQBZOG6ZSFAGPT42L:/home/shelf/.local/share/containers/storage/overlay/l/6OIWR3J24EEIAHQS7UBWPF6XQ4:/home>
             └─1801 /usr/bin/conmon --api-version 1 -c af8cfa352332489ffaa29c82efd7ecf6e6dbb0d90705be6b559203a7f45bb8a0 -u af8cfa352332489ffaa29c82efd7ecf6e6dbb0d90705be6b559203a7f45bb8a0 -r /usr/bin/crun -b /home/shelf/.local/shar>

Oct 26 01:19:23 localhost.localdomain podman[1636]: 2023-10-26 01:19:23.144002301 +0900 KST m=+1.152343622 container create af8cfa352332489ffaa29c82efd7ecf6e6dbb0d90705be6b559203a7f45bb8a0 (image=docker.io/dcsunset/taskwarrior-webui:lates>
Oct 26 01:19:24 localhost.localdomain podman[1636]: 2023-10-26 01:19:24.368842932 +0900 KST m=+2.377184246 container init af8cfa352332489ffaa29c82efd7ecf6e6dbb0d90705be6b559203a7f45bb8a0 (image=docker.io/dcsunset/taskwarrior-webui:latest,>
Oct 26 01:19:24 localhost.localdomain systemd[835]: Started Podman container-287516d806e5dec732bb2152568304950343e98c75cd05f8ade36826a2d292e2.service.
Oct 26 01:19:24 localhost.localdomain podman[1636]: 2023-10-26 01:19:24.649773078 +0900 KST m=+2.658114401 container start af8cfa352332489ffaa29c82efd7ecf6e6dbb0d90705be6b559203a7f45bb8a0 (image=docker.io/dcsunset/taskwarrior-webui:latest>
Oct 26 01:19:24 localhost.localdomain podman[1636]: af8cfa352332489ffaa29c82efd7ecf6e6dbb0d90705be6b559203a7f45bb8a0
Oct 26 01:19:46 localhost.localdomain taskwarrior-webui[1801]: 
Oct 26 01:19:46 localhost.localdomain taskwarrior-webui[1801]: > [email protected] start
Oct 26 01:19:46 localhost.localdomain taskwarrior-webui[1801]: > node ./dist/app.js
Oct 26 01:19:46 localhost.localdomain taskwarrior-webui[1801]: 
Oct 26 01:19:50 localhost.localdomain taskwarrior-webui[1801]: Server listening on http://0.0.0.0:3000

ベストアンサー1

おすすめ記事