1

I noticed that my Debian Jessie system is using many pids, even when the system is (should be) largely idle. The following shows that more or less 270 pids are used per 10s, while the number of active processes stays more or less the same:

$ while :; do echo -n "$(ps | tail -n 1 | cut -d' ' -f1) "; ps aux | wc -l; sleep 10; done
15008 155
15280 155
15555 155
15800 155
16074 155
16343 155
16612 155
16881 155
17150 155
17418 155
17688 155

Even though system load isn't very high, I'd like to investigate this and fix it (if possible) before it becomes a problem.

2 Answers2

2

If the load stay low and the process count stay pretty constant, that just means short lived processes are spawn during the ten second period. Twenty seven processes per second might not be a problem at all so there might be nothing to fix.

On the other hand, that might be a bogus daemon or something trying to launch a process that quickly fails and doing it again in an endless loop.

To find it out, I would recommend using one of the utilities also created by Solaris dtrace execsnoop author, for example that one using ftrace or that other one using systemtap.

jlliagre
  • 60,319
  • 10
  • 115
  • 157
0

If nothing else, your shell script creates a process for each command such as ps, cut, tail, etc., in that loop. You could only observe the systems with an application (one process...) which scanned the /proc filesystem looking for relevant changes.

Further reading:

Thomas Dickey
  • 75,040
  • 9
  • 171
  • 268