autoperf is a lightweight daemon that automatically adjusts CPU performance bias based on system load, temperature, and power status. It helps optimize the balance between performance and power consumption on Linux systems.
- Dynamic CPU performance bias adjustment
- Monitoring of:
- Pressure Stall Information (
/proc/pressure/cpu) - CPU load
- CPU temperature
- AC power status
- Pressure Stall Information (
- Configurable thresholds and intervals
- Systemd service integration
- Go 1.x
- Linux system with supported CPU
- Root privileges (for accessing system files and making performance adjustments)
go build -ldflags "-s -w"- Copy the binary to system path:
sudo cp autoperf /usr/bin/- Create configuration directory and copy config file:
sudo cp autoperf.conf /etc/autoperf.conf- Install systemd service:
sudo cp systemd/autoperf.service /etc/systemd/system/
sudo systemctl daemon-reload
sudo systemctl enable autoperf
sudo systemctl start autoperfThe configuration file is located at /etc/autoperf.conf.
Here's the default configuration:
[General]
Enabled=true
SysfsPowerPath="/sys/class/power_supply/AC*/online"
LogFile="/var/log/autoperf.log"
Metrics="PSI" # PSI or Load
Verbose=true
[Battery]
WaitBetweenUpdates=3000
CPULoadSampleInterval=10
PSILowThreshold=4.0
PSIMediumThreshold=7.0
PSIHighThreshold=10.0
LoadLowThreshold=30
LoadMediumThreshold=50
LoadHighThreshold=80
HighTempThreshold=75
[AC]
WaitBetweenUpdates=5
CPULoadSampleInterval=10
PSILowThreshold=4.0
PSIMediumThreshold=7.0
PSIHighThreshold=10.0
LoadLowThreshold=25
LoadMediumThreshold=50
LoadHighThreshold=80
HighTempThreshold=90The daemon adjusts the CPU energy_perf_bias to one of these modes based on system conditions:
- performance : Maximum performance (high CPU load with AC power)
- balance-performance : Balanced with preference for performance
- balance-power : Balanced with preference for power saving
- power : Maximum power saving (low CPU load or battery power)
The daemon monitors:
- CPU load percentage
- CPU temperature
- AC power status
Logs are written to the configured log file (default: /var/log/autoperf.log ).
- Linux
- CPU with energy_perf_bias support and
xf86_energy_perf_policyexecutable - Access to thermal sensors ( /sys/class/thermal )
- Root privileges