"How To Speed Up Ubuntu 24.04 LTS In 2024 – Step-by-Step Guide"

Published: 27 June 2024
on channel: Intelligent Gaming
10,980
143

In this video, I cover how to speed up the performance of Ubuntu 24.04 LTS by changing the default ondemand CPU governor to performance.

To achieve this, I will be using a built-in utility called cpufrequtils which can be easily installed using a package manager.

Step 1. Install cpufrequtils.

First, open a Terminal window, and run the following command.

sudo apt-get install cpufrequtils

At this point, the application will be installed.

Step 2. Change CPU Governor To Performance.

Next, to change the CPU governor to performance, run the following Terminal command.

for cpu in /sys/devices/system/cpu/cpu[0-9]*; do
sudo cpufreq-set -c "${cpu##*/cpu}" -g performance
done

This will apply immediately to all CPU cores, however, will not persist on a reboot, so to resolve this, we can create a small script to apply the above at boot.

Step 3. Apply Performance CPU Governor At Boot.

First, create a new systemd service file with the below command.

sudo nano /etc/systemd/system/set-cpufreq.service

This will open in nano, a command line-based text editor, so inside the file, insert the following.

[Unit]
Description=Set CPU governor to performance
After=multi-user.target

[Service]
Type=oneshot
ExecStart=/usr/bin/set-cpufreq.sh
RemainAfterExit=true

[Install]
WantedBy=multi-user.target

This will tell the service file to run the script once at boot for all users, save the file once done.

Next, we need to create the startup script, which can be done with the following command.

sudo nano /usr/bin/set-cpufreq.sh

Inside the content of the script, type the command from earlier that sets all CPU cores to use the Performance governor.

#!/bin/bash
for cpu in /sys/devices/system/cpu/cpu[0-9]*; do
cpufreq-set -c "${cpu##*/cpu}" -g performance
done

Again, save the file.

Now, we need to make the script executable, which can be done with the following command.

sudo chmod +x /usr/bin/set-cpufreq.sh

Finally, we need to reload the Systemd manager configuration, and then set the new service to start at boot, which can be done by running the next two commands in sequence.

sudo systemctl daemon-reload

sudo systemctl enable set-cpufreq.service

At this stage, restart the system, and now the performance CPU governor will be applied at boot.

All done.

#linux #cpu #ubuntu

Social Media Links

Discord -   / discord  

Reddit -   / intelligentgaming2020  


Watch video "How To Speed Up Ubuntu 24.04 LTS In 2024 – Step-by-Step Guide" online without registration, duration hours minute second in high quality. This video was added by user Intelligent Gaming 27 June 2024, don't forget to share it with your friends and acquaintances, it has been viewed on our site 10,980 once and liked it 143 people.