Saturday, May 4, 2024
87
rated 0 times [  87] [ 0]  / answers: 1 / hits: 107194  / 1 Year ago, mon, may 22, 2023, 7:06:39

Is it possible to set a new nice level of a running process with a known id?



Does this operation require root access, or just being the owner of the process?


More From » process-priority

 Answers
5

Terminal


If you're at a terminal you can use renice


renice [-n] priority [[-p] pid ...] [[-g] pgrp ...] [[-u] user ...]

A simple example would be


renice 8 31043
31043: old priority 5, new priority 8

You can also pass it hard flags, but it follows that order (you have to pass priority first and then the pid - if you change the order it will show the usage messagge)


renice -n 5 -p 31043
31043: old priority 8, new priority 5

Priorities work on a scale of -20 to 19 - The lower the number, the higher it's priority on the system.


If you own the process then you won't need root - however, if the process is owned by another user or if you plan on changing the group/user of the process root (via sudo) will be required.


[#44632] Tuesday, May 23, 2023, 1 Year  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
bleger

Total Points: 468
Total Questions: 108
Total Answers: 100

Location: Belarus
Member since Wed, Dec 7, 2022
1 Year ago
;