Welcome to the Linux Foundation Forum!

renice command increasement by 5

dolios
dolios Posts: 4

on Knowledge Check Question 3.2 it wants to increase the niceness by 5. But none of the below seems to do it?

[root@localhost ~]# renice 5 28977
28977 (process ID) old priority 5, new priority 5

[root@localhost ~]# renice +5 28977
28977 (process ID) old priority 5, new priority 5

Comments

  • dolios
    dolios Posts: 4
    edited July 2020

    Right both set it to 5 since 5 and +5 are both positives. But the question is only valid if the niceness is 0 although that is not mentioned. "Question 3.2
    Which command will increase the niceness by 5 units of the process with PID = 444?" not set it to 5. Or am I miss understanding something?

    Is there a command for a general increase of niceness independent of what it currently is or do you first need to know what it is and then have it increased by 5. (renice +5. renice +10, renice +15)

  • luisviveropena
    luisviveropena Posts: 1,249

    Hi @dolios ,

    on Knowledge Check Question 3.2 it wants to increase the niceness by 5.
    But none of the below seems to do it?

    I think the question should be "setup" instead "increase". I'll check it with Coop.

    Is there a command for a general increase of niceness independent of what
    it currently is or do you first need to know what it is and then have it increased by 5.
    (renice +5. renice +10, renice +15)

    As far as I understand, "renice" is to setup a new niceness value for a running process. And "nice" is to start a process with a specific "niceness".

    The good thing is that you can see it for yourself in a small test (I just did it):

    1.- Start an application, let's say firefox.
    2.- See the pid of the process, using "ps -fe | grep firefox" or "top".
    3.- Run top with the pid, for example:

    top -p 3967

    Where 3967 is the pid for firefox (the parent process) on my system.

    4.- In another terminal do tests using "renice". For example:

    renice 10 3967

    And see what happens in the top output.

    I hope that helps to clarify the use of nice and renice.

    I'll check anyway the KC for this chapter.

    Many regards,
    Luis.

  • coop
    coop Posts: 916

    This error should have been fixed months ago but seems to have fallen through the cracks. It should say "set " not "increase". It will be fixed in next update.

  • There is the same problem with the language on the page "Modifying the Nice Value" in module 3:

    To raise the niceness of an already running process, it is easy to use the renice command, as in:

    $ renice +3 13848

    which will raise the nice value by 3 points for the process with pid = 13848.

    In this case "raise the nice value by 3 points" sounds wrong for any process with a non-zero niceness before renice.

  • Hi @akamch ,

    Thanks for the catch.

    Regards,
    Luis.

  • chuckdsk
    chuckdsk Posts: 1

    "Question 3.2
    Which command will set the niceness to 5 units of the process with PID = 444? Select all answers that apply.

    A. renice 5 444
    B. renice +5 444
    C. nice -5 444
    D. nice +5 444"

    As far as I can see, both A and B are correct (tested with sleep 100 & and used both commands with the pid of sleep--both worked).

    When I select A, the results show that B is the correct answer.

    When I retake the quiz and select B, the results show that A is the correct answer.

    I feel that the instructional content for both nice and renice is not clear at all, particularly regarding + and no +.

    Moreover, the man page for renice is a pile of hot garbage, as it only mentions + as an example and does not detail it in the OPTIONS section.

    While I learned a lot about nice, renice, and ps (an even bigger pile of hot garbage), trying to figure out what was going on here, I recommend a review of this section of the course materials with an eye towards tightening up clarity a bit.

    Thanks!

  • @chuckdsk Thats because both of them are correct!

Categories

Upcoming Training