Giter VIP home page Giter VIP logo

cgroup-utils's People

Contributors

hartwork avatar lebauce avatar novas0x2a avatar peo3 avatar unicell avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cgroup-utils's Issues

KeyError: 'throttle.io_service_bytes in container python:3.8.17-slim

Hi, thanks for providing this library. I unfortunately got the following error while running inside docker container which is given in the title.

$ ./cgutil top -i -n 2 -b
Traceback (most recent call last):
  File "./cgutil", line 52, in <module>
    main()
  File "./cgutil", line 48, in main
    cmd.run()
  File "/app/.venv/lib/python3.8/site-packages/cgutils/commands/top.py", line 534, in run
    return self._run_window(None)
  File "/app/.venv/lib/python3.8/site-packages/cgutils/commands/top.py", line 530, in _run_window
    ui.run()
  File "/app/.venv/lib/python3.8/site-packages/cgutils/commands/top.py", line 330, in run
    self.cgstats.update()
  File "/app/.venv/lib/python3.8/site-packages/cgutils/commands/top.py", line 227, in update
    stats = self._convert[_cgroup.subsystem.name](stats)
  File "/app/.venv/lib/python3.8/site-packages/cgutils/commands/top.py", line 162, in __conv_blkio_stats
    for k, v in stats['throttle.io_service_bytes'].items():
KeyError: 'throttle.io_service_bytes

pip install does not install latest released version from pypi.org

  • reproduction:
pip3 install "cgroup-utils"
# version 0.5 is trying to get installed but fails because 0.5 is not py3 compatible
pip3 install "cgroup-utils>=0.6" 
# fails because pip says there is no 0.6
  • while debugging i found that: https://pypi.org/simple/cgroup-utils/ only lists package versions 0.3, 0.4, 0.5, but while cross checking with other pypi packages latest version is always in "/simple"

Gentoo will be removing dev-python/cgroup-utils

Any chance of updating for compatibility with Python >=3.7 ?

- dev-python/cgroup-utils-0.6::gentoo (masked by: package.mask)
/usr/portage/profiles/package.mask:
# Michal Górny <[email protected]> (2020-03-07)
# The following packages are stuck on Python 3.6, and have no reverse
# dependencies.  Please let the Python team know if you find some
# of them still useful.
# Removal in 30 days.  Bug #711808.

cgutil top fails on Ubuntu 18.04

Just installed cgroup-utils

root@francesco-X8SIL:~# pip show cgroup-utils
Name: cgroup-utils
Version: 0.5
Summary: Utility tools for control groups of Linux
Home-page: https://github.com/peo3/cgroup-utils
Author: peo3
Author-email: [email protected]
License: GPLv2
Location: /usr/local/lib/python2.7/dist-packages
Requires: argparse, multiprocessing

and tried to launch cgutil top:

# cgutil top
Traceback (most recent call last):
  File "/usr/local/bin/cgutil", line 48, in <module>
    main()
  File "/usr/local/bin/cgutil", line 44, in main
    cmd.run()
  File "/usr/local/lib/python2.7/dist-packages/cgutils/commands/top.py", line 524, in run
    return curses.wrapper(self._run_window)
  File "/usr/lib/python2.7/curses/wrapper.py", line 43, in wrapper
    return func(stdscr, *args, **kwds)
  File "/usr/local/lib/python2.7/dist-packages/cgutils/commands/top.py", line 518, in _run_window
    ui.run()
  File "/usr/local/lib/python2.7/dist-packages/cgutils/commands/top.py", line 318, in run
    self.cgstats.update()
  File "/usr/local/lib/python2.7/dist-packages/cgutils/commands/top.py", line 212, in update
    stats = _cgroup.get_stats()
  File "/usr/local/lib/python2.7/dist-packages/cgutils/cgroup.py", line 665, in get_stats
    stats[name] = self._PARSERS[cls](fileops.read(path))
  File "/usr/local/lib/python2.7/dist-packages/cgutils/cgroup.py", line 269, in parse
    raise EnvironmentError('No header found in memory.kmem.slabinfo')
EnvironmentError: No header found in memory.kmem.slabinfo
# uname -a
Linux francesco-X8SIL 4.15.0-46-generic #49-Ubuntu SMP Wed Feb 6 09:33:07 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux

cgutil did not work on Parallels Cloud Server and OpenVZ

yum install -y python-pip python-devel
pip install cgroup-utils

On Parallels Cloud Server:

cgutil top
Traceback (most recent call last):
  File "/usr/bin/cgutil", line 48, in <module>
    main()
  File "/usr/bin/cgutil", line 44, in main
    cmd.run()
  File "/usr/lib64/python2.6/site-packages/cgutils/commands/top.py", line 524, in run
    return curses.wrapper(self._run_window)
  File "/usr/lib64/python2.6/curses/wrapper.py", line 43, in wrapper
    return func(stdscr, *args, **kwds)
  File "/usr/lib64/python2.6/site-packages/cgutils/commands/top.py", line 516, in _run_window
    cgstats = CGTopStats(self.args)
  File "/usr/lib64/python2.6/site-packages/cgutils/commands/top.py", line 53, in __init__
    self._update_cgroups()
  File "/usr/lib64/python2.6/site-packages/cgutils/commands/top.py", line 66, in _update_cgroups
    root_cgroup = cgroup.scan_cgroups(name, self.FILTERS[name])
  File "/usr/lib64/python2.6/site-packages/cgutils/cgroup.py", line 808, in scan_cgroups
    raise NoSuchSubsystemError("No such subsystem found: " + subsys_name)
cgutils.cgroup.NoSuchSubsystemError: No such subsystem found: memory

On OpenVZ:

 cgutil top
Traceback (most recent call last):
  File "/usr/bin/cgutil", line 5, in <module>
    pkg_resources.run_script('cgroup-utils==0.5', 'cgutil')
  File "/usr/lib/python2.6/site-packages/pkg_resources.py", line 461, in run_script
    self.require(requires)[0].run_script(script_name, ns)
  File "/usr/lib/python2.6/site-packages/pkg_resources.py", line 1194, in run_script
    execfile(script_filename, namespace, namespace)
  File "/usr/lib64/python2.6/site-packages/cgroup_utils-0.5-py2.6-linux-x86_64.egg/EGG-INFO/scripts/cgutil", line 48, in <module>
    main()
  File "/usr/lib64/python2.6/site-packages/cgroup_utils-0.5-py2.6-linux-x86_64.egg/EGG-INFO/scripts/cgutil", line 44, in main
    cmd.run()
  File "/usr/lib64/python2.6/site-packages/cgroup_utils-0.5-py2.6-linux-x86_64.egg/cgutils/commands/top.py", line 524, in run
    return curses.wrapper(self._run_window)
  File "/usr/lib64/python2.6/curses/wrapper.py", line 43, in wrapper
    return func(stdscr, *args, **kwds)
  File "/usr/lib64/python2.6/site-packages/cgroup_utils-0.5-py2.6-linux-x86_64.egg/cgutils/commands/top.py", line 516, in _run_window
    cgstats = CGTopStats(self.args)
  File "/usr/lib64/python2.6/site-packages/cgroup_utils-0.5-py2.6-linux-x86_64.egg/cgutils/commands/top.py", line 53, in __init__
    self._update_cgroups()
  File "/usr/lib64/python2.6/site-packages/cgroup_utils-0.5-py2.6-linux-x86_64.egg/cgutils/commands/top.py", line 66, in _update_cgroups
    root_cgroup = cgroup.scan_cgroups(name, self.FILTERS[name])
  File "/usr/lib64/python2.6/site-packages/cgroup_utils-0.5-py2.6-linux-x86_64.egg/cgutils/cgroup.py", line 808, in scan_cgroups
    raise NoSuchSubsystemError("No such subsystem found: " + subsys_name)
cgutils.cgroup.NoSuchSubsystemError: No such subsystem found: memory

Here you can see all cgroup mounts:

cat /proc/mounts |grep cgr
beancounter /proc/vz/beancounter cgroup rw,relatime,blkio,name=beancounter 0 0
container /proc/vz/container cgroup rw,relatime,freezer,devices,name=container 0 0
fairsched /proc/vz/fairsched cgroup rw,relatime,cpuacct,cpu,cpuset,name=fairsched 0 0

Kube pod monitor: Unable to see BLKIO when using top command Kubernetes pod

Unable to see BLKIO when using top command Kubernetes pod below is the screen shot, If anyone can help me here, If I am missing anything ?
image

cat blkio.throttle.io_service_bytes
259:0 Read 1363968
259:0 Write 16384
259:0 Sync 1363968
259:0 Async 16384
259:0 Discard 0
259:0 Total 1380352
Total 1380352

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.