Linux – Identify spawned processes

linuxmonitoringprocess

I think that the number of processes forked per sec is a bit too high on one of the servers. How can I monitor what processes are spawned? Is there any tool that can help me? I know I can strace a specific process looking for fork(), but is there something similar that works system-wide?

I'd like to know at least the pid (and name) and it's ppid (and name of the parent).

I mean realtime monitoring of new fork()s, not a snapshot of what's available now.

Best Answer

I think that the number of processes forked per sec is a bit too high on one of the servers

I don't think so. As my understanding, all the child processes will be forked when the parent process starting. So, it's not too many as you think.

How can I monitor what processes are spawned?

You can do it by combination of ps and watch command (paging version):

watch 'ps -eo ppid,pid,comm --forest'