Skip to content

Consider adding option to hide irrelevant CPU and RAM stats inside container #1538

Open
@jjyyxx

Description

@jjyyxx

Inside containers hosted on a server with a lot of cores and RAM, with the actual core and RAM limit constrained via cgroup settings (cpuset and memory), the htop's CPU and RAM meters are quite unhelpful, in the sense that it could not reflect the container's actual situation (and sometimes even annoying when the terminal size is small, leaving no space for processes). In my case, the server has 2x Intel(R) Xeon(R) Platinum 8480+ (224 threads) and 2TiB memory, but the container is limited to 16 threads and 32GiB memory.

This two constraints can be queried via

  • /sys/fs/cgroup/cpuset/cpuset.cpus and /sys/fs/cgroup/memory/memory.limit_in_bytes for cgroup v1
  • /sys/fs/cgroup/cpuset.cpus and /sys/fs/cgroup/memory.max for cgroup v2

Ideally, htop could provide container-aware option such that only the core utilization within the cpuset, and the actual memory limit (and usage) is displayed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Containers 📦Light-weight virtualization suitesLinux 🐧Linux related issuesenhancementExtension or improvement to existing feature

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions