# Cpu Performance Mode (A)

+ `Dynamic Frequency Scaling`
  + Definition: CPU dynamic energy saving technology is used to reduce server power consumption. By selecting power management policies with different system idle states, server power consumption can be reduced to varying degrees. Lower power policies mean slower CPU wake-up has a greater impact on performance.
  + 5 modes
    + `performance`
    + `userspace`
    + `powersave`
    + `ondemand`
    + `conservative`

------------------------------------------------------------
CPU Performance Mode

CPU dynamic energy saving technology is used to reduce server power consumption. By selecting power management policies with different system idle states, server power consumption can be reduced to varying degrees. Lower power policies mean slower CPU wake-up has a greater impact on performance.

It is recommended to set this mode to high performance in database service: performance 
- Can be turned on by the Performance module in the host's BIOS
- Or adjust the CPU mode after each server starts
  - Adjust CPU mode

```
for CPUFREQ in /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor; do
        [ -f $CPUFREQ ] || continue
        echo -n performance > $CPUFREQ
done
```

  - Verify CPU mode adjustment

```
cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
```

  - Does not work after restart the configuration. If persistence is required, you can set this command to run automatically at power-on, or you can do so by modifying the BIOS configuration.
