Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Process connections : /proc not used ? #1146

Closed
rockandska opened this issue Oct 16, 2017 · 3 comments
Closed

Process connections : /proc not used ? #1146

rockandska opened this issue Oct 16, 2017 · 3 comments
Labels
docker vm any container (e.g. docker) or virtual OS (e.g. VMWare)

Comments

@rockandska
Copy link

Hi,

I've read #1011 , #558 and search inside docs but didn't find an exhaustive list of functions who can't work with custom PROCFS_PATH (mounted via docker).

From my tests, it seems than process connections are not read from proc.

Is there any plan to list all api call who are not compatible with custom PROCFS_PATH ?
Is it not possible to read all informations or partial parts for process connections from /proc ?

Thanks,

@giampaolo
Copy link
Owner

Hello,
yes, not all information comes from /proc. Some is retrieved via system calls. I'm not willing to take the effort of keeping track of what comes from /proc though.
The correct way for retrieving info from a virtual instance (docker or whatever) is to run psutil on the virtual instance itself and then use "something" to exchange that info with the host. That "something" may be SSH + JSON, an HTTP server or whatever.

@rockandska
Copy link
Author

Thanks for your fast answer.
Not all informations comes from /proc, but is there some informations available from /proc but the api continue to make a syscall ?
If this informations are available from /proc (for linux based OS), is there any particular reasons to not take them from /proc ?
I'm agreed than the correct way is to use "something" on the host itself, but in a near future(right now ?), with new tiny os like Atomic, RancherOs etc., the OS will be only here to launch some "kind of containers", and if informations are available on /proc, I think it is better to take it from it (for linux OS based).
For now we could launch the needed containers as SPC (super privileged container) but would be far better if we had only to mount some dir in read-only mode. :)

Regards,

@giampaolo
Copy link
Owner

In general we read from /proc but where this is not possible syscalls are used instead (e.g. net_ functions), disk_partitions, users, process' cpu_affinity and a bunch of others places. If you don't rely on these APIs then you can use the PROFCS_PATH trick and retrieve info from the virtual host. E.g. system wide CPU and memory metrics functions, which are the most used, are OK.

@giampaolo giampaolo added docker vm any container (e.g. docker) or virtual OS (e.g. VMWare) labels Nov 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docker vm any container (e.g. docker) or virtual OS (e.g. VMWare)
Projects
None yet
Development

No branches or pull requests

2 participants