When the number of blocked processes grow indefinitely, how to identify exactly what are these processes.
Since I'm inside a system container (LXC/OpenVZ), I can't modify the hosts' kernel modules to use tools like perf-tools or bcc-tools/bpfcc-tools
The question How to track newly created processes in Linux? doesn't cover the scenario of system containers, and most of the answers rely on tools like perf-tools
and bcc-tools
.
1. Check
CONFIG_PROC_EVENTS
First check if
CONFIG_PROC_EVENTS
is enable. Depending on your distro, you can run:If it's enabled, you will get the following result:
2. If it's enabled, create the monitor
Create a file
proc_events.c
with the content:Ensure that you can compile C programs. On Debian or Debian-based distros, like Ubuntu, run:
And compile it with:
3. Run it for a few seconds
Running it this way will output directly on terminal:
But you can also redirect it and run for a few seconds, in order to save its output on a file:
4. Analise the results
The output will be in the following format:
Credits to @cirosantilli