Performance Checklist
In this lab, you will apply a specific tuning profile and adjust the scheduling priority of an existing process with high CPU usage.
Outcomes
You should be able to:
Activate a specific tuning profile for a computer system.
Adjust the CPU scheduling priority of a process.
Log in as the student user on workstation using student as the password.
From workstation, run the lab tuning-review start command.
The command runs a start script to determine whether the serverb host is reachable on the network.
[student@workstation ~]$lab tuning-review start
Change the current tuning profile for serverb to balanced, a general non-specialized tuned profile.
From workstation, open an SSH session to serverb as student user.
The systems are configured to use SSH keys for authentication, so a password is not required.
[student@workstation ~]$ssh student@serverb...output omitted...[student@serverb ~]$
Use yum to confirm that the tuned package is installed.
[student@serverb ~]$yum list tuned...output omitted... Installed Packagestuned.noarch2.10.0-15.el8 @anaconda
Use the systemctl is-active tuned command to display the tuned service state.
[student@serverb ~]$systemctl is-active tunedactive
List all available tuning profiles and their descriptions.
Note that the current active profile is virtual-guest.
[student@serverb ~]$sudo tuned-adm list[sudo] password for student:studentAvailable profiles: - balanced - General non-specialized tuned profile - desktop - Optimize for the desktop use-case - latency-performance - Optimize for deterministic performance at the cost of increased power consumption - network-latency - Optimize for deterministic performance at the cost of increased power consumption, focused on low latency network performance - network-throughput - Optimize for streaming network throughput, generally only necessary on older CPUs or 40G+ networks - powersave - Optimize for low power consumption - throughput-performance - Broadly applicable tuning that provides excellent performance across a variety of common server workloads - virtual-guest - Optimize for running inside a virtual guest - virtual-host - Optimize for running KVM guests Current active profile:virtual-guest
Change the current active tuning profile to the balanced profile.
[student@serverb ~]$sudo tuned-adm profile balanced
List summary information of the current active tuned profile.
Use the tuned-adm profile_info command to confirm that the active profile is the balanced profile.
[student@serverb ~]$sudo tuned-adm profile_infoProfile name:balancedProfile summary:General non-specialized tuned profile...output omitted...
Two processes on serverb are consuming a high percentage of CPU usage.
Adjust each process's nice level to 10 to allow more CPU time for other processes.
Determine the top two CPU consumers on serverb.
The top CPU consumers are listed last in the command output.
CPU percentage values will vary.
[student@serverb ~]$ps aux --sort=pcpuUSER PID%CPU%MEM VSZ RSS TTY STAT START TIME COMMAND ...output omitted... root 29831000.0 228360 1744 ? R< 21:08 0:23md5sum /dev/zeroroot 29671010.0 228360 1732 ? RN 21:08 0:23sha1sum /dev/zero[student@serverb ~]$
Identify the current nice level for each of the top two CPU consumers.
[student@serverb ~]$ps -o pid,pcpu,nice,comm \$(pgrep sha1sum;pgrep md5sum)PID %CPUNICOMMAND 2967 99.62sha1sum 2983 99.7-2md5sum
Use the sudo renice -n 10 2967 2983 command to adjust the nice level for each process to 10.
Use PID values identified in the previous command output.
[student@serverb ~]$sudo renice -n 1029672983[sudo] password for student:student2967 (process ID) old priority 2, new priority 10 2983 (process ID) old priority -2, new priority 10
Verify that the current nice level for each process is 10.
[student@serverb ~]$ps -o pid,pcpu,nice,comm \$(pgrep sha1sum;pgrep md5sum)PID %CPUNICOMMAND 2967 99.610sha1sum 2983 99.710md5sum
Exit from serverb.
[student@serverb ~]$exitlogout Connection to serverb closed. [student@workstation ~]$