[How-to] Increasing performance by changing CPU governor and reducing swappiness

Yeh, warnings at the start of the doc should be worth a start, with some information about the defaults etc?

1 Like

I do have information about the defaults in AMD Ryzen and Intel Core CPUs (the ones equipped in laptops, that are) but other CPUs might need some more survey.

My 2 cents:

Increasing GNOME performance by changing CPU governor

If Gnome does not perform well on someone’s hardware, it may be clever to switch to a lightweight DE (Fedora offers a few to choose from) or upgrade the hardware.

Modifying CPU governors in order to be able to smooth the Gnome experience does not seem to be sustainable to me. Personally, I would not recommend that to anyone.

3 Likes

Does the equation/recommendation for swapiness change now that Fedora 33 no longer creating a swap partition and is using swap-on-zram per default?

3 Likes

It does follow the same newer installations like you mentioned but folks updating from F32 are likely to have it. That might help them. :smile:

I agree to some extent @florian.

But then again, it is not an insufficient hardware specification scenario but more about hardware holding back from what it could potentially perform. The availability of those governors on a specific CPU means that they had been intended for a use by the CPU makers. Defaults are workable but they are definitely not the best ones to go on with.

I would beg to differ here. A multitude of CPU governors are present for a reason so as to make sure that users can switch between them (preferably automatically) to address specific requirements. For instance, on lower loads - battery saving can be a requirement, hence switching to powersave CPU governor would be viable and on greater loads - consistent performance is a requirement and hence switching to performance CPU governor can help.

What I would not suggest is to keep the CPU pinned to a specific governor. It would definitely not harm the CPU per se (the CPU governor would not have been there if it did) but can cause reduced battery life.

1 Like

I think for the most users here(this forum) is CPU and kernel tuning the wrong subject to get an entry under Fedora QuickDocs. When somebody want to do it, he/she should make his own fork of Fedora and there will be a huge play-ground for tuning of everything and all. The kernel developer are high-qualified professionals and they know how do the things right, a normal user can’t do it and will get a ticket to the "hell.

1 Like

The only part that is significally related to GNOME is the gnome-shell extension for the cpu profile. I would suggest you change the tittle of the article, or the wiki, so users that dont really understand the OS knows that hardware policies and tweaks works for EVERY Windows Manager or Desktop Enviroment, not just GNOME.

I dont use GNOME and have every one of those configs setup. Bugs me a little this kind of GNOME PERFOMANCE GUIDE that dont touch in any config from GNOME.

2 Likes

I guess that comes from @t0xic0der 's experience with GNOME being laggy, but yes, none of these tweaks are GNOME specific. That’s also why I’m wary of documenting these. I still think most users don’t need to tinker with these, and ones that need to will be advanced enough to look at the kernel etc. documentation.

2 Likes

I agree that the settings specified here don’t exactly change stuff related to GNOME but as a consequence of the changes made there, I have come to experience a lot more fluidic and smoother experience in an already consistent looking desktop environment. (Spoiler Alert - I used Fedora Workstation 33 as the reference subject for this guide)

But then again, lets ask ourselves - if at all folks would require such tweaks on other desktop environments. The last time I checked GNOME is the one with the knack of using more memory and CPU for a better user experience while the same are provided by other desktop environments in (say) a much reasonable usage.

So even though the guide can be literally used by anyone irrespective of them having the GNOME desktop environment or not, it is the usefulness which adds a doubt to whether there should be a change in the article name or not. I can list some usecases where it can be very helpful outside of the GNOME speeding thing.

  1. PyCharm and other IntelliJ-based IDEs could load up way faster when using these settings.
  2. Applications are likely to start up sooner when using these settings.

What do you think @hernane?

Idk. I still dont agree why something thats not related to GNOME should be name “GNOME Optimization”.

I do agree those changes are very helpful, and users that notice some kind of degradation on speed and responsiveness (mainly from versions of Fedora) should try to make those tweaks.

And as a KDE user (and tester from all others), i would say Gnome is the only OPTIMIZED environment for Fedora. KDE, Cinnamon, XFCE, Deepin, and all others come with old and outdated versions and strange default configs. Like the same default-configs from Fedora 29, broken fonts, missing services and so on.

When you propose a guide for Desktop Optimization and you ask to name it “Gnome Optimization” i just see the perpetuation of a focus on GNOME from the Fedora Community that hurts the project, in my humble opinion. We should try to improve the project as a whole, give it more options, speediness, security, stability, powerful and detailed guides teaching users how to tweak the kernel, the IO scheduler, the filesystems, the mount options, the swappiness, the modules features and secondary options, and so on. Tweaking the Desktop Environment should be an item too in these guides. But they are not at all the same things and so should not be name as the same thing.

( And as i personal note on Gnome project: )

Gnome is a very CLOSED environment for tweaking, in my opinion. All the major improvements and tweaks nowadays are made by community plugins, ad-dons and extensions. Some that Gnome’s even tried to block in early versions. Why not make a guide of the BEST extensions that allows users to access those tweaks like CPU governor or thermal-profile. I know i used then a lot, and they were very stable and powerful.

2 Likes

I agree that the docs are general enough. I’ve removed “Gnome” from the topic.

1 Like

Agreed. Though my experiences are restricted due to runs done on Workstation 33, the inferences of those experiences should not be.

Very true. I found GNOME to have become very responsive and not just that but every other application started up quick and had this feeling of snappiness all around. Like you said, I would definitely suggest such configurations for other desktop environments as well as that seemingly has proven to be helpful.

My experiences as to how the changes I made resulted in the consequences have been specifically limited to GNOME as I have mentioned before. It can be generalized (like @FranciscoD did) for every other environment for the better of the community. Of course, adding tips as to how desktop environments - then goes out of the picture due to the generalization.

We are on the same page here. There can be a guide for the best extensions but I’d suggest that maybe you would want to create a new topic for it for the pertaining one deals specifically with switching CPU governors and reducing swappiness.

1 Like

Hey @FranciscoD @vgaetera @rurban @Mershl @augenauf @heliosstyx @hernane,

I have written this small CLI application in Go to help switch between governors at ease.

Take a look at it GitHub - t0xic0der/switcheroo: An easy-to-use CPU governor switcher - Run things fast or save some juice!.

I might just package this in a COPR in near future but feel free to use to executable binaries present at the release section till that time, should you need it. :grinning_face_with_smiling_eyes:

Wish you a very happy new 2021!

3 Likes

This issue is investigated over here Issue #212: Switching default CPU governor to a more powerful one - fedora-workstation - Pagure.io. Interested folks would want to take a look at this.

1 Like