Questions tagged [nice]

A tool to change the priority of a process, giving it more or less CPU time.

112 questions
37
votes
7 answers

How to renice all threads (and children) of one process on Linux?

Linux does not (yet) follow the POSIX.1 standard which says that a renice on a process affects "all system scope threads in the process", because according to the pthreads(7) doc "threads do not share a common nice value". However, sometimes, it can…
Totor
  • 19,302
  • 17
  • 75
  • 102
30
votes
2 answers

Why can't I use renice to increase a process' nice value?

From man renice: Users other than the super-user may only alter the priority of processes they own, and can only monotonically increase their ``nice value'' (for security reasons) within the range 0 to PRIO_MAX (20) [...] So, I can renice my…
terdon
  • 234,489
  • 66
  • 447
  • 667
28
votes
1 answer

Nice and child processes

Can someone tell me what is the relationship between a specified nice level and child processes? For example, if I have a default nice of 0, and I start a script with nice 5, which in turn starts some child processes (in this case about 20 in…
NWS
  • 683
  • 2
  • 7
  • 15
27
votes
7 answers

How do I start a process with a nice value of -20 and not give it root privilege?

I would like to start a process with a nice value of -20. This requires me to use a command like sudo nice -n -20 matlab However, this starts matlab as root too. Is there a way to have matlab as non-root? My current approach is sudo nice -n -20…
Lord Loh.
  • 1,916
  • 8
  • 20
  • 33
25
votes
2 answers

Why does niceness range from -20 to 19?

The nice command allows you to adjust the scheduling priority ("niceness") of a program. On all Unix-like systems I've used, niceness is specified by a range of integers, where -20 is the most favourable scheduling priority, 0 is the default, and…
Psychonaut
  • 864
  • 8
  • 17
23
votes
1 answer

How is nice working?

sched_setscheduler says : All scheduling is preemptive: if a process with a higher static priority becomes ready to run, the currently running process will be preempted and returned to the wait list for its static priority …
BЈовић
  • 600
  • 1
  • 8
  • 20
22
votes
2 answers

Using and understanding systemd scheduling-related options in a desktop context

In systemd service files, one can set the following scheduling related options (from the systemd.exec man page, correct me if I'm wrong): Nice Sets the default nice level (scheduling priority) for executed processes. Takes an integer…
equaeghe
  • 554
  • 2
  • 6
  • 14
22
votes
4 answers

Run Linux process at very very low priority?

I have a regular process that's not so important but will consume very much CPU power. I have another process which is really important, but it spends most of the time idle, but when it gets a job it really needs high computing power. I tried…
uray
  • 3,830
  • 11
  • 36
  • 42
20
votes
2 answers

What does a niceness value of (-) mean?

According to the man page, and wikipedia; nice ranges from -20 to 20. Yet when I run the following command, I find some processes have a non numerical value such as (-). See the sixth column from the left with title 'NI'. What does a niceness of…
spuder
  • 17,643
  • 36
  • 91
  • 119
18
votes
2 answers

nice and ionice: which one should come first?

I need to run some long and heavy commands, but at the same time, I'd like to keep my desktop system responsive. Examples: btrfs deduplication, btrfs balance, etc. I don't mind if such commands take longer to finish if I give them a lower priority,…
user22304
15
votes
3 answers

Set niceness to piped command

I need to execute a set of "piped" commands with altered niceness level. Example: nice -n 15 command1 | command2 | command3 In this case niceness is altered to "15" only for command1. How to change it for the whole set of commands (command1,…
Wargalis
  • 151
  • 1
  • 3
14
votes
2 answers

How can I allow a user to prioritize a process to negative niceness?

I want a user to run a specific process on the system with a negative nice value. I can't simply fork the process to background as this specific program is a minecraft server and I rely on the command line to control the server. My current bash…
Baarn
  • 882
  • 2
  • 11
  • 18
13
votes
2 answers

Set default nice value for a given user (limits.conf)

Could someone tell me how to set the default value of nice (as displayed by top) of a user? I have found that /etc/security/limits.conf is the place but if I put either: username_of_a_guy - nice 19 username_of_a_guy soft nice …
Alex
  • 233
  • 1
  • 2
  • 8
11
votes
4 answers

Is setting a higher nice level for a process an effective way to reduce its impact on system load/CPU time?

I have an rsync cron job which is pushing the server load and triggering monitor alerts. If I set the job to be run with a high nice level, would that effectively reduce the impact it has on system load values?
Gregg Leventhal
  • 7,480
  • 19
  • 65
  • 100
10
votes
1 answer

Does the timeslice depend on process priority or not under Completely Fair Scheduling?

I'm trying to understand the Completely Fair Scheduler (CFS). According to Robert Love in Linux Kernel Development, 3rd edition(italics his, bold mine): Rather than assign each process a timeslice, CFS calculates how long a process should run as…
Ellen Spertus
  • 1,193
  • 1
  • 12
  • 16
1
2 3 4 5 6 7 8