Process Priority Flashcards

(20 cards)

1
Q

What does process priority control?

A

How aggressively a process competes for CPU time.

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

What is niceness in Linux?

A

A value that influences process scheduling priority.

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

What is the range of niceness values?

A

From -20 (highest priority) to 19 (lowest priority).

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

What does the nice command do?

A

Sets the initial niceness value when launching a process.

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

Syntax for nice command?

A

nice [-n adjustment] command [arguments…]

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

Example of nice command?

A

nice -n 15 tar -czf /srv/backups/home-$(date +%F).tgz /home

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

What does -n 15 mean in nice command?

A

Sets niceness to 15.

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

What does tar -czf do?

A

Creates a compressed archive.

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

What is /srv/backups/home-$(date +%F).tgz?

A

The output archive file.

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

What directory is being backed up in the example?

A

/home.

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

How to monitor niceness of a process?

A

Use ps -o pid,ni,cmd -C tar.

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

Example output of ps command?

A

10234 15 tar -czf /srv/backups/home-2025-04-30.tgz /home

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

What does the renice command do?

A

Modifies niceness value of an already running process.

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

What privilege is required to raise priority?

A

Super-user privileges.

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

Syntax for renice command?

A

renice [-n adjustment] { -p pid | -g pgid | -u user }

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

Example of renice command?

A

sudo renice -n -5 -p 10234

17
Q

What does sudo do in renice example?

A

Grants super-user privileges.

18
Q

What does -n -5 mean in renice command?

A

Sets new niceness value 5 points higher in priority.

19
Q

What does -p 10234 mean in renice command?

A

Targets process ID 10234.

20
Q

Example output of renice command?

A

10234 old priority 15, new priority 10.