0

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.

viraptor
  • 1,264
  • 6
  • 21
  • 40

1 Answers1

0

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'
quanta
  • 50,327
  • 19
  • 152
  • 213
  • On the system I was having issues with, the fork rate is constantly around 60+ per second. Services running there don't pre-fork worker children. Additionally the spawned processes seem to get killed so fast they're hard to catch on ps (let alone a `watch`ed ps) – viraptor Aug 17 '11 at 10:20
  • If it be killed so fast, then, AFAIK, there is no way, except `strace`. – quanta Aug 17 '11 at 10:33