Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I ran a jar file in Linux and it is running from last 3 days.

How can I change priority of that process? Will it speedup my application processing?

share|improve this question
3 days? Are you sure it still processing something? – coredump Jan 30 '11 at 4:08
I like to use the term niceness in the context of nice/renice tools. This is because there are also other aspects which affect how much CPU a process can get. For example see scheduling attributes and chrt. – halp Jan 30 '11 at 5:48
up vote 4 down vote accepted

How can I change priority of that process?

renice priority [-p] pid

Useful priorities are: 20 (the affected processes will run only when nothing else in the system wants to), 0 (the ``base'' scheduling priority), anything negative (to make things go very fast)

Example: renice -5 -p 123, 123 is process PID, -5 is priority

Will it speedup my application processing?

No, if load average less number of CPU core.

share|improve this answer
Thanks for your reply. There is no other process running on my computer. Will it make a big diff. to change priority? I checked my process priority and it is 0. What does it mean? – user62648 Jan 29 '11 at 20:56
The default priority will share equally among running processes. Nicing the process is usually used to allow other processes to run faster, slowing the niced process if other processes are running. Negative priorities require root privileges, and can halt all other processes. Avoid them for anything CPU intensive. – BillThor Jan 29 '11 at 21:13
The key to remember is that the number is how nice the process is to others. a big number means it is very nice. a negative number means it is not nice at all and won't let the other processes play. – DerfK Jan 29 '11 at 21:29

You can change priority with renice command. It will speed up processing only if there are other applications actively consuming CPU time.

share|improve this answer

By default process priority in Linux is 0. Process priority can have any number between -20 to 19. Process priority can be set by using nice and modified using renice. -20 is the highest priority process and 19 is the lowest priority.

Here you're having a process already running and you want to change its priority. So you can enter the following command

renice -5 pid

where pid is the process id of the process whose priority you want to modify. To increase the priority of a process i.e. to set the priority value to a negative value, you need to be root user or use sudo.

Hope that helps.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.