# CPU (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 
  + Configuration commands:
```
cpupower frequency-set --governor performancecpupower frequency-set --governor performance
```
-------------------------------------------------------------

CPU (one)
- Frequency Scaling
  - cpufreq is a module that dynamically adjusts the CPU frequency and can support five modes
    - 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. For applications with high latency and performance requirements, it is recommended to turn off dynamic CPU throttling, disable CPU hibernation, and fix the CPU frequency to the highest.
    -  5 modes:
       -  1. Performance: As the name implies, it focuses only on efficiency, fixing the CPU frequency at the highest operating frequency it supports, rather than dynamically adjusting it.
       -  2. Userspace: The earliest cpufreq subsystem provided this flexibility to users through the userspace governor. The user state application is given the decision of the frequency conversion policy, and an interface is provided for the user state application to adjust the CPU frequency. This is the model that has been used for a long time. This can be configured by manually editing the configuration file.
       -  3. powersave: Set the CPU frequency to the lowest so-called “power saving” mode, where the CPU works at the lowest operating frequency it supports. As a result, both governors are static governors, meaning that when they are used, the CPU frequency does not dynamically adjust to changes in system runtime load. These two governors correspond to two extreme application scenarios, where using a performance governor is the greatest pursuit of system performance, while using a powersave governor is the greatest pursuit of low system power consumption.
       -  4. ondemand: Quickly and dynamically adjust the CPU frequency as needed. As soon as there is a CPU calculation, the task will immediately reach the maximum frequency, and return to the lowest frequency immediately after execution; ondemand: userspace is the detection of the kernel state, the user state is adjusted, and the efficiency is inefficient. And ondemand is the kind of governor that people have long wanted to see working entirely in the kernel state and able to sample and analyze the system load at more fine-grained intervals. When the ondemand governor detects that the system load exceeds the percentage set by the up_threshold, the user currently needs the CPU to provide more processing power, so the ondemand governor sets the CPU to run at the highest frequency. But when the ondemand governor detects a drop in system load and can reduce the CPU frequency, what frequency should it be reduced to? The initial implementation of the ondemand governor is to tune down to the next available frequency within an optional frequency range; for example, the CPU supports three selectable frequencies, 1.67GHz, 1.33GHz, and 1GHz, which the ondemand governor finds can be lowered if the CPU is running at 1.67GHz Operating frequency, then 1.33GHz will be selected as the target frequency for downscaling.
       -  5. Frequency: Unlike ondemand, the CPU frequency is adjusted smoothly, the frequency rise and fall is gradual, and automatically adjusts at the upper and lower frequency limits. The difference between ondemand and ondemand is that it allocates frequencies on demand instead of simply pursuing the highest frequency.
  -  Performance mode should be selected to ensure service performance, and the CPU frequency is fixed to the highest operating frequency it supports
  - Set command cpupower frequency-set —governor performancecpupower frequency-set —governor performance
