Skip to content

Instantly share code, notes, and snippets.

@mancubus77
Last active November 18, 2024 12:54
Show Gist options
  • Select an option

  • Save mancubus77/0a56431fd50b957bf15af085dcaddf95 to your computer and use it in GitHub Desktop.

Select an option

Save mancubus77/0a56431fd50b957bf15af085dcaddf95 to your computer and use it in GitHub Desktop.

Revisions

  1. mancubus77 revised this gist Jan 24, 2022. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions cgroups-rhel8.md
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,4 @@
    ###Solution 1
    **Solution 1**

    I was not able to run `podman stats` on RHEL8. The command returned:
    ```console
    @@ -37,7 +37,7 @@ d691d440957f ansible_runner_68 4.39% 1.013GB / 17GB 5.96% -- /
    Happy dayz


    ###Solution 2
    **Solution 2**

    Update Grub
    ```
  2. mancubus77 revised this gist Jan 24, 2022. 1 changed file with 22 additions and 1 deletion.
    23 changes: 22 additions & 1 deletion cgroups-rhel8.md
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,5 @@
    ###Solution 1

    I was not able to run `podman stats` on RHEL8. The command returned:
    ```console
    Error: stats is not supported in rootless mode without cgroups v2
    @@ -32,4 +34,23 @@ a5ec1b29c8f5 ansible_runner_72 4.39% 1.013GB / 17GB 5.96% -- /
    d691d440957f ansible_runner_68 4.39% 1.013GB / 17GB 5.96% -- / -- -- / -- 198 1m12.079041s 4.39%
    ```

    Happy dayz
    Happy dayz


    ###Solution 2

    Update Grub
    ```
    sudo grubby --update-kernel=ALL --args='systemd.unified_cgroup_hierarchy'
    sudo reboot
    ```

    Tune cgroups
    ```
    sudo mkdir /etc/systemd/system/user@.service.d
    sudo cat > /etc/systemd/system/user@.service.d/delegate.conf<<EOF
    [Service]
    Delegate=cpu cpuset io memory pids
    EOF
    sudo systemctl daemon-reload
    ```
  3. mancubus77 revised this gist Jan 24, 2022. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion cgroups-rhel8.md
    Original file line number Diff line number Diff line change
    @@ -21,7 +21,7 @@ Reboot system
    ```
    init 6
    ```

    Run it again
    ```console
    podman stats -a --no-stream
    ID NAME CPU % MEM USAGE / LIMIT MEM % NET IO BLOCK IO PIDS CPU TIME AVG CPU %
  4. mancubus77 created this gist Jan 24, 2022.
    35 changes: 35 additions & 0 deletions cgroups-rhel8.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,35 @@
    I was not able to run `podman stats` on RHEL8. The command returned:
    ```console
    Error: stats is not supported in rootless mode without cgroups v2
    ```

    Solution based on this article -> https://sleeplessbeastie.eu/2021/09/10/how-to-enable-control-group-v2/

    ```
    vi /etc/default/grub
    ```
    and append `systemd.unified_cgroup_hierarchy=1` to make it like
    ```
    GRUB_CMDLINE_LINUX="console=tty0 console=ttyS0,115200n8 no_timer_check net.ifnames=0 crashkernel=auto systemd.unified_cgroup_hierarchy=1"
    ```
    Rebuild grub config
    ```
    grub2-mkconfig -o "$(readlink -e /etc/grub2.conf)"
    ```

    Reboot system
    ```
    init 6
    ```

    ```console
    podman stats -a --no-stream
    ID NAME CPU % MEM USAGE / LIMIT MEM % NET IO BLOCK IO PIDS CPU TIME AVG CPU %
    1a6dad44f8be ansible_runner_66 4.39% 1.013GB / 17GB 5.96% -- / -- -- / -- 198 1m12.078589s 4.39%
    276a8a3dba1a ansible_runner_64 4.39% 1.013GB / 17GB 5.96% -- / -- -- / -- 198 1m12.078655s 4.39%
    2be1402c870c ansible_runner_70 4.39% 1.013GB / 17GB 5.96% -- / -- -- / -- 198 1m12.078821s 4.39%
    a5ec1b29c8f5 ansible_runner_72 4.39% 1.013GB / 17GB 5.96% -- / -- -- / -- 198 1m12.079041s 4.39%
    d691d440957f ansible_runner_68 4.39% 1.013GB / 17GB 5.96% -- / -- -- / -- 198 1m12.079041s 4.39%
    ```

    Happy dayz