Apply a tuned profile to align system behavior with workload goals, then reduce CPU scheduling pressure by adjusting process priorities with nice and renice. Verify the active profile and confirm your priority changes took effect on running processes.
A host is being repurposed to handle a heavier workload. Your job is to apply a tuned profile appropriate for throughput and then reduce the impact of noisy background CPU jobs by controlling process priorities. You will verify tuned state, start test workloads, and use nice and renice to adjust scheduling priority safely.
tuned changes system behavior at a profile level. nice and renice are per-process controls and will not fix a broken workload, but they can keep low-value jobs from competing with critical services.
# Debian/Ubuntu
sudo apt install tuned -y
# RHEL/Fedora
sudo dnf install tuned -y
# Arch (if available in your repo set)
sudo pacman -S tuned
tuned is most common in RHEL-family environments, but the workflow is the same: install it, start it, then manage profiles.
# Expected pattern:
Package installs successfully (or reports already installed).
sudo systemctl enable --now tuned
This starts profile enforcement and ensures tuned starts on boot.
# Expected pattern:
Active: active (running)
tuned-adm list
Look for profiles like
balanced
,
powersave
,
throughput-performance
, and other workload-specific options depending on distro and version.
sudo tuned-adm profile throughput-performance
This is a common server profile that favors throughput over power savings. Always verify the active profile after changing it.
# Expected pattern:
Profile set to throughput-performance
tuned-adm active
Treat this as a verification step before you start process-level tuning.
# Expected pattern:
Current active profile: throughput-performance
yes > /dev/null &
This creates predictable CPU load so you can see how priority changes behave.
# Expected pattern:
Job starts in the background and returns a PID.
nice -n 10 yes > /dev/null &
Higher nice means lower scheduling priority. This is a clean way to ensure a background job competes less aggressively for CPU.
# Expected pattern:
Job starts in the background and returns a PID.
# list PIDs for the test workload
pgrep yes
# verify NI values (NI column shows nice)
ps -o pid,ni,cmd -C yes
You should see one process with NI 0 and one process with NI 10. If you started more than two, stop them and repeat the test with one at a time.
# Expected pattern:
PID NI CMD
1234 0 yes
5678 10 yes
# Example: lower the priority of PID 1234 by increasing nice
sudo renice 15 -p 1234
# Verify the change
ps -o pid,ni,cmd -p 1234
In practice, increasing nice values is the safer move for background jobs. Decreasing nice values requires elevated privileges and should be used sparingly.
# Expected pattern:
1234 (process ID) old priority 0, new priority 15
# lab cleanup options
killall yes
# OR
pkill yes
Clean shutdown of test noise matters, especially if you repeat labs frequently.
tuned may be installed but not started, or you installed a package set that
does not include the CLI tooling. Confirm with
rpm -q tuned
or
dpkg -l tuned
and re-check
systemctl status tuned
.
Some distros ship different profile sets or names. Use
tuned-adm list
and choose the closest match to your intent instead of guessing.
If you see more than two
yes
processes, your earlier runs are still active. Kill them, then repeat the test
so you can compare two processes cleanly.
Increasing nice values is usually allowed for your own processes, but lowering
nice values requires elevated privileges. Use
sudo
and prefer increasing nice for background workloads.
Stop test workloads and optionally return to a default tuned profile if this host is not intended to run with the throughput profile.
# stop the lab load
pkill yes
# optional: switch back to a general profile
sudo tuned-adm profile balanced
# verify
tuned-adm active
tuned-adm
: Profile management CLI for tuned.
list
: Show available profiles and selection.
profile <name>
: Apply a profile.
active
: Show the active profile.
systemctl
: Service control for enabling tuned.
enable --now tuned
: Enable on boot and start immediately.
status tuned
: Check service state.
nice
: Start a process with a specific nice value.
-n <N>
: Set nice value (higher means lower priority).
renice
: Change nice value of a running process.
-p <PID>
: Target a specific process ID.
ps
: Inspect process attributes including NI.
-o pid,ni,cmd
: Show PID, nice value, and command line.
-C <name>
: Select by command name.
pgrep
: Find PIDs by process name.
pkill
: Stop processes by name (use carefully).
killall
: Stop processes by name (use carefully).