OPERATING SYSTEMSOS Linux

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

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 – https://discord.gg/3SxGk3WG2D

Reddit – https://www.reddit.com/r/IntelligentGaming2020/

source

ubuntu

5 thoughts on “"How To Speed Up Ubuntu 24.04 LTS In 2024 – Step-by-Step Guide"

  • Don't forget to like and share this video, as well as subscribe to the channel as this helps me with the YouTube algorithm.

  • Isn't this just the same if you select Performance Power Settings?

  • Thanks for the video. Question: Is this really necessary? If I understand it correctly, this makes your CPU boost all the time, which increases power consumption, correct?
    Is there a performance difference in loads like gaming between using On Demand and Performance governor?

Comments are closed.