CPU Flashcards

1
Q

Describe the top utility.

A

A combination of free, uptime and ps command.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

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

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What determines the 100% load of a CPU?

A

The number of processor cores.

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

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

A

/proc/cpuinfo

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

CPU percentages vs CPU load averages

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is the quantum value?

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

How to kill a process from top?

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

First 5 lines in top:

A
Uptime
Tasks
CPU
Memory
Swap
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

CPU metric: us

A

Percentage of CPU time spent running user processes

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

CPU metric: sy

A

Percentage of CPU time spent running the kernel and kernel processes

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

CPU metric: ni

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

CPU metric: id

A

Percentage of CPU time spent idle.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

CPU metric: wa

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

CPU metric: hi

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

CPU metric: si

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

CPU metric: st

A

Percentage of CPU times spent

17
Q

Explain the Task States:

Running -
Sleeping -
Stopped -
Zombie -

A

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.