2

I've noticed that there are sometimes (large) differences between the reported total CPU usage and a summation of the per-process CPU utilization given by apps like top and wmtop.

As an example: I recently ran a git filter-branch --index-filter on a fairly large repo, with the index-filter command piping git ls-files through a grep filter and into xargs git rm --cached. This took a few minutes to run; while it was going I noticed that both wmtop and top were displaying a high (above 50% on my 2-core machine) total CPU usage, but that neither showed any individual processes which were using a significant amount of CPU time.

Are some processes not shown in the process list? What sorts of processes are these, and is there a way to find out how much CPU time they are using?

1 Answer 1

2

You should add a snapshot of tops output to your question so we can see exactly what you see.

The most common discrepancy in processor use indicators is some counting "I/O wait" time as well as "actually CPU busy" time. I/O wait time is when a process would be actively doing something, so could potentially have used all the time-slice the scheduler has given it, but has yielded as it is blocked waiting for I/O operations to complete.

Short running processes have an effect too: if there are many processes starting, doing something small, then closing, they may not be seen at all by top or similar (especially if you don't have top updating often) because they did their thing and stopped between updates. Even though they were not present when top took its samples (so don't appear in the tasks list) they overall counts in the /proc filesystem will still show since the last sample the CPU was busy for X scheduler ticks and idle for Y.

2
  • Ahh, I think your second paragraph has it. top was refreshing every second or so, and the filter-branch processed 300 commits in the span of a couple of minutes, with each commit being processed by a newly spawned process. Is there a way to get top to sample more frequently without changing its refresh frequency?
    – intuited
    Commented Oct 1, 2010 at 23:17
  • top can not do that, but atop can. You should find it in your distro's standard repositories, if not you can get it (and more info) from atoptool.nl Commented Oct 2, 2010 at 16:11

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .