Jump to content

What exactly IS cpu usage?

A lot of people seem to use the term "CPU usage" without knowing what it really means. Just that its a percentage found in the task manager.

 

So my question:

What does it mean for CPU to be under higher usage, or load?

In simple terms, what exactly is going on when a CPU is under high usage, and how is it calculated?

Link to comment
Share on other sites

Link to post
Share on other sites

It's the % of usage your CPU is under.

 

100% CPU usage means your CPU is being used 100%.

Specs: CPU - Intel i7 8700K @ 5GHz | GPU - Gigabyte GTX 970 G1 Gaming | Motherboard - ASUS Strix Z370-G WIFI AC | RAM - XPG Gammix DDR4-3000MHz 32GB (2x16GB) | Main Drive - Samsung 850 Evo 500GB M.2 | Other Drives - 7TB/3 Drives | CPU Cooler - Corsair H100i Pro | Case - Fractal Design Define C Mini TG | Power Supply - EVGA G3 850W

Link to comment
Share on other sites

Link to post
Share on other sites

2 minutes ago, TheKDub said:

It's the % of usage your CPU is under.

 

100% CPU usage means your CPU is being used 100%.

I understand that, but what does it mean for a CPU to be 100% used. It's processing as much data it can at any given time? Be specific.

 

Thanks!

Link to comment
Share on other sites

Link to post
Share on other sites

Just now, DeadlyPilot said:

I understand that, but what does it mean for a CPU to be 100% used. It's processing as much data it can at any given time? Be specific.

 

Thanks!

 

I'm not sure what else it would possibly be able to mean.

 

If it's being used 100%, then that's the limit, it can't be used 101%, or 100.1%, or anything past 100.

Specs: CPU - Intel i7 8700K @ 5GHz | GPU - Gigabyte GTX 970 G1 Gaming | Motherboard - ASUS Strix Z370-G WIFI AC | RAM - XPG Gammix DDR4-3000MHz 32GB (2x16GB) | Main Drive - Samsung 850 Evo 500GB M.2 | Other Drives - 7TB/3 Drives | CPU Cooler - Corsair H100i Pro | Case - Fractal Design Define C Mini TG | Power Supply - EVGA G3 850W

Link to comment
Share on other sites

Link to post
Share on other sites

1 minute ago, TheKDub said:

 

I'm not sure what else it would possibly be able to mean.

 

If it's being used 100%, then that's the limit, it can't be used 101%, or 100.1%, or anything past 100.

Yes but define 100%. What is 100% of a CPU?

 

Maybe I'm just retarded and don't understand so I apologize. 

Link to comment
Share on other sites

Link to post
Share on other sites

1 minute ago, TheKDub said:

 

I'm not sure what else it would possibly be able to mean.

 

If it's being used 100%, then that's the limit, it can't be used 101%, or 100.1%, or anything past 100.

pc usage = usage of cpu Kappa

he's asking more of what is being used. in a hard drive you can definitively say that a certain percentage of bytes are being used by data, hence usage. in a CPU i'm not really sure how to explain it since it's just some "thing" that does work

Link to comment
Share on other sites

Link to post
Share on other sites

Just now, TheKDub said:

 

I'm not sure what else it would possibly be able to mean.

 

If it's being used 100%, then that's the limit, it can't be used 101%, or 100.1%, or anything past 100.

It's a formula of frequency vs. usage across all cores. Say you have a dual core CPU, with one core at 90% frequency, 50% of the time. Then your CPU usage is 22.5%.

 

(0.9 * 0.5) / 2 = 0.225

 

I wouldn't trust me on that, though.

Link to comment
Share on other sites

Link to post
Share on other sites

1 minute ago, DeadlyPilot said:

Yes but define 100%. What is 100% of a CPU?

The CPU is working as much as it possibly can at that given moment. 

Main System: Phobos

AMD Ryzen 7 2700 (8C/16T), ASRock B450 Steel Legend, 16GB G.SKILL Aegis DDR4 3000MHz, AMD Radeon RX 570 4GB (XFX), 960GB Crucial M500, 2TB Seagate BarraCuda, Windows 10 Pro for Workstations/macOS Catalina

 

Secondary System: York

Intel Core i7-2600 (4C/8T), ASUS P8Z68-V/GEN3, 16GB GEIL Enhance Corsa DDR3 1600MHz, Zotac GeForce GTX 550 Ti 1GB, 240GB ADATA Ultimate SU650, Windows 10 Pro for Workstations

 

Older File Server: Yet to be named

Intel Pentium 4 HT (1C/2T), Intel D865GBF, 3GB DDR 400MHz, ATI Radeon HD 4650 1GB (HIS), 80GB WD Caviar, 320GB Hitachi Deskstar, Windows XP Pro SP3, Windows Server 2003 R2

Link to comment
Share on other sites

Link to post
Share on other sites

5 minutes ago, DeadlyPilot said:

A lot of people seem to use the term "CPU usage" without knowing what it really means. Just that its a percentage found in the task manager.

 

So my question:

What does it mean for CPU to be under higher usage, or load?

In simple terms, what exactly is going on when a CPU is under high usage, and how is it calculated?

As I see it, it's the percentage of transistors on the CPU that are being used to handle a program or part of it. What dissipates heat the most on a transistor is not it being on the on (1) state, but rather the energy lost when switching from 1 to 0 or vice versa.

 

1 minute ago, DeadlyPilot said:

Yes but define 100%. What is 100% of a CPU?

That would be every single transistor being used for something.

 

I bet CPUs can't know exactly what their usage is, but have very good ways to estimate it.

We have a NEW and GLORIOUSER-ER-ER PSU Tier List Now. (dammit @LukeSavenije stop coming up with new ones)

You can check out the old one that gave joy to so many across the land here

 

Computer having a hard time powering on? Troubleshoot it with this guide. (Currently looking for suggestions to update it into the context of <current year> and make it its own thread)

Computer Specs:

Spoiler

Mathresolvermajig: Intel Xeon E3 1240 (Sandy Bridge i7 equivalent)

Chillinmachine: Noctua NH-C14S
Framepainting-inator: EVGA GTX 1080 Ti SC2 Hybrid

Attachcorethingy: Gigabyte H61M-S2V-B3

Infoholdstick: Corsair 2x4GB DDR3 1333

Computerarmor: Silverstone RL06 "Lookalike"

Rememberdoogle: 1TB HDD + 120GB TR150 + 240 SSD Plus + 1TB MX500

AdditionalPylons: Phanteks AMP! 550W (based on Seasonic GX-550)

Letterpad: Rosewill Apollo 9100 (Cherry MX Red)

Buttonrodent: Razer Viper Mini + Huion H430P drawing Tablet

Auralnterface: Sennheiser HD 6xx

Liquidrectangles: LG 27UK850-W 4K HDR

 

Link to comment
Share on other sites

Link to post
Share on other sites

i think it's when the cpu is using all of it's cores, at the maximum speed... don't quote me on that I just gave that my best guess. maybe try a google search?

linus sex tips

Link to comment
Share on other sites

Link to post
Share on other sites

on Windows cpu usage is effectively the inverse of the cpu idle process. Read this and you will get a better understanding of CPU scheduling, https://en.wikipedia.org/wiki/System_Idle_Process

https://en.wikipedia.org/wiki/Scheduling_(computing)

cpu idle process, you can see in task manager, is a process that takes cpu cycles when the cpu has nothing to do. the OS has a task schedular that takes pending operations and measures things like load and assigns processes and resources appropriately. CPU load was mentioned elsewhere on this thread; this is measurement of the work the cpu needs to perform. This of it as a ratio of running operations over pending/queued operations per core. A load of 1 means 100% use of a single core, a load of 2 on a single core machine means the cpu has twice as much work required of it than it can perform; a load of 0.5 = 50% CPU use on a single core

 

edit - there are two book i recommend by andrew tanenbaum, modern operating systems, and operating systems: design and implementation

             ☼

ψ ︿_____︿_ψ_   

Link to comment
Share on other sites

Link to post
Share on other sites

I think it would be more related to the idle process, as mentioned above. If the CPU has many many tasks scheduled to be processed, it'll have a load of 100% because it is idle 0% of the time. All of the transistors don't have to be used as all processes don't use the same amount of registers within the CPU. Some operations require more, some require less. You could have trillions of simple calculations that don't require the use of many registers in the CPU and even though all of the transistors aren't being used, the CPU could still be at 100%. Not ALL of the transistors in the CPU are used for processing. Some are used for very short term memory (I believe that's the cache? Don't quote me...) others are used for the actual number crunching and holding temporary values. Processes take TIME. Flipping the transistors on and off takes time. Specifically processes take CYCLES. If you schedule enough processes that take enough time back to back to back, it'll max the CPU. 

 

If you ever get into programming microcontrollers, it's really interesting what the manual says. Say you wanted to turn on one pin from input to output. The manual will tell you exactly how many cycles that'll take. If you want to switch that pin from simple digital output to PWM, the manual will tell you exactly how many cycles that'll take. (And how many cycles you have to wait before you can do it again.) I'm sure it's not exactly the same for CPUs, but it's probably similar. 

Link to comment
Share on other sites

Link to post
Share on other sites

8 hours ago, Energycore said:

That would be every single transistor being used for something.

 

I bet CPUs can't know exactly what their usage is, but have very good ways to estimate it.

Well, not exactly. Very few transistors are being used simultaneously on the CPU, even under full load. If a processor were to actually use every single transistor at once it would go way beyond TDP and I doubt any CPU is really capable of this.

 

Each core on the CPU has a section dedicated to a certain type of instruction, such as an Integer execution unit, or a Floating-point execution unit. When that execution unit is called upon to perform its function, it becomes busy, but the other execution units in that core remain idle. A CPU core generally doesn't use all of its execution units simultaneously. It is instructed to perform a certain task, and it feeds the data through the appropriate execution unit, while the other ones are left idle, so not all the execution resources of a CPU core are ever really used at the same time.

 

Anyway, if the CPU core is executing an instruction of some kind, it is "busy". If not, it is "idle". The CPU usage is essentially the average busy-to-idle ratio. Keep in mind that software monitoring is inherently an average measurement, because the software only updates the numbers a few times each second. Every time the numbers update on the screen, the processor will have done hundreds of millions or some billions of cycles, some of which will have been spent idle, and some of which will have been spent executing tasks. When the software says the CPU is at "50% load" that doesn't mean it's halfway idle and halfway busy, which would be nonsensical. What it means is "2 billion cycles have passed since I last updated, 50% of those cycles were spent idle and 50% of them were spent busy".

 

Things get a bit hairy when you consider things like hyperthreading, and what exactly "100% load" means when both threads share the same execution resources, but I suppose we just have to figure the engineers came up with a sensible way of representing it.

Link to comment
Share on other sites

Link to post
Share on other sites

10 minutes ago, Glenwing said:

Well, not exactly. Very few transistors are being used simultaneously on the CPU, even under full load. Actually using every single transistor at once would go way beyond TDP and I doubt any CPU is really capable of this.

 

Each core on the CPU has a section dedicated to a certain type of instruction, such as an Integer execution unit, or a Floating-point execution unit. When that execution unit is called upon to perform its function, it is "busy". If not, it is "idle".

 

The CPU usage is essentially the average busy-to-idle ratio. Keep in mind that software monitoring is inherently an average measurement, because the software only updates the numbers a few times each second. Every time the numbers update on the screen, the processor will have done hundreds of millions or some billions of cycles, some of which will have been spent idle, and some of which will have been spent executing tasks. When the software says the CPU is "50% busy" that doesn't mean it's halfway idle and halfway busy, which would be nonsensical. What is means is "2 billion cycles have passed since I last updated, 50% of those cycles were spent idle and 50% of them were spent busy".

That makes a lot of sense, thanks

We have a NEW and GLORIOUSER-ER-ER PSU Tier List Now. (dammit @LukeSavenije stop coming up with new ones)

You can check out the old one that gave joy to so many across the land here

 

Computer having a hard time powering on? Troubleshoot it with this guide. (Currently looking for suggestions to update it into the context of <current year> and make it its own thread)

Computer Specs:

Spoiler

Mathresolvermajig: Intel Xeon E3 1240 (Sandy Bridge i7 equivalent)

Chillinmachine: Noctua NH-C14S
Framepainting-inator: EVGA GTX 1080 Ti SC2 Hybrid

Attachcorethingy: Gigabyte H61M-S2V-B3

Infoholdstick: Corsair 2x4GB DDR3 1333

Computerarmor: Silverstone RL06 "Lookalike"

Rememberdoogle: 1TB HDD + 120GB TR150 + 240 SSD Plus + 1TB MX500

AdditionalPylons: Phanteks AMP! 550W (based on Seasonic GX-550)

Letterpad: Rosewill Apollo 9100 (Cherry MX Red)

Buttonrodent: Razer Viper Mini + Huion H430P drawing Tablet

Auralnterface: Sennheiser HD 6xx

Liquidrectangles: LG 27UK850-W 4K HDR

 

Link to comment
Share on other sites

Link to post
Share on other sites

16 hours ago, Glenwing said:

Well, not exactly. Very few transistors are being used simultaneously on the CPU, even under full load. If a processor were to actually use every single transistor at once it would go way beyond TDP and I doubt any CPU is really capable of this.

 

Each core on the CPU has a section dedicated to a certain type of instruction, such as an Integer execution unit, or a Floating-point execution unit. When that execution unit is called upon to perform its function, it becomes busy, but the other execution units in that core remain idle. A CPU core generally doesn't use all of its execution units simultaneously. It is instructed to perform a certain task, and it feeds the data through the appropriate execution unit, while the other ones are left idle, so not all the execution resources of a CPU core are ever really used at the same time.

 

Anyway, if the CPU core is executing an instruction of some kind, it is "busy". If not, it is "idle". The CPU usage is essentially the average busy-to-idle ratio. Keep in mind that software monitoring is inherently an average measurement, because the software only updates the numbers a few times each second. Every time the numbers update on the screen, the processor will have done hundreds of millions or some billions of cycles, some of which will have been spent idle, and some of which will have been spent executing tasks. When the software says the CPU is at "50% load" that doesn't mean it's halfway idle and halfway busy, which would be nonsensical. What it means is "2 billion cycles have passed since I last updated, 50% of those cycles were spent idle and 50% of them were spent busy".

 

Things get a bit hairy when you consider things like hyperthreading, and what exactly "100% load" means when both threads share the same execution resources, but I suppose we just have to figure the engineers came up with a sensible way of representing it.

Ok so basically CPU usage is just a measurement of how frequently a CPU is being used. Does this mean a faster CPU will have a lower % usage when running the same exact applications as a slower CPU? If so, what if a faster CPU with the same exact clock frequency as a slower CPU, both ran the same applications, still a different percentage? And how does a CPU's "instructions per cycle" tie into this?

 

Thanks a lot this was very well written. Appreciate the help.

Link to comment
Share on other sites

Link to post
Share on other sites

1 hour ago, DeadlyPilot said:

Ok so basically CPU usage is just a measurement of how frequently a CPU is being used. Does this mean a faster CPU will have a lower % usage when running the same exact applications as a slower CPU? If so, what if a faster CPU with the same exact clock frequency as a slower CPU, both ran the same applications, still a different percentage? And how does a CPU's "instructions per cycle" tie into this?

 

Thanks a lot this was very well written. Appreciate the help.

Well, I suppose its slightly more complicated since CPUs may need more than one cycle to complete one instruction, it's not just one cycle per instruction for everything. This depends on the architecture.

 

For example, suppose one CPU needs four cycles to do an integer instruction (1 instruction per 4 cycles, or 0.25 instructions per cycle), while another can do the same thing in three cycles (1 instruction per 3 cycles, or 0.33 instructions per cycle). So lets say you had these two processors of different design both operating at 4.0 GHz (4 billion cycles per second) and instructed them to do 1 billion integer operations every second.

 

The first processor needs 4 cycles to do each instruction. 1 billion instructions would need 4 billion cycles, so 1 billion instructions per second would need all 4 billion cycles each second (100% load). Meanwhile the second CPU would only need to use 3 billion of its cycles each second to do the same thing, and the other 1 billion cycles would be spent idle (75% load). If the second CPU were given more tasks to bring it to full load, it would be capable of executing up to 1.333 billion integer ops per second, compared to 1 billion on the first processor. Even though they both have the same number of cycles per second (4.0 GHz), the second processor doesn't need as many cycles to do the same thing, so it has more theoretical computing power in that it can do more calculations per second. Since a "cycle" isn't a calculation, it's just a piece of a calculation, and how big of a piece it is depends on the architecture of the CPU, the number of cycles per second or "CPU frequency" (in GHz) isn't a measure of CPU "speed" or "power". It is related, but needs to be combined with the number of instructions per cycle (IPC) to actually get a measure of CPU power.

 

Of course, this is just an example; the reality of how CPUs are is so complex, there are a lot of tricks done to increase efficiency, and there are so many calculations being done in the background by the operating system and other software that there's really no way you can predict the behavior of a real world system based on the description I just gave, since there are so many other factors that affect real performance that I can't even begin to describe.

 

In regards to IPC there are hundreds of different instruction types and each one may take a different number of cycles to accomplish depending on the hardware design, and software uses a mix of many different types, so that's why IPC needs to be tested with real applications, it can't be represented with a nice single number like "0.25" or something like that. 

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×