Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Comprehending 'top' CPU usage [closed]

People also ask

How do you read top command CPU usage?

The best way to check cpu usage in Linux is using top command. Simply type “top” at the command prompt. You will then see a list of the processes that are currently running, as well as information about the CPU usage, memory usage, and load average. To exit the top command, press the q key.

What does top CPU usage mean?

The top command calculates the elapsed CPU time since the last screen update, expressed as a percentage of total CPU time. For example, suppose we set two seconds as the refresh interval, and the CPU usage reports 50% after a refresh.

Why is CPU usage at top 100?

The Answer The reason behind that is the CPU usage represents the usage of each core, which means, 100% means the usage of 1 core, 200% means it's occupying two cores. In short, it is CPU usage percentage per core in top command, we can use i to toggle this behaviour.

Why is my CPU usage so high for no reason?

Update Drivers. If a process is still using too much CPU, try updating your drivers. Drivers are programs that control particular devices connected to your motherboard. Updating your drivers may eliminate compatibility issues or bugs that cause increased CPU usage.


In *NIX land, 100% cpu usage is 100% of a SINGLE cpu.

This applies to multi-core processors the same way as true multi-processor computers.

So, you are using 7/8th of your total CPU cycles on mysql.


While running top, press "1". This will toggle the view so that you can see the load per individual core/cpu.


I've just read an interesting article on this very subject yesterday : Unix load average. It will explain all you need to know and more.

Extract :

The load average is the sum of the run queue length and the number of jobs currently running on the CPUs. In Solaris 2.0 and 2.2 the load average did not include the running jobs but this bug was fixed in Solaris 2.3.

Consider that there are two basic modes to display load : "IRIX mode" and "Solaris mode". In IRIX mode (Linux default), a load average of 1 means that one CPU is fully loaded ( or 25% of each CPU on a 4 CPU system, etc). In Solaris mode, a load average of 1 means that all CPUs are fully loaded (so it's actually equivalent to "IRIX mode" load divided by CPU count ).


Load average shows how many processes are waiting on the queue (adjusted for the number of CPUs). With one CPU, a load average of 1.0 means that this CPU is able to fully process all requests on the queue optimally — no process is waiting for CPU, and no CPU cycles are wasted (i.e. idle). A load average of 2.0 (on a single-core system( would mean that half the processes would be waiting for a chance to run on the CPU :-( A load average of 0.33 would mean that there is so little load on the system that 2/3 of the time the CPU is basically doing nothing but waiting for more processes to run.

The CPU percentage shown by top is a measure of how often a single process is loaded by the kernel to run on the CPU, averaged over a period of time. So 350% on a 4-core system means that, for a period of time, mysqld would be taking over three full CPUs and half the time of the fourth CPU — i.e. it has so many threads to run that it pretty much swamps the 4 cores with requests. CPU percentage doesn't really take into account the waiting queues (while load average does): it's an after-the-fact statistic of what happened in a certain frame of time. But it certainly shows which processes have been using the CPU(s) recently.

Another thorough article on the same subject: http://www.linuxjournal.com/article/9001


There are 4 x 100%, so "top" shows a total of 400% on a 4 CPU box.


Each cpu process is consider as 100% . So totatlly it 400% of 4 cpu.