LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Containers (https://www.linuxquestions.org/questions/linux-containers-122/)
-   -   Using atop with linux containers (https://www.linuxquestions.org/questions/linux-containers-122/using-atop-with-linux-containers-4175703619/)

comboloid12 11-15-2021 04:41 AM

Using atop with linux containers
 
I have used atop succesfully in the past with other setups, but not with linux containers. The case scenario is this:

1. I install atop in the LXD machine
2. I run some hoggy process inside the container
3. Atop shows the running process, so you can actively find out which containers runs it.

What about when you want to find out which container was running a process some hours ago? Is it possible to see in atop under which cgroup was running it?

pan64 11-15-2021 05:02 AM

atop can only check the currently running processes. There is no way "to find out which container was running a process some hours ago" (with atop).
atop itself cannot handle containers.

comboloid12 11-15-2021 05:48 AM

"atop can only check the currently running processes."

Well, not exactly as long as you can check the history of atop depending on the interval you set in it's config. You can actively see which container is running the process on the go, the question is if you can somehow check it out from the history of it.

shruggy 11-15-2021 06:37 AM

Perhaps, atopsar can do this.

sundialsvcs 11-17-2021 03:23 PM

"Containers" really have nothing to do with this essential question. What you're looking for is some kind of history of what has happened in the past ... and you also wish to be able to link a particular host process-id to a container.

This necessarily requires that some historical record exists – produced by the container manager –*which will enable you to associate the "pid" of a now-long-gone process with the container-id that was responsible for originally spawning it. I am not presently aware of any tool which does this.

Whenever a process is "running in a container," from the host operating system's perspective it is simply "an ordinary process, running on the host, but wearing rose-colored glasses." Unlike a virtual machine, there is no physical thing which corresponds to "a container." It is simply a set of parameters – system settings.


All times are GMT -5. The time now is 11:36 PM.