Files
doc-exports/docs/ecs/umn/en-us_topic_0000002498531278.html
wanghuijuan738 4d1fac645a ECS UMN 20260115 version. Added S9 instance specifications.
Reviewed-by: Pristromskaia, Margarita <margarita.pristromskaia@t-systems.com>
Co-authored-by: wanghuijuan738 <wanghuijuan738@huawei.com>
Co-committed-by: wanghuijuan738 <wanghuijuan738@huawei.com>
2026-02-11 08:55:57 +00:00

8.0 KiB

Best Practices for Performance Configuration

C-states control the sleep levels that a CPU can enter when it is idle. The sleep levels are numbered from C0 (the CPU is executing instructions) to C6 (the deepest sleep level where the CPU is in a very low-power state). When the CPU enters a deeper C-state, the wake-up time increases. In some load scenarios that require high real-time performance, the performance is affected. Therefore, if you have high requirements on performance stability, set the C-state to C1 to reduce the CPU response, ping, and TCP/UDP latency.

Procedure

This section uses c9.large.2 and HCE 2.0 as an example to describe how to disable deep hibernation for CPUs. The command output varies depending on ECS flavors and images.

  1. Log in to the target ECS.

    For details, see Login Overview (Linux).

  2. Run the following command to check CPUidle driver and supported C-states:
    cpupower idle-info

    The figure below shows the command output. Number of idle states indicates the number of supported C-states, and Available idle states indicates the supported C-states.

    If no CPUidle driver is displayed in the command output, you may need to update the image.

  3. Modify the C-states parameters in the /etc/default/grub file.
    1. Open the /etc/default/grub file.
      sudo vim /etc/default/grub
    2. Press i to enter insert mode.
    3. Locate the GRUB_CMDLINE_LINUX= line and add intel_idle.max_cstate=1 and processor.max_cstate=1 to the end of it to set the deepest C-state of idle CPUs to C1.

    4. Press Esc, type :wq, and press Enter to save the file and exit.
    5. Regenerate the grub configuration file.
      sudo grub2-mkconfig -o /boot/grub2/grub.cfg

      The GRUB file address varies depending on the image or boot mode. For example, in the HCE 2.0 UEFI boot mode, the command is sudo grub2-mkconfig -o /boot/efi/EFI/hce/grub.cfg.

      Run the following command to query the boot mode:

      [ -d /sys/firmware/efi ] && echo "UEFI Boot Detected" || echo "Legacy BIOS Boot Detected"
  4. Restart the ECS for the configuration to take effect.
    sudo reboot
  5. Run the following command to check CPUidle driver and supported C-states:
    cpupower idle-info

    If the command output shown in the following figure is displayed, the system supports only two C-states (POLL and C1).

<script language="JavaScript"> </script>