A CPU executes, on average, 50 machine instructions per us. Suppose a program processes a file of records where reading and writing a record from the file takes 11 us each. If the program needs to execute 150 machine instructions between each reading and writing, what is the CPU utilization?
Answers
CPU utilization is the sum of work handled by a Central Processing Unit. It is also used to estimate system performance. CPU utilization can vary according to the type and amount of computing task because some tasks require heavy CPU time while others require less CPU time. Process time is another name for CPU time and is the amount of time used by a CPU for processing instruction of an operating system or a computer program. CPU time is quantified in clock ticks or seconds. CPU utilization shows the burden on a processor in terms of percentage that indicates if any changes are to be made in the system otherwise it may get exhausted of capacity.
CPU utilization can be calculated by using the following formulas.
Let us define CPU utilization as U
U = 100% - (Percentage of time that is spent in idle task)
% time in idle task =
(Take the average time period of background task without load) * 100%
-------------------------------------------------------------------------------------------------------
(Avg. period of background task including some load)
Percentage time in idle task =
(BG loop count computed during 25 ms) *100%
----------------------------------------------------------------------
(BG loop count projected in an unloaded CPU)
Actual % =
Scaled % * (100%)
------------------------------
max value 8 bit value
Note: CPU utilization upsurges when a system process requires more time.