nerdexam
CompTIA

XK0-005 · Question #845

A Linux administrator is working with a CPU-intensive program called data-analysis1. The administrator needs to prevent the program from monopolizing CPU resources and ensure that other critical…

The correct answer is B. nice data-analysis1. To start a CPU-intensive program with a reduced priority, ensuring less impact on other system processes, the nice command is used without specific numerical arguments to default to a lower priority.

System Management

Question

A Linux administrator is working with a CPU-intensive program called data-analysis1. The administrator needs to prevent the program from monopolizing CPU resources and ensure that other critical processes are not impacted when the program starts. Which of the following commands would start the program with a reduced level of impact to the system?

Options

  • Adata-analysis1 --nice 15
  • Bnice data-analysis1
  • Cnice -15 data-analysis1
  • Ddata-analysis1 & nice +5

How the community answered

(19 responses)
  • A
    5% (1)
  • B
    89% (17)
  • C
    5% (1)

Why each option

To start a CPU-intensive program with a reduced priority, ensuring less impact on other system processes, the `nice` command is used without specific numerical arguments to default to a lower priority.

Adata-analysis1 --nice 15

`--nice 15` is not a standard option for the `data-analysis1` program to set its niceness; `nice` is a separate command used to set priority.

Bnice data-analysis1Correct

The `nice` command runs a utility or shell command with an altered scheduling priority. When executed as `nice data-analysis1` without a specific niceness level, it defaults to a niceness value of +10, which means the process will have a lower priority and consume fewer CPU resources than processes with a default niceness of 0.

Cnice -15 data-analysis1

`nice -15 data-analysis1` would set a niceness of -15, which increases the program's priority, making it *more* likely to monopolize CPU resources, contrary to the goal.

Ddata-analysis1 & nice +5

`data-analysis1 &` runs the program in the background, but `nice +5` syntax is incomplete and incorrect for starting the specific program `data-analysis1` with a reduced priority from the beginning.

Concept tested: Linux process scheduling priority (niceness)

Source: https://man7.org/linux/man-pages/man1/nice.1.html

Topics

#Linux commands#Process management#nice command#CPU priority

Community Discussion

No community discussion yet for this question.

Full XK0-005 Practice