Most distributions come with a handy tool called powertop, that is able to automatically set kernel parameters to save energy.
sudo powertop --auto-tune
Settings are not permanent, to you can use the following snippet to create and load a systemd unit file to load the settings after rebooting your machine:
cat << EOF | sudo tee /etc/systemd/system/powertop.service [Unit] Description=PowerTOP auto tune [Service] Type=idle Environment="TERM=dumb" ExecStart=/usr/sbin/powertop --auto-tune [Install] WantedBy=multi-user.target EOF systemctl daemon-reload systemctl enable powertop.service systemctl start powertop.service
Thanks for providing a hint how to write the systemd configuration. Fedora ships it out of the box, but Ubuntu doesn’t…