Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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.

share|improve this question
add comment

1 Answer 1

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'
share|improve this answer
    
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 watched 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
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.