Is your computer freezing? Or have you noticed a loud noise emanating from your computer’s CPU fan? High CPU consumption in Linux can occur for a variety of reasons, but the most frequent one is a misbehaving app. Continue reading to find out how to reduce high CPU utilization in Linux.
1. Find the Culprit
Even the fastest processors can crash due to a problematic app. To locate the offending application, use the top in the Terminal or the System Monitor app.
Open a terminal, enter the top, and then close it.
By default, all processes are ranked from most CPU-hungry to least CPU-hungry based on their CPU consumption. You’ve identified the offending programme if it consistently occupies one of the top five positions with a CPU consumption rate much greater than the others.
2. Renice or Remove the App
Support for both renice and kill is included at the top. These tools can be used to interrupt a process forcibly or to adjust its priority.
The amount of CPU resources that an app is permitted to use in comparison to other active processes is referred to as its good priority. Nice takes values between +19 and -20. The priority decreases as the number increases.
Press R on top and type the PID of the problematic app. If altering it to a “+5” value doesn’t work, try again with “+10,” “+15,” and finally “+19,” which is the lowest priority.
Stop using the app as soon as it stops responding. The app will be deleted if you press k while on top, enter the PID, and click Enter.
3. Complete the update
The app may need to be updated if the issue keeps happening no matter how many times you run it.
Enter this in your terminal:
executing sudo apt update and sudo apt -y upgrade
Run the troublesome application once again after that.
4. Remove and Reinstall the App
If the issue isn’t resolved, there’s a potential that it will come back because of a misconfigured parameter in the application. It can be helpful to reset it to its initial state.
Before you remove the troublesome programme, make a backup of your configuration in case it wasn’t the root of the issue and you need to restore it later.
enter sudo apt purge APP NAME
apt autoremove with sudo
Install the app again:
apt update with sudo
The app will be restored to its initial form after this.
5. Revert to the Previous Version
You can go back to the previous version if upgrading the app didn’t fix the issue. Use an earlier version by trying to downgrade, at least until the app’s flaws have been fixed by the developer.
Check out the available versions by running your terminal and issuing: before you downgrade your app.
apt policy with sudo APP NAME
The version you are using right now will have three asterisks next to it. Keep an eye out for the alternative variations.
We advise you to purge the current version to get rid of any configuration-related issues before downgrading.
Install the previous version by using:
install APP NAME=VERSION with sudo apt
6. Use Alternative App
The benefit of Linux is the abundance of applications that can do the same function. You can and need to switch off an app whose high CPU utilization is bothering you.
For instance, LibreOffice Writer, which relies on numerous dependencies to function effectively, can be a demanding piece of software. Abiword is a fantastic alternative to this programme. Run the following command to install it in Ubuntu:
Installing abiword with sudo apt
7. Optimize Your System’s Power Settings
Making sure your computer can utilize all of its system resources is another easy repair for high CPU consumption in Linux. Modern laptops typically cap their maximum CPU frequency to preserve battery life, which makes them slower and more prone to CPU load peaks.
Your system settings menu contains the quickest method for optimizing your computer’s power settings. In Ubuntu, press Win and enter “settings” to accomplish this.
Fix Linux 09 Settings for High CPU Usage
From the window’s left sidebar, pick the “Power” category.
Linux 10 Highlight Power Section Fix High CPU Usage
To enable the system to allocate CPU resources automatically as needed, choose the “Balanced” option under the “Power Mode” section.
Fix Linux 11 Power Mode Setting for High CPU Usage
To ensure that Ubuntu will accurately apply your changed settings, restart your computer.
8. Install a Lightweight Desktop Environment
A better desktop environment can be installed in order to reduce excessive CPU use in Linux in addition to installing different applications and optimizing settings. LXQt is among the lightest environments for Linux.
LXQt’s creators, in contrast to GNOME and KDE, are committed to building a full desktop that uses the least amount of resources possible. Run the following command to install LXQt in Ubuntu:
To view all of your system’s available desktop environments, exit your current session and click the gear icon on the login screen. Click “LXQt” to access your account and log in.
Fix the Linux 13 Lxqt Login Screen High CPU Usage
9. Fix Core Apps Causing High CPU Usage
What happens if a core app like systemd or Xorg is using up all of your CPU power?
Try turning off auxiliary hardware on your computers, like joysticks and printers, to disable systemd.
If you’re using Ubuntu or another comparable distribution and the device is a joystick, mouse, or keyboard, you may see all of the connected devices by typing input in your terminal. Use: to make one of them inoperative.
xinput -d DEVICE ID disable
Fix Linux 14 Xinput Sample High CPU Usage
Replace disable with enable in the aforementioned command to re-enable the device.
The answer is a little trickier for other devices. To see all of the additional drivers your Linux kernel loads as modules, first type lsmod in your terminal and press Enter. Once you’ve located the one for the problematic device and written down its name, type the following:
/etc/modprobe.d/blacklist.conf: sudo nano
The list of modules that shouldn’t load at boot is contained in the document you just opened. There will likely be some entries in there already. To add your module to this list, move to the end of the file and use the same syntax. Your entry needs to resemble:
obstruct MODULE NAME
After you reboot and save the file, maybe everything will function properly.
Try turning off the compositor in your Window Manager for Xorg. Even though this is the official policy, there are times when the GPU handles CPU-related activities instead. Sometimes, activating compositing support also enables a lot of labor-intensive effects.
Occasionally, high CPU utilization can also be brought on by the GPU drivers. Specific AMD or Nvidia driver versions and Xorg don’t really get along. Upgrading or downgrading to a different version is the answer. As an alternative, you might want to try open-source drivers for your GPU. However, they don’t have the same precise feature set and might be lacking in some capabilities.
10. Swap Your Kernel
It is uncommon for the Linux kernel to be the cause of significant CPU usage. However, if you’ve come to this point without finding a solution, it won’t hurt to attempt a new approach.
According to its official website, open your terminal and use the following command to install the well-known Liquorix kernel on Ubuntu:
Add-apt-repository ppa:damentz/liquorix with sudo and Doing sudo apt-get update
Install the Linux 15 Liquorix Repo to Fix High CPU Usage
This will increase Ubuntu’s sources with its repository. Use: to load the kernel directly.
install linux-image-liquorix-amd64 with sudo linux-headers-liquorix-amd64
If you reboot after installing the new kernel, your CPU usage should return to normal.
Frequently Asked Questions
Is It Possible to Set My System’s Power Consumption to “high Performance” in Linux?
Yes! Linux can benefit from its execution being temporarily halted in order to address high CPU utilization. When you suspend a programme, as opposed to re-enabling it, the resources it is now utilizing are immediately released.
Run kill -STOP followed by the PID of your programme to accomplish this. Run kill -CONT to resume your programme once you have the necessary resources.
Is It Possible to Set My System’s Power Consumption to “high Performance” in Linux?
Yes! However, you must use the command echo performance | sudo tee /sys/devices/system/cpu/cpu/cpufreq/scaling governor to change the frequency scaling policy for your CPU. This will make the system use its CPU in a more aggressive manner, but on a laptop, it may sharply shorten the battery life. Use echo powersave | sudo tee /sys/devices/system/cpu/cpu/cpufreq/scaling governor to quickly return to a more conservative state.
Is It Possible to Reinstall My Graphics Drivers in Ubuntu Wayland?
A sad no. It is not possible to modify your graphics drivers without setting and recompiling your own kernel because the Wayland display server by default only uses the integrated graphics drivers for your graphics card in the kernel.
For More Information Visit Our Site: https://www.techllog.com/