How to Enable and Set scaling_max_freq on Linux

Managing your CPU speed can help your Linux system run faster or save battery life. One important setting to achieve this is scaling_max_freq, which lets you control the maximum speed your CPU can reach. In this guide, we’ll walk you through how to enable and set scaling_max_freq step-by-step.
After applying these changes, you will be able to control the CPU’s frequency, control performance, and power, and configure the setting that is giving you control over your CPU’s frequency scaling.
A Guide to Enable and Set scaling_max_freq on Linux
Computer’s CPU can operate at varying speeds, this is known as CPU performance scaling in Linux, the purpose is to optimize power while maintaining suitable performance.
●Use cpupower to enable scaling_max_freq
If you are trying to enable and set scaling_max_freq, you can use cpupower or directly modify the scaling_max_freq file, make sure you have the needed permissions.
Step 1: Check Your Current CPU Speed
You need to use the command below to get information about the CPU’s current speed and also how it is getting managed.
sudo cpupower frequency-info
Step 2: Set the Highest Speed
By applying these changes, we will set the maximum speed your CPU can reach.
sudo cpupower frequency-set -u <frequency_in_MHz>
You have to replace the “<frequency_in_MHz>” with the frequency you want to set your CPU.
Step 3: Set the Lowest Speed
This step allows you to set the bare minimum speed that your pc can run at.
sudo cpupower frequency-set -d <frequency_in_MHz>
Step 4: Set Fixed Speed
In some cases, you might prefer your CPU to maintain a constant speed for consistent performance. To achieve this, you can use the following command.
sudo cpupower frequency-set -f <frequency_in_MHz>
●Use sysfs to enable scaling_max_freq
Step 1: Find the CPU Speed File
All of the CPU speed settings are stored in a special file, and this step will help you find your files.
/sys/devices/system/cpu/cpufreq/policy0/scaling_max_freq
Step 2: Change the speed limit
In this step, we will directly change the speed limit in that file.
echo <governor_name> | sudo tee /sys/devices/system/cpu/cpufreq/policy0/scaling_governor
Step: Check CPU Speed
If you want to check what method your computer is using to change the CPU’s speed, use the command below.
echo <governor_name> | sudo tee /sys/devices/system/cpu/cpufreq/policy0/scaling_governor
By following one of the two methods, you will be able to Enable and Set scaling_max_freq on Linux.
Control Level Tools
i7z: This tool gives you details about your Intel CPU(like i5, i7, etc.), and this information will be displayed in a text window or a graphical window.
turbostat: By this table, you can see how fast your Intel or AMD CPU is running, how much power it’s using, and other information that might be useful for you.
cpupower: cpupower is a set of tools that lets you change how your CPU’s speed is managed, it is basically like a control panel for the speed of the CPU, we recommend installing this tool.
thermald: its job is to make sure your computer’s Intel CPU doesn’t get too hot, it adjusts the CPU’s speed to keep it cool.
power_profiles_daemon: You can switch between power saver and performance modes by this tool, it is basically like choosing how much power we want our computer to use, some powerful desktops have graphical interfaces to control this.
tuned: This tool is not for regular users, it is more an advanced tool that can tune many parts of your computer’s performance.
Managing CPU settings like scaling_max_freq is even more important when working on servers. If you’re looking for a flexible environment, our Linux VPS services are a great place to start.
Conclusion
By learning how to manage the scaling_max_freq setting, you can fine-tune your Linux system’s performance and energy efficiency based on your needs.
Whether you choose to use cpupower for quick adjustments or directly modify system files through sysfs, both methods give you the flexibility to optimize your CPU behavior.
Additionally, exploring tools like i7z, turbostat, thermald, and power_profiles_daemon can help you monitor and enhance your system’s performance even further.
For more in-depth Linux tutorials and optimization tips, be sure to visit our website regularly.
If you want to dive deeper into Linux CPU scaling techniques, the Red Hat Performance Tuning Guide is an excellent resource.
You might like it
Linux Tutorials
How to Install Desktop Sharing in Ubuntu - GUI on Ubuntu
Linux Tutorials
How to Disable Unlock Login Keyring in Linux Mint
Ubuntu Tutorials
How to Install and Use TermKit on Ubuntu