peo3 / cgroup-utils Goto Github PK
View Code? Open in Web Editor NEWcgroup-utils helps your cgroups life
License: GNU General Public License v2.0
cgroup-utils helps your cgroups life
License: GNU General Public License v2.0
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
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
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"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.
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
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
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.