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
0
votes
0 answers

syscall nice() can't work with negative argument

I try to set my process have negative nice value ex: -20 with syscall nice(int inc) or setpriority(int which, id_t who, int prio) I check with ps command, it hasn't work even syscall not return an error. Only positive value accepted. With negative…
Hai
  • 73
  • 1
  • 10
0
votes
1 answer

Testing whether niceness is being properly applied

I am trying to prioritize certain processes over others. Here's the main script I'm using, mocking a CPU-intensive process: simple_app.py import os from multiprocessing import Pool, cpu_count def f(x): while True: x*x if __name__ ==…
blacksite
  • 12,086
  • 10
  • 64
  • 109
0
votes
1 answer

Measuring time of n processes

So I am up to measure time for n processes depending of their nice values. I fork the n processes from the parent process and all they have to do is to count a counter from 0 to X in an endless loop, each time printing the time that they needed for…
Nikolskyy
  • 51
  • 2
  • 7
0
votes
0 answers

Changing Android process's nice values

I understand that changing the nice value of any app can be done using the terminal with the "renice" function. My code to renice: renice -n However, it seems like the new nice value only stays for foreground applications. Once I…
0
votes
1 answer

Changing nice value of a process has no effect in Linux

I read about APUE 3rd, 8.16 Process Scheduling, there is an example written to verify that changing nice value of a process will affect its priority, I rewrite the code like below: #include #include #include #include…
cong
  • 1,105
  • 1
  • 12
  • 29
0
votes
1 answer

run bash script with nice results in error

I have a fairly long bash script. I want to run it with nice nice ./test1.scr if I do not run the script with nice, it works great. But when I run it with nice. commands being ran inside my script fail. commandout=() while IFS= read -r line # Read…
Tony Haynes
  • 69
  • 1
  • 7
0
votes
1 answer

Can I "nice" Cassandra nodetool repair

Will any issues arise if I deprioritize the Cassandra "nodetool repair" command using "nice" ? It causes high CPU "user time" load and is having a negative impact on our production systems, causing API timeouts on our Usergrid implementation. I see…
0
votes
1 answer

Htaccess doesn´t work - nice url

Hi guys i have problem with a htaccess. I want from this URL domain.com/index?article=28&title=velky-biel-karlova-ves (it doesn´t have index.php because i hide .php extension with htaccess. I wanna have this URL…
Forlis
  • 177
  • 2
  • 3
  • 12
0
votes
1 answer

setpriority impact on QProcess

I have a C++/Qt5 program that sets the priority of the process using setpriority(). That process launches several executable programs using QProcess. Will the programs launched by QProcess run at the NEW priority of the main process? Or does…
TSG
  • 4,242
  • 9
  • 61
  • 121
0
votes
1 answer

Giving a non-root user process capabilities to change its niceness

I have a Linux based process (written in C++, if it makes any difference), that I run from a user which is not root. In some point I have to run a new sub-process that should be able to change it's niceness level to a lower number (without changing…
Bar Harel
  • 35
  • 5
0
votes
2 answers

Change niceness of all processes by niceness

I am using Debian, is there a way to change the niceness of all running process based on their current niceness? For instance change all currently running processes that have a niceness of -20 or -19 to -10. Renice can change a process, and…
InvictusRex28
  • 73
  • 1
  • 10
0
votes
2 answers

Does using setpriority() have any affect if my scheduling policy is SCHED_OTHER

My scheduling policy is SCHED_OTHER. Will the change in in nice value using setpriority() have any affect. When I used it, I dint see any difference.
Banu Prakash
  • 111
  • 9
0
votes
1 answer

Logs extracting, limiting cpulimit

I have the following script for extraction of logs. Need to make work it with cpulimit, to not overload the server. Can anyone help? nice -20 zcat /var/detail-20150418.gz | sed '/./{H;$!d;};x;/46.241.178.96/!d' > /tmp/new.txt nice -20 sed -n…
user37033
  • 379
  • 1
  • 6
  • 18
0
votes
1 answer

How to nice Java processies running on Tomcat

I'm creating an Java application using a REST front-end, hence must be responsive, and once in a while (X minutes) another service is polling the internet. For this some hundreds of threads are spawned. Needless to say when hundreds of threads are…
Danielson
  • 2,605
  • 2
  • 28
  • 51
0
votes
2 answers

Why would os.nice(10) fail on OS X?

Why would os.nice(10) fail with OSError: [Errno 1] Operation not permitted on OS X? Running from a standard user account: $ python … >>> os.nice(10) Traceback (most recent call last): File "", line 1, in OSError: [Errno 1]…
David Wolever
  • 148,955
  • 89
  • 346
  • 502