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 just run a copy command for two large directories with a small number of huge files and I see my cp process is consuming around half a core in top:

51116 root      20   0  110m  876  688 D 43.9  0.0   3:23.83 cp -i -r 165 178 temp       

Why does the cp process consume any cpu? I would imagine it spends most of it's time waiting on disk...

Thx, Boaz

share|improve this question

2 Answers 2

up vote 6 down vote accepted

if you check the percentages, at the top of the screen, you'll see that it's mostly on %wa (waiting) and %id (idle), and very little (if any) in %us(userspace).

but at the process line, all the time it spends idly waiting for a given process is charged to that process. if another CPU-heavy process was running at the same time, it would take most of the CPU without affecting the copy task, because it would use the %id and %wa time.

share|improve this answer

It is managing the move. This includes finding the files, creating new files, and copying them. All this takes some CPU time. Due to the way files are buffered, it may be possible to this very quickly with the file writes occurring asynchronously to the copy operation. If the files aren't buffered, then the CPU utilization can be quite low while files are accessed.

share|improve this answer

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.