Toolvito

Works on this device

CPU Utilization Calculator

Work out how busy a processor is, in percent. Use busy and idle time, two readings of the system counters, or one figure for each core. The page also reads a load average against the number of cores, sizes cores for a target, and shows a simple queue model. It cannot measure your computer, so you type the figures.

Enter your values

The share of time in which the processor was busy.

Your values

Time in which the processor did work.

Your values are worked out in this browser. They are not sent to a server.

Your result will show here

Fill in the values, then choose Calculate.

How to use this calculator

  1. Choose what you want to work out. The first choice is Utilisation from busy and idle time.
  2. Choose what you know: the busy and idle time, the busy and total time, or the CPU time of a program.
  3. Type the figures from your monitoring program and choose a unit for each time.
  4. Choose Calculate. The working is shown under the result.

The formulas

  • Utilisation = busy time ÷ (busy time + idle time) × 100.
  • From two counter readings = (1 − change of the idle counter ÷ change of the total counter) × 100.
  • Of a program = CPU time ÷ (elapsed time × cores) × 100. As a share of one core it is CPU time ÷ elapsed time × 100, which can be above 100%.
  • Average over cores = the sum of the core figures ÷ the number of cores.
  • Load for each core = load average ÷ number of cores.
  • Cores needed = cores × utilisation ÷ 100 × (1 + growth ÷ 100) ÷ (target ÷ 100), rounded up.
  • Utilisation law = arrival rate × service time ÷ number of processors.
  • M/M/1 queue: response time = service time ÷ (1 − utilisation). For more processors the page uses the M/M/c (Erlang C) formula.

Worked examples

Busy and idle time: a processor is busy for 45 seconds and idle for 15 seconds. Utilisation = 45 ÷ 60 × 100 = 75%.

Counters: the total counter goes from 1,250,000 to 1,254,000 and the idle counter from 1,000,000 to 1,001,200. The changes are 4,000 and 1,200. Utilisation = (1 − 1,200 ÷ 4,000) × 100 = 70%.

A program: it uses 150 seconds of CPU time in 60 seconds on a computer with 4 cores. That is 250% of one core and 62.5% of all cores.

Cores: four cores show 92%, 35%, 18% and 11%. The average is 156 ÷ 4 = 39%, but one core is nearly full.

Load average: a load of 3.2 on 4 cores is 0.80 for each core.

Cores needed: 8 cores at 65% do the work of 5.2 busy cores. With 50% growth that is 7.8. For a target of 70% you need 7.8 ÷ 0.7 = 11.14, so 12 cores.

Queue model: 40 requests a second with a service time of 20 ms on one processor give a utilisation of 40 × 0.02 = 80%. The M/M/1 response time is 20 ÷ (1 − 0.8) = 100 ms.

Limits you should know

  • A browser page cannot read the processor counters of your computer. Every figure is typed.
  • Utilisation is an average over a time. A short time shows peaks and a long time hides them.
  • The average over cores treats all cores as equal. Fast and slow cores, and two threads on one core, make it less exact.
  • A load average counts tasks, and on Linux also tasks that wait for a disk. It is not a percent of the processor.
  • The cores needed assume that twice the cores do twice the work. Many programs do not scale like that.
  • The queue model assumes random arrivals and service times of one kind. Real systems differ, so use it as a rough guide.
  • The target utilisation, the growth and all starting figures are examples.

Related tools