analyzing CPU 0: driver: acpi-cpufreq CPUs which run at the same hardware frequency: 0 CPUs which need to have their frequency coordinated by software: 0 maximum transition latency: 10.0 us hardware limits: 800 MHz - 2.10 GHz available frequency steps: 2.10 GHz, 2.10 GHz, 2.00 GHz, 1.90 GHz, 1.80 GHz, 1.70 GHz, 1.60 GHz, 1.50 GHz, 1.40 GHz, 1.30 GHz, 1.20 GHz, 1.10 GHz, 1000 MHz, 900 MHz, 800 MHz available cpufreq governors: conservative userspace powersave ondemand performance current policy: frequency should be within 800 MHz and 2.10 GHz. The governor "performance" may decide which speed to use within this range. current CPU frequency: Unable to call hardware current CPU frequency: 2.10 GHz (asserted by call to kernel) boost state support: Supported: yes Active: yes
# 创建cpupower配置文件 cat << EOF | sudo tee /etc/sysconfig/cpupower # See 'cpupower help' and cpupower(1) for more info CPUPOWER_START_OPTS="frequency-set -g performance" CPUPOWER_STOP_OPTS="frequency-set -g ondemand" EOF
# 创建自启动服务 cat << EOF | sudo tee /usr/lib/systemd/system/cpupower.service [Unit] Description=Configure CPU power related settings After=syslog.target [Service] Type=oneshot RemainAfterExit=yes EnvironmentFile=/etc/sysconfig/cpupower ExecStart=/usr/bin/cpupower $CPUPOWER_START_OPTS ExecStop=/usr/bin/cpupower $CPUPOWER_STOP_OPTS [Install] WantedBy=multi-user.target EOF
# 如果遇到以下报错请确认硬件厂商是否做了限制,只能通过BIOS调节 [root@sg-gop-10-71-14-91 wangao]# cpupower frequency-set -g performance Setting cpu: 0 Error setting new values. Common errors: - Do you have proper administration rights? (super-user?) - Is the governor you requested available and modprobed? - Trying to set an invalid policy? - Trying to set a specific frequency, but userspace governor is not available, for example because of hardware which cannot be set to a specific frequency or because the userspace governor isn't loaded?