CPU Flashcards Preview

A2P > CPU > Flashcards

Flashcards in CPU Deck (17):
1

Describe the top utility.

A combination of free, uptime and ps command.

2

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.

3

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

4

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

/proc/cpuinfo

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

5

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.

6

What is the quantum value?

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

7

How to kill a process from top?

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

8

First 5 lines in top:

Uptime
Tasks
CPU
Memory
Swap

9

CPU metric: us

Percentage of CPU time spent running user processes

10

CPU metric: sy

Percentage of CPU time spent running the kernel and kernel processes

11

CPU metric: ni

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

12

CPU metric: id

Percentage of CPU time spent idle.

13

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.

14

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

15

CPU metric: si

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

16

CPU metric: st

Percentage of CPU times spent

17

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.