Home » Questions » Computers [ Ask a new question ]

What does the percent CPU mean?

What does the percent CPU mean?

I am watching my CPU percent utilization by a process. How does a process use only 50% CPU? Doesn't a process use 100% then 0%, then 100%? Its not like every other instruction is a different program.

Asked by: Guest | Views: 55
Total answers/comments: 3
Guest [Entry]

"The OS schedules the process for a certain time period. So if the process is scheduled for (say) 1ms out of 10ms, then it will be using 10% CPU.

It's a little counterintuitive, since (in a single-threaded, single-CPU system), the process is either running, or not running. i.e. it's using 100% or 0%. The percentage that you see is measured over a time window and is a measure of the OS allocating time slots to your process to run.

Note that your process will not contribute to this if you're accessing I/O. So if you're doing a huge calculation, you'll register 100% (assuming nothing else runs). If you then wait for a network packet/disk access etc. your CPU figure will go down, despite the fact that your process is still running."
Guest [Entry]

You program might be doing a lot of I/O (disk or network reads/writes). That would keep the program busy but need little to no CPU time.
Guest [Entry]

"System utilization is sampled and averaged, which is the only sensible thing to do.

E.g. a record of how much time a process/thread spent running during 1 second is kept. If it spent 1 second on the CPU, that's 100% CPU (or 50% if you have 2 CPUs and so on), if it spent 100ms that's 10% CPU utilization."