

When you feed positive values with renice/ nice commands, for example - renice +10 PID, you're manually adding more virtual runtime to the process. The nice and renice utilities manipulate this virtual runtime. The operating system (OS) keeps a record of this virtual runtime and tries to give equal time to all processes in the run queue. The total time a process spends “on CPU” is the virtual runtime of the process. By the way, the CPU tends to act like a father and has a habit of dividing time equally among all children (the processes). The actual time for which the process is running on the CPU is called the virtual runtime of the process. You can also perform analysis to check that the tuning is effective and that the scheduler latency remains low for high-priority work.Įvery process is given a specified amount of time to run on the CPU. Your task is to identify low-priority work, which may include monitoring agents and scheduled backups, which you modify to start with a nice value. The nice value is still useful today for adjusting process priority. Positive nice values result in lower process priority ( nicer), and negative values-which can be set only by the superuser (root)-result in higher priority. Unix has always provided a nice() system call for adjusting process priority, which sets a nice-ness value.

This is perhaps the most common way known to improve application/process CPU usage.

So normally, you're not bothered about which CPU/core your application or process runs, as long as it runs. Modern systems typically have multiple CPUs and cores, which are shared among all running software by the kernel scheduler. CPUs run all applications and it's best if you understand how it works and how you can tune CPU usage to increase the performance of your applications.
