Process Scheduling Flashcards
What command is used to influence process scheduling
nice
How many possible nice values are there
40 values from -20 to 19
Highest priority nice value
-20
Lowest priority nice value
19
What nice values can user set
0 to 19, the lowest
Determine how many cpus are on the hosts
lscpu -p
Write a command to consume cpu cycles
dd if=/dev/zero of=/dev/null
Default nice value
0
How do you change the nice value of a process?
You renice it. Example: renice 8 7464
set the niceness of the process with PID 1234 to 10.
renice 10 1234
renice -n -15 3434
Start a process with a given priority
nice -n -4 dd if=/dev/zero of=/dev/null
Wrong way to modify systemd values
do it in /usr/lib/systemd/system
DO NOT DO THIS
Right way to modify systemd values
Copy config file from /usr/lib/systemd/system to /etc/systemd/system and modify the copy
Using grep find how many cpus you have
grep -c '^processor' /proc/cpuinfo
Determine the nice value of a process
ps -o pid,nice,cmd -p [PID]