Sum-up subprocesses

Hi all,

On my system I have a parent process spawning several sub-processes:

root      84046  0.0  0.2 392688 36420 ?        Ss   Sep30   2:47 /usr/sbin/httpd -DFOREGROUND
apache   121160  3.3  0.1 395720 27616 ?        S    08:50   0:28 /usr/sbin/httpd -DFOREGROUND
apache   122515  3.3  0.1 395728 27564 ?        S    08:58   0:14 /usr/sbin/httpd -DFOREGROUND
apache   123223  1.9  0.1 395828 27368 ?        S    09:00   0:05 /usr/sbin/httpd -DFOREGROUND
apache   123338  4.6  0.1 395572 27120 ?        R    09:01   0:09 /usr/sbin/httpd -DFOREGROUND
apache   123353  2.2  0.1 395844 27460 ?        S    09:01   0:04 /usr/sbin/httpd -DFOREGROUND
apache   123362  3.8  0.1 395448 26460 ?        S    09:01   0:07 /usr/sbin/httpd -DFOREGROUND
apache   123468  4.3  0.1 395572 27132 ?        S    09:02   0:06 /usr/sbin/httpd -DFOREGROUND
apache   123478  2.9  0.1 395572 27124 ?        R    09:02   0:04 /usr/sbin/httpd -DFOREGROUND
apache   123480  3.3  0.1 395596 27120 ?        S    09:02   0:04 /usr/sbin/httpd -DFOREGROUND
apache   123564  3.0  0.1 395448 27012 ?        S    09:03   0:03 /usr/sbin/httpd -DFOREGROUND
apache   123567  8.5  0.1 395444 26416 ?        S    09:03   0:09 /usr/sbin/httpd -DFOREGROUND
apache   123576  1.6  0.1 395720 27344 ?        S    09:03   0:01 /usr/sbin/httpd -DFOREGROUND
apache   123577  2.5  0.1 395472 27060 ?        S    09:03   0:02 /usr/sbin/httpd -DFOREGROUND
apache   123658  2.7  0.1 395580 27316 ?        S    09:03   0:02 /usr/sbin/httpd -DFOREGROUND
apache   123743  3.0  0.1 395460 26964 ?        S    09:03   0:02 /usr/sbin/httpd -DFOREGROUND
apache   123978  3.0  0.1 395564 27116 ?        S    09:04   0:01 /usr/sbin/httpd -DFOREGROUND
apache   124018  0.6  0.1 395300 26772 ?        S    09:04   0:00 /usr/sbin/httpd -DFOREGROUND
apache   124021  5.0  0.1 395168 26040 ?        S    09:04   0:01 /usr/sbin/httpd -DFOREGROUND
apache   124023  1.2  0.1 395168 26168 ?        S    09:04   0:00 /usr/sbin/httpd -DFOREGROUND
apache   124024  0.8  0.1 395168 26036 ?        S    09:04   0:00 /usr/sbin/httpd -DFOREGROUND
apache   124035  2.7  0.1 395324 26676 ?        S    09:04   0:00 /usr/sbin/httpd -DFOREGROUND

I now want to display a graph histogram that lists all processes by CPU usage BUT I want all httpd processes summed up. More generic, I want to sum up all processes with the same name to be summed up and the results to be sorted descending. I'm pretty sure this is a rather basic question, but I wasn't able to get it working. I'm using ELK 7.11.2. All beats are 7.11.2 as well.

Kind regards,

Frank

hi @franknord

I think you should be able to get there with Kibana-Lens

Drag two fields on the middle-pan:

  • one with the sub-process-name (this will go on horizontal axis)
  • one for the CPU-usage (this will go on vertical axis)

Then on the right, select the cpu-usage field from the vertical axis, and change the metric to sum.

The default ordering is descending.

This is a screenshot from similar graph I created with sample-data.