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
2
votes
5 answers

How do I make php nicer to the CPU?

I'm running on a shared *NIX server (run by Site5). I have a php script that runs in the background occasionally doing some offline calculations. It uses around 100% CPU while it runs. I've tried nice-ing it, like this: nice -n 19 php…
Ben
  • 66,838
  • 37
  • 84
  • 108
2
votes
1 answer

How to have all Jenkins slave tasks executed with nice?

We have a number of Jenkins jobs which may get executed over Jenkins slaves. Is it possible to globally set the nice level of Jenkins tasks to make sure that all Jenkins tasks get executed with a higher nice level?
Spacemoose
  • 3,856
  • 1
  • 27
  • 48
2
votes
1 answer

How to reduce CPU usage in Windows?

If I use import os os.nice(10) The error is AttributeError: 'module' object has no attribute 'nice' nice is probably only for Linux systems, so how do I reduce the CPU resources available to my program? It checks whether a particular process is…
anukul
  • 1,922
  • 1
  • 19
  • 37
2
votes
2 answers

How could I set up a 'nice' Capistrano deployment?

How could I setup a nice indice on cap:deploy? I want the remote server to nice the cp commands like so: nice -n 19 cp ...
joserwan
2
votes
1 answer

htaccess two variables two landing pages

i have already implemented and working the following: http://domain.com/collections/ford from the following url: http://domain.com/collections.php?brand=ford using the RewriteRule ^collections/$1/(.*)$ collections.php?company=$1 [L] This works…
TharsDimitris
  • 154
  • 10
2
votes
6 answers

How to get a command line process to use less processing power

I am wondering how to get a process run at the command line to use less processing power. The problem I'm having is the the process is basically taking over the CPU and taking MySQL and the rest of the server with it. Everything is becoming very…
Darryl Hein
  • 142,451
  • 95
  • 218
  • 261
2
votes
1 answer

How to proper set a limit to process's priority with libc?

I'm using setrlimit to put a limit to the niceness of my program when it runs like a proccess, but it's not working. int main() { struct rlimit limit; getrlimit(RLIMIT_NICE, &limit); limit.rlim_max = 30; limit.rlim_cur = 15; …
Danilo
  • 125
  • 3
2
votes
2 answers

Maximum nice value for os.nice()

I know that os.nice(20) sets the maximum nice level on linux. But I don't know the value of other unixes (I don't care about MS-Win). Is there somewhere a symbolic value for the maximal nice value which I can use from python? Prefered…
guettli
  • 25,042
  • 81
  • 346
  • 663
2
votes
1 answer

How is nice cpu percentage calculated, e.g. in top?

My research group is sharing time on a CentOS server, and we've been using renice +15 to try to lower the priority of long-running background tasks. When running top, these processes do show up as having a nice value of 15, but the "%ni" measure of…
Chris
  • 121
  • 3
1
vote
1 answer

Does Linux IOnice affect /dev/ nodes?

I've written virtual input drivers for Linux, and a server that communicates with them via /dev nodes. Now, one of them is a virtual mouse and it's quite important that what the signal server receives gets to the driver as soon as possible for the…
1
vote
0 answers

EPERM error in changing nice value of a process through setpriority()

I'm trying to change the nice value through a publicly available code but I'm getting a Permission Denied (EPERM) message. The program fails when executed either as a normal user or with sudo. #include #include #include…
1
vote
2 answers

‘Nice-ness’ of a process inside a container

So in my current app setting a certain process running inside a container runs another process. I need to set the nice value of the new process to be higher. When ran on the OS I could just do nice -n19 second_task. How does this work in the context…
1
vote
1 answer

/usr/bin/nice -n -19: No such file or directory but nice exists

I have a small function in a bash script like this, func() { local nice_val="$NICE -n -19" /* bunch of if/else statements and some loops*/ $nice_val $NOHUP a.out >> $log_file 2>&1 & } when i try to execute this file, i…
noterudite
  • 37
  • 4
1
vote
1 answer

To renice the process paused with Control-Z

I want to renice the process that I just stopped using Control-Z without looking through the output of top or ps. I know you can resume a process, or a job in terms of Bash to be precise, like bg 1 for example. But can you do something like that for…
exebook
  • 32,014
  • 33
  • 141
  • 226
1
vote
1 answer

How do I nice a for loop on the bash command line?

Help please. I can't figure out the syntax to nice a for loop on the command line. This is my best guess: $ nice -n 17 { for _ in {1..2}; do echo howdy; done; } bash: syntax error near unexpected token `do' But obviously, that's not correct.
timmer
  • 263
  • 1
  • 3
  • 9