supervisord
is running on CentOS server. If I do
ps -e -o %mem,%cpu,cmd | grep supervisord | awk '{memory+=$1;cpu+=$2} END {print memory,cpu}'
I get 0 0
just because supervisord
is just an initialization daemon. It runs four child processes on my server:
# pgrep -P $(pgrep supervisord) | wc -l
4
How can I find summarized CPU and memory usage of these child processes in one-line-command?
Best Answer
the code
will get only one child layer
if u want to search for all processes that were derived from a main pid, use this code ..
The pid of main processe is the PGID of child processes.