Questions tagged [nice]

nice is a UNIX kernel call and the name of a utility employed to lower or raise a process' CPU priority.

nice is a program found on Unix and Unix-like operating systems such as Linux.

It directly maps to a kernel call of the same name. nice is used to invoke a utility or shell script with a particular priority, thus giving the process more or less CPU time than other processes. A niceness of −20 is the highest priority and 19 or 20 is the lowest priority. The default niceness for processes is inherited from its parent process, usually 0.

Source: Wikipedia

For questions about the Nice programming language, use .

101 questions
1
vote
1 answer

Bash : how to use a function (which is a string param) in an other function

I have these functions in my .bashrc: # This function just untar a file: untar() { tar xvf $1 } # This function execute a command with nohup (you can leave the terminal) and nice for a low priority on the cpu: nn() { nohup nice -n 15 "$@"…
hayj
  • 1,159
  • 13
  • 21
1
vote
1 answer

How to add a `nice` switch to my bash script

I have a bash script which runs some jobs. Sometimes I want to be able to run those jobs with nice to lower their priority on a server. For example, if my executable is a.out, I can run from the terminal nice a.out to lower the job priority. In my…
FreelanceConsultant
  • 13,167
  • 27
  • 115
  • 225
1
vote
1 answer

determine current process priority from within a running bash script

I want to ensure a script can only be run below a certain nice level. I searched around and I didn't find a good way of doing this, so I came up with this: #!/usr/bin/env bash set -euo pipefail IFS=$'\n\t' # use ps to get the niceness of the…
tonyg
  • 197
  • 2
  • 13
1
vote
0 answers

Niceness of a Process and Benchmarking

Does the niceness of a process matter for (micro) benchmarking? My intuition says that starting a benchmark with nice -20 would produce more precise results, since less context switches occur for the benchmark. On the other hand, many tools or…
box
  • 3,156
  • 3
  • 26
  • 36
1
vote
0 answers

Starting process with NICE Command (macOS) leaves the process priority at 0

I have a script (extendscript for AE) that create a command file and execute it. the generated command file look like: FILE=/path/file VAR="nice -n 9 ./application $FILE " cd /Applications/applicationpath $VAR Once my script is launching by the…
MSH
  • 11
  • 4
1
vote
3 answers

Run binary with highest priority

I am running one binary with highest priority like nice -n -20 binary Now I want to run same binary such that it runs with high priority without nice -n 20 binary like ./binary // runs with high priority same as nice -n -20 binary with any…
Rahul R Dhobi
  • 5,668
  • 1
  • 29
  • 38
1
vote
2 answers

How do I "nice" an already running process?

I have this process, "kernal_task", that is regularly taking 80% of my CPUs. I'd like to "nice" it down to 20, but it's already running. Is there any way in the Mac OS/X bash to decrease the priority of an already running process?
Greg Dougherty
  • 3,281
  • 8
  • 35
  • 58
1
vote
1 answer

How to create "nice" sounding notes and music from simple user input?

I want to make something remotely similar to DinahMoe's "plink". In plink you click your mouse to play notes whose pitch is proportional to your mouse height. I can see that the height is divided into multiple "stripes" so you don't have some kind…
s-ol
  • 1,674
  • 17
  • 28
1
vote
1 answer

Set 'nice' value to concrete processes, by default

I would like to set specific "nice" values to several processes in a laptop. For example, I would like the window manager to run at -10, and keep the default at 0. I know that "renice" can change the niceness of a processes, but this is…
1
vote
1 answer

what does the "nice priority" mean about iostat command's %nice

I googled the iostat command's man manual about the %nice. In the explanation of the value of %nice there is a phrase about nice priority. I can not understand the meaning about it, can someone explain it? The complete comment in the man page is as…
andy
  • 3,951
  • 9
  • 29
  • 40
1
vote
1 answer

htacces and the nice urls

I have this link formats on my webpage: https://mypage.com/index2.php?page=registration https://mypage.com/index2.php?page=food&category=1 The first type is replaced as this: https://mypage.com/registration (works well) And I would like to format…
Mitulát báti
  • 2,086
  • 5
  • 23
  • 37
1
vote
2 answers

A shell script for timing my program measures it at 0 seconds

My professor wrote this shell script to time my program, and display the results. For some reason it just outputs 0s with my program. He provided the following files: timeit.csh sequence ecoli2500.txt ecoli3000.txt ecoli5000.txt …
Kent
1
vote
1 answer

Nice and Renice commands

I am interested in knowing what are the kernel side methods that get called when you issue the nice and renice commands? I found the set_user_nice() in the kernel side. However it's arguments are not pid and nice value, which we use when we issue…
user340
  • 375
  • 12
  • 28
1
vote
1 answer

Changing resolution mid-video with FFMPEG

I have a source video (mpeg2video) which I'm transcoding to x264. The source contains 2 different programs recorded from TV. One is in 4:3 AR and the other 16:9 AR. When I play the source file through VLC the player correctly changes size to show…
kingrolo
  • 2,857
  • 2
  • 16
  • 11
1
vote
1 answer

long running CPU intensive python script sent to sleep by scheduler

I have written a data munging script that is very CPU intensive. It has been running for a few days now, but now (thanks to trace messages sent to the console), I can see that it is not working (actually, has not been working for the last 10 hours…
johnsmith
  • 131
  • 1
  • 3
  • 8