Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [nice]

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

2
votes
1answer
25 views

How does the kernel assign the nice value to a process after it has been executed?

The Linux kernel implements two separate priority ranges. The first is the nice value, a number from –20 to +19 with a default of 0. Nice values are the standard priority range used in all Unix ...
1
vote
0answers
42 views

Understading Linux Process Priority (PR)

I have been trying to understand the linux nice and priority system, from my understanding a processes NI or nice level is essentially how friendly it is to other processes in terms of fair use of ...
3
votes
1answer
266 views

The `PRI` column of `ps` is inconsistent with man pages

I've been trying to understand how scheduling priorities work in linux. Here's what I've got: The kernel uses a priority value for each process which ranges from 0 to 139. The lower the number, the ...
1
vote
1answer
46 views

Process state characterization in output of ps command

The ps command shows the state of the process (e.g. Sleeping, Running etc) as also some additional info about. Among two of these additional options according to the man page are < high-...
-1
votes
2answers
31 views

Why can't I `nice` a command group?

[fakename]$ nice yes a>/dev/null & [1] 26475 [fakename]$ ps -p 26475 -o nice,pid NI PID 10 26475 [fakename]$ nice { yes a>/dev/null; } & -bash: syntax error near unexpected token `}' ...
0
votes
0answers
24 views

`renice` seems to have no effect on CPU usage on Mac 10.13.4 [duplicate]

I am trying to test out the renice command on my Mac, it seems to be having no effect. This is how I'm testing it: I have a dual core CPU with hyper threading, so I run 6 instances of node -e 'while(...
1
vote
0answers
55 views

Nice does not affect utilization?

I am learning about the CFS in Linux. So i decided to see how the nice value can give a lower priority for background (i.e. nice) processes. I ran two CPU processes: taskset 01 python3 loop.py in two ...
5
votes
2answers
793 views

Should I set nice value lower for a user process to make it faster?

I recently learned about the nice value of a process. If I am running a user program, should I set the nice value as low as possible and would that make my process run faster?
1
vote
0answers
57 views

Automatic nice value?

I noticed that a process - here sort - has been scheduled with a higher nice value (2) - meaning lower priority. But what is the policy for deciding that? Also, it seems to be a rare event, as all ...
1
vote
1answer
266 views

Is there a guideline for setting nice values?

I would like to develop an app and want to come up a nice value for my daemon process. but I found no guideline for this. Some articles say that backup tasks should have higher nice value (which ...
1
vote
0answers
252 views

Linux / CFS: How do cgroupsv1 cpu.share / cgroupsv2 cpu.weight and nice process weights interact

I was wondering how cgroup cpu shares/weights (v1: cpu.shares or v2: cpu.weight) and the niceness value of a task do interact in Linux with the CFS (Completely Fair Scheduler). Both values have an ...
2
votes
1answer
376 views

Process Priority value is different in procfs

For example, let's examine the value of PRI of firefox with ps, and then see what is the value stored in procfs. $ ps -o pid,comm,pri,ni 7000 PID COMMAND PRI NI 7000 firefox 19 ...
0
votes
2answers
60 views

Linux - Process get as much resources as possible but give out resources when other processes coming in

I need to run a process A as much resources as possible when the machine is free, but gives out CPU once there's high-priority processes are started. Any suggestions? Thanks!
9
votes
1answer
257 views

What is the nicest a Unix command can be?

For a quick benchmarking test, how can nice and ionice be combined to maximum effect, ie for a command to use as little resource as possible (without idling altogether)? (I think it's something like `...
1
vote
0answers
205 views

Does it make sense to combine chrt and nice?

I want a CPU-intensive process to have the lowest possible impact on other processes. I can use nice -19 for maximum niceness and chrt -i 0 to give the process a SCHED_IDLE priority. Which is more ...
6
votes
2answers
2k views

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 ...
1
vote
0answers
141 views

macOS: nice/renice not working — no actual effect on cputime?

Although I can see a "nice" value ("NI") via ps, it seems to have no effect on the actual cpu-time used by a process: PID %CPU PRI NI COMM 57081 77.6 12 10 cpu-chew 57080 77.1 12 0 cpu-chew ...
1
vote
1answer
715 views

renice doesn't work in macOS Sierra

I wanted set low priority to HandBrake in macOS. I tried to use renice command by pid, but it seems not working. (nice value stays 0) % ps ax -l | grep Hand 501 32255 1 0 46 0 3433240 ...
0
votes
2answers
324 views

Centos 7 - renice all threads created by a python script

I'm running Centos 7 and Python 3.6. I have a python script that uses multi-treading. I want to renice or change the niceness value for all of the treads the script spawns. At present, I am able ...
0
votes
1answer
232 views

How does one “nice” a PID via htop after the process has begun?

Let's say I'm running a multicore process. How do I "nice" this via htop after submission?
0
votes
1answer
763 views

What does “/bin/sh -c nice run-parts --report /etc/cron.daily” mean?

Today, when I logged in and checked the ps output, I noticed a few lines that were run automatically under the root. I grepped the relevant lines here: root 1126 0.0 0.0 2616 424 ? ...
2
votes
1answer
322 views

Linux nice command

When I try to assign the nice value to a program for example: nice -n -7 waffles It will not allow me to run the program in the background as well with the bg command. Is there a way I can pipe ...
5
votes
2answers
641 views

Assign a higher priority to a specific process by default

I would like to configure my desktop Linux system so that whenever I start running a specific programme (run that processes of this programme) the respective process gets assigned a high priority. How ...
3
votes
1answer
723 views

Nice: *Low* priority using *more* CPU

(Ubuntu 14.04 server, 8 cores, 16GB RAM) When running 3 scripts in parallel that utilise the same (other) script, the inverse of what I expect to happen occurs when "renice-ing" the processes as they ...
4
votes
2answers
3k views

Difference between nice level and systemctl CPUShares property

As I understand it (please correct me if I'm wrong), systemctl set-property ... CPUShares=some_value limits the cpu time for an entire cgroup unit. If we instead want to limit cpu time for a process ...
8
votes
2answers
2k views

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 ...
1
vote
5answers
750 views

How to tell whether the 'nice' command is working?

I have a process that runs at about 100% CPU. So I run it with nice: $ nice /dir/myamd.sh The top command shows that my process still runs close to 100% (maybe slightly low like 99%). Is the nice ...
3
votes
1answer
929 views

What is kintegrityd and why it has -20 nice value?

I have a Linux distro in my laptop, with 3.18.17, 32-bit Kernel. Running top has listed below output, I am aware a little about nice and renice of process in Linux. Looking into top, I understood ...
8
votes
1answer
868 views

Does Linux Change a Process Niceness Automatically?

I know you can change a process niceness with setpriority or nice or renice. However, does Linux automatically adjust/change a process niceness without user input? I have a process for which I use ...
1
vote
1answer
95 views

Will renicing (lower) a process make it faster under memory pressure?

Let's say I want to prioritize a few processes that are running on a device with high memory pressure. These processes are UI processes (Android, specifically) and are running very slowly in this ...
2
votes
3answers
212 views

Is nice ignoring aliases?

I have alias rm='rm -i' in my ~/.bashrc file (I've just learned it is considered bad practice by some). It seems the alias is not taken into account when running it with nice: bli@naples:~$ touch ...
2
votes
3answers
2k views

What exactly is meant by a “niced” and an “un-niced” user process?

I was using the "top " command and I came across the nice value. I am aware of the priorities and how a nice value indicates the priority of a process. But I can't seem to figure out what the term "...
1
vote
1answer
668 views

What is largest value of priority in limits.conf?

What is the largest value one may set the priority limit to in limits.conf? I came across a script that adds the entry, admin hard priority 50, but this simply results in the nice being set to 19. ...
21
votes
5answers
5k views

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 ...
1
vote
2answers
52 views

Can making CPU-intensive processes lowest priority (19) have adverse effects?

When I make a CPU-intensive process lowest priority (niceness of 19), it seems the amount of real memory consumption goes up. Perhaps this has other causes. But, can making CPU-intensive processes ...
4
votes
1answer
326 views

Why is nice-level ignored? (Between different login sessions — honoured if started from same session.)

When I start two CPU-eating processes with different nice-level, e.g. Process 1: nice -19 sh -c 'while true; do :; done' Process 2: sh -c 'while :; do true; done' (I changed the order of : and ...
2
votes
1answer
121 views

Is there any command that limits the use of cpu resources by percentage?

So far I've been using nice -n 10, but that's just sets the priority of the command I want to run low, but if there's no other process running at that time the command will take all the remaining cpu ...
0
votes
1answer
425 views

`cpulimit` and `nice` not effective in limiting the cpu usage of a python program that contains heavvy computations using theano

I am running a program written in python that makes heavy computations using theano. As it is a very CPU-intensive program, it is disrupting all my other activies on my laptop. For this reason I ...
0
votes
0answers
275 views

Would a process with the higest nice value use only *free* CPU time

I want to be sure that a scheduled job, mostly using gzip, will not impact the production. This is an old Linux server with few CPU, it has SAN attachment so the gzip is running at its maximum using ...
0
votes
1answer
1k views

What is the difference between nice and renice?

What is the difference between the two commands nice and renice to manage process priority?
0
votes
1answer
76 views

nice command behavior when only 1 function running

I just learned the existence of nice (and ionice) which seems to be really interesting. I just want to launch a process 'p_low' with less priority than my ususal one 'p_normal'. What I was able to ...
1
vote
0answers
54 views

getpriority returning different value on different hosts with same kernel version

I am running centos 6.6 on same type of hardware with kernel version "2.6.32-504.30.3.el6.x86_64" Has anybody seen this why the below code when compiled and executed gives a different value on two ...
2
votes
2answers
996 views

What makes it possible for a `pulseaudio' process to get the nice level of -11?

I noticed that a pulseaudio process on my Gentoo Linux machine has the nice level of -11. But I don't know how it has gained such a high priority regardless of being owned by a normal user. I know a ...
1
vote
0answers
97 views

What is the best practice for setting a process niceness?

I have an agent which runs on my customer's hosts. I want this agent to leave the smallest possible footprint on their hosts, that is, I don't want to degrade my customers' performance. My agent runs ...
2
votes
1answer
243 views

Trying to Write a Script to Kill Processes based on niceness

I am trying to write a script in bash that will kill any of my own processes (and run indefinitely) if those processes have a niceness value of 4 or lower. Can anyone tell me what might be wrong? ...
21
votes
2answers
2k views

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 ...
2
votes
0answers
122 views

Use-spare-network-capacity wrapper (network nice)

I would like to use my 100/100 Mbps connection for Tor. I want to give it all my spare capacity, but I do not want to have my connection slowed down by Tor the 1% of the time when I actually need the ...
0
votes
2answers
299 views

Are there any drawbacks/caveats to changing process priority on linux?

I'm writing a program launcher that uses nice to launch X applications with a higher than usual priority and while there's plenty of guides to using nice/renice there's not much discussion about best ...
0
votes
2answers
79 views

Which tool can be used to configure the CPU priority of a process?

I know that you can use nice to re assign priorities of processes but which tool can be used to configure the CPU priority of a process ?
5
votes
3answers
1k views

How can I verify `nice` is working?

Looking at different jobs running on a system with shared resources, it seems the nice values are being ignored. Many jobs with nice set at 19 are running at 100% cpu load while other many other jobs ...