CPU Flashcards Preview

A2P > CPU > Flashcards

Flashcards in CPU Deck (17):

Describe the top utility.

A combination of free, uptime and ps command.


What do the three numbers in the uptime output correlate to?

The CPU load average over the last minute, 5 minutes and 15 minutes respectively.


What determines the 100% load of a CPU?

The number of processor cores.

Ex: A quad-core processor has a 100% CPU load of 4.00


What's the file you can check to determine the number of processor cores your system has?


Ex command:
grep 'model name' /proc/cpuinfo | wc -l


CPU percentages vs CPU load averages

CPU percentages give us a good idea of how much each process made use of the CPU but load average provide an idea of the DEMAND for the CPU.


What is the quantum value?

It determines how often the kernel takes control of the system back from a running process/application.


How to kill a process from top?

Press 'k' key. Then type the PID of the process you want to kill.


First 5 lines in top:



CPU metric: us

Percentage of CPU time spent running user processes


CPU metric: sy

Percentage of CPU time spent running the kernel and kernel processes


CPU metric: ni

Percentage of CPU times spent running niced user processes. Nicing a process changes its priority.


CPU metric: id

Percentage of CPU time spent idle.


CPU metric: wa

Percentage of CPU time spent on I/O. If this value is low on a sluggish system, it is probably safe to rule out network or disk I/O as the cause.


CPU metric: hi

Percentage of CPU times spent servicing hardware interrupts. Used by devices to let the system know they require attention.

Ex: hard disk signaling it has read data blocks


CPU metric: si

Percentage of CPU times spent servicing software interrupts. Occurs when a software terminates or is requesting some service.


CPU metric: st

Percentage of CPU times spent


Explain the Task States:

Running -
Sleeping -
Stopped -
Zombie -

Running: # of tasks in the runnable state.

Sleeping: processes being blocked due to waiting for an event (e.g., time out or I/O completion). It accounts for both interruptible (can be awaken earlier by SysV signal) or uninterruptible (completely ignoring SysV signal) processes.

Stopped: the exact meaning here is "paused," not "terminated." In a terminal, you can stop a program by sending it a SIGSTOP signal or pressing Ctrl-Z if it's a foreground task.

Zombie: "A dead body without soul" might be a good analogy. After a child task is terminated, it is cleaned up and the only thing left is a task descriptor that includes a very important value: exit status. So if the number of zombies is high, that is a sign that one or more programs have a bug properly terminating child tasks.