RHCSA Rapid Track
Apply a specific tuning profile and adjust the scheduling priority of an existing process with high CPU usage.
Outcomes
Activate a specific tuning profile for a computer system.
Adjust the CPU scheduling priority of a process.
As the student user on the workstation machine, use the lab command to prepare your system for this exercise.
This command prepares your environment and ensures that all required resources are available.
[student@workstation ~]$ lab start tuning-review
Important
This lab uses commands that perform an endless checksum on a device file and intentionally use significant CPU resources.
Instructions
Change the current tuning profile for the
serverbmachine to thebalancedprofile, a general non-specialized tuned profile. List the information for thebalancedtuning profile when it is the current tuning profile.Log in to the
serverbmachine as thestudentuser.[student@workstation ~]$
ssh student@serverb...output omitted... [student@serverb ~]$Verify that the
tunedpackage is installed.[student@serverb ~]$
dnf list tuned...output omitted... Installed Packagestuned.noarch2.18.0-1.el9 @SystemVerify the
tunedservice state.[student@serverb ~]$
systemctl is-active tunedactiveList 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: - accelerator-performance - Throughput performance based tuning with disabled higher latency STOP states - balanced - General non-specialized tuned profile - desktop - Optimize for the desktop use-case - hpc-compute - Optimize for HPC compute workloads - intel-sst - Configure for Intel Speed Select Base Frequency - 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 - optimize-serial-console - Optimize for serial console use. - 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-guestChange the current active tuning profile to the
balancedprofile.[student@serverb ~]$
sudo tuned-adm profile balancedList summary information of the current active tuned profile. Verify that the active profile is the
balancedprofile.[student@serverb ~]$
sudo tuned-adm profile_infoProfile name:balancedProfile summary:General non-specialized tuned profile...output omitted...
Two processes on
serverbare consuming a high percentage of CPU usage. Adjust each process'snicelevel to 10 to allow more CPU time for other processes.Determine the top two CPU consumers on the
serverbmachine. Thepscommand lists the top CPU consumers at the bottom of the output. CPU percentage values might vary on your machine.[student@serverb ~]$
ps aux --sort=pcpuUSERPID%CPU%MEM VSZ RSS TTY STAT START TIMECOMMAND...output omitted... root107998.50.1 225340 2300 ? RN 06:25 4:29sha1sum /dev/zeroroot109599.00.1 225340 2232 ? R< 06:25 4:30md5sum /dev/zeroIdentify the current
nicelevel for each of the top two CPU consumers.[student@serverb ~]$
ps -o pid,pcpu,nice,comm \$(pgrep sha1sum;pgrep md5sum)PID %CPUNICOMMAND 1079 98.82sha1sum 1095 99.1-2md5sumAdjust the
nicelevel for each process to10. Use the correct PID values for your processes from the previous command output.[student@serverb ~]$
sudo renice -n 10[sudo] password for student:10791095student1079 (process ID) old priority 2, new priority 10 1095 (process ID) old priority -2, new priority 10Verify that the current
nicelevel for each process is 10.[student@serverb ~]$
ps -o pid,pcpu,nice,comm \$(pgrep sha1sum;pgrep md5sum)PID %CPUNICOMMAND 1079 98.910sha1sum 1095 99.210md5sumReturn to the
workstationmachine as thestudentuser.[student@serverb ~]$
exitlogout Connection to serverb closed. [student@workstation ~]$Important
Verify that you have terminated all lab processes before leaving this lab.