systemd-cgtop 显示 cgroups 资源使用情况

发布时间: 更新时间: 总字数:264 阅读时间:1m 作者: IP上海 分享 网址

systemd-cgtop按资源使用情况显示最高control groups

help

systemd-cgtop --help ...
$ systemd-cgtop --help
systemd-cgtop [OPTIONS...] [CGROUP]

Show top control groups by their resource usage.

  -h --help           Show this help
     --version        Show package version
  -p --order=path     Order by path
  -t --order=tasks    Order by number of tasks/processes
  -c --order=cpu      Order by CPU load (default)
  -m --order=memory   Order by memory load
  -i --order=io       Order by IO load
  -r --raw            Provide raw (not human-readable) numbers
     --cpu=percentage Show CPU usage as percentage (default)
     --cpu=time       Show CPU usage as time
  -P                  Count userspace processes instead of tasks (excl. kernel)
  -k                  Count all processes instead of tasks (incl. kernel)
     --recursive=BOOL Sum up process count recursively
  -d --delay=DELAY    Delay between updates
  -n --iterations=N   Run for N iterations before exiting
  -1                  Shortcut for --iterations=1
  -b --batch          Run in batch mode, accepting no input
     --depth=DEPTH    Maximum traversal depth (default: 3)
  -M --machine=       Show container

See the systemd-cgtop(1) man page for details.

示例

$ systemd-cgtop
CGroup                                                                         Tasks   %CPU   Memory  Input/s Output/s
user.slice                                                                         5    2.4    35.9M        -        -
user.slice/user-0.slice                                                            5    2.4    35.7M        -        -
user.slice/user-0.slice/session-3.scope                                            3    2.4    30.0M        -        -
/                                                                                283    2.0   675.3M        -        -
system.slice                                                                      87    0.4   899.9M        -        -
system.slice/containerd.service                                                    8    0.2    56.3M        -        -
system.slice/open-vm-tools.service                                                 4    0.1     6.0M        -        -
system.slice/irqbalance.service                                                    2    0.1     1.2M        -        -
...
# 按路径搜索
systemd-cgtop -p system.slice
systemd-cgtop -p init.scope
systemd-cgtop -p user.slice

# 按 cpu 排序
systemd-cgtop --order=cpu
Home Archives Categories Tags Statistics
本文总阅读量 次 本站总访问量 次 本站总访客数