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

[Feat]: Group processes based on state #12139

Closed
myin142 opened this issue Feb 15, 2022 · 4 comments · Fixed by #12305
Closed

[Feat]: Group processes based on state #12139

myin142 opened this issue Feb 15, 2022 · 4 comments · Fixed by #12305
Assignees
Labels
area/collectors Everything related to data collection collectors/apps feature request New features

Comments

@myin142
Copy link

myin142 commented Feb 15, 2022

Problem

Currently the processes are only grouped in running and blocked states, so it's not possible to see the number of processes in each state like Running(R), Sleep(D or S) or Zombie(Z). Especially zombie processes are useful to know about.

Description

Discussed in #12133

Instead or in addition to the running and blocked states, it should show the processes in each state that Linux supports.

Importance

really want

Value proposition

  1. It's a more detailed information that what we currently get.
  2. Knowing how much zombie processes are on your system could help spotting potential problems.

Proposed implementation

No response

@myin142 myin142 added feature request New features needs triage Issues which need to be manually labelled labels Feb 15, 2022
@ilyam8
Copy link
Member

ilyam8 commented Feb 15, 2022

From what I know there is no effective way to get the number of processes/threads in a state.

Note: running and blocked (system.processes chart) we get from /proc/stat, that file contains only those counters.

From man procfs:

Character Description
R Running
S Sleeping in an interruptible wait
D Waiting in uninterruptible disk sleep
Z Zombie
T Stopped (on a signal) or (before Linux 2.6.33) trace stopped
t Tracing stop (Linux 2.6.33 onward)
W Paging (only before Linux 2.6.0)
X Dead (from Linux 2.6.0 onward)
x Dead (Linux 2.6.33 to 3.13 only)
K Wakekill (Linux 2.6.33 to 3.13 only)
W Waking (Linux 2.6.33 to 3.13 only)
P Parked (Linux 3.9 to 3.13 only)

apps.plugin parses procfs (including stat file for every process), so it already has all needed data, we need just to create charts.

cc @vlvkobal

  • we can create a chart per state (processes family).
  • default is only for Z (zombie).
  • can be adjusted via the configuration file.

The problem with Z processes is their command (proc/[pid]/comm) is "defunct", I think the same goes for the command line (proc/[pid]/cmdline). So we can't group them 😑.

We don't really do this, but I see no problem with the following - why don't we add just a chart with the number of processes in a state per state to apps.plugin?

@ilyam8 ilyam8 added area/collectors Everything related to data collection area/external labels Feb 16, 2022
@surajnpn surajnpn self-assigned this Feb 28, 2022
@surajnpn
Copy link
Contributor

surajnpn commented Mar 1, 2022

One thing I don't understand about this feature request is, what benefit is there to collect the number of Zombie processes in a system? Except for holding PID they are not consuming any resources. A zombie process is a process which has exited properly, released all its resources, but is maintaining a place in the process table.

@myin142
Copy link
Author

myin142 commented Mar 2, 2022

I am relatively new to all this monitoring but doesn't every bit of information help finding problems. If there are suddenly many zombie processes I would assume there is some kind of problem. Or are zombie processes something completely normal that you shouldn't pay attention to?

@ilyam8
Copy link
Member

ilyam8 commented Mar 2, 2022

I think they are not normal and usually, you want to find the cause. cc @Ferroin

@ilyam8 ilyam8 removed the needs triage Issues which need to be manually labelled label Mar 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/collectors Everything related to data collection collectors/apps feature request New features
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants