stupidcache / psutil

Automatically exported from code.google.com/p/psutil
Other
0 stars 0 forks source link

Expose cgroup as process attr #490

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
On linux, cgroup usage is increasingly common (systemd, lxc, docker), it would 
be nice to have that exposed on a process as an attribute.

Original issue reported on code.google.com by kapilt@gmail.com on 30 Mar 2014 at 3:12

GoogleCodeExporter commented 9 years ago
I've been meaning to look into this for a while now but I've never really had 
the chance to look into how Linux cgroups work and how to configure them on a 
per-process basis (yet).
It must be noted that Process.rlimit() was introduced as some kind of 
substitute for Linux cgroups as it allows to configure many aspects of the 
process execution with a clean(er) API:
http://psutil.readthedocs.org/en/latest/#psutil.Process.rlimit
If there's one thing I understood from Linux cgroups is that it's not 
immediately clear how to configure them, therefore it's also not clear what 
kind of API we should expose.
I'm kind of a newbie here so any kind of suggestion is appreciated.

Original comment by g.rodola on 7 Apr 2014 at 4:28

GoogleCodeExporter commented 9 years ago
so configuring cgroups i think is probably out of scope, things there are still 
in a bit of flux (direct sys fs mods to arbiter either in the form of cgmanager 
or systemd accessed via debus).

exposing the details of a process's cgroup those is relative straightforward 
though
http://blog.docker.io/2013/10/gathering-lxc-docker-containers-metrics/

ideally to me is filter on querying processes by cgroup name, with each process 
obj having a link/attr to its cgroup which is an object that exposes the 
overall cgroup stats (mem, cpu usage, etc) which makes collecting 
container/process group stats trivial.

Original comment by kapilt@gmail.com on 7 Apr 2014 at 4:54

GoogleCodeExporter commented 9 years ago
psutil has been migrated from Google Code to Github (see: 
http://grodola.blogspot.com/2014/05/goodbye-google-code-im-moving-to-github.html
).
Please do NOT reply here but use this instead:
https://github.com/giampaolo/psutil/issues/490

Original comment by g.rodola on 26 May 2014 at 3:06