### Human: Can you tell about How To Set CPU Power Management States (C-State) in AHV. ### Assistant: This article describes how to disable processor C-States for latency sensitive applications on AHV. Modern CPUs utilized a technology called "C-States" to manage the amount of power that individual processor cores are utilizing.  When a core is idle, the server's BIOS will reduce its clock rate, power draw, or both in an effort to make the system more energy efficient.  In most cases, this is the desired condition as it can significantly reduce power consumption.  The unused power may be used by other CPU cores to increase their frequency (GHz), allowing instructions executing on active CPU cores to complete faster.The number of C-States available depends on the processor make and model and the capabilities of the server BIOS.  C-States can be broken down into two general buckets:

Active/Idle C-States - Normal CPU activity, no power savings
	C0 - The CPU is actively executing instructionsC1 - The CPU is idle, but fully online (voltage + clock-speed)C1E - The CPU is idle, its clock-speed has been reduced, but is at full voltage
	Sleep States - CPU's clock is stopped and voltage reduced (most common states listed)
	C2 - CPU clock is stoppedC3 - CPU clock is stopped and voltage reducedC6 - CPU internal/external clocks are stopped, voltage reduced or powered off
	

However, some application CPU usage patterns are bursty - requiring CPUs to transition from a low speed/voltage to full speed/voltage.  If the application requires highly performant, low latency CPU operation, it may be sensitive to CPU cores transitioning from a low-power sleep state to full power/clock-speed.  For applications where low latency is more important than power savings, the hypervisor can be instructed to disable processor C-States, preventing the system from powering down CPUs.

These settings are recommended or may be required for applications including Epic Operational Database (ODB), Epic Hyperspace, Intersystem Caché and MEDITECH File Server, Oracle and MS SQL databases, as well as SAP HANA, RDMA (Remote Direct Memory Access) enabled systems and other environments where C-States could add latency.. Before modifying the CPU power states from the operating system, the BIOS has to allow it.  Consult the BIOS documentation for the specific platform running the workload and follow the recommendations from the hardware manufacturer for specific applications.  Ensure that the BIOS allows managing CPU power states from the OS (probably only an issue on old BIOS levels).  AHV can override UEFI/BIOS C-State settings, so you need to use this process in addition to the BIOS settings.

Note that directly editing C-States in the BIOS is not supported for the Nutanix hardware platform as outlined in Release Notes | BMC and BIOS.

Enable the AHV C-State service

There is a service available on AHV that will disable the use of Sleep C-States if the BIOS allows it. To use this service, run the following commands on the CVM to enable it on each AHV host and start it.

On AHV 20190916.x (bundled with AOS 5.15.4 and part of AOS 5.16 and higher):
	nutanix@cvm$ hostssh systemctl enable cstate
	

The cstate service disables C-States C3 and C6. Testing has shown that disabling these two states has the greatest impact on performance. C-States C0, C1, C1E and C2 are not affected.

To verify that the state service is running, execute the following command from a CVM:

nutanix@cvm$ hostssh systemctl enable cstate
Note: The setting will also need to be applied when additional hosts are added to the cluster or if a host is re-imaged.. ### Human: Now explain this as a Nutanix support agent summarizing the answer step by step. In case, you don't know the answer say - I don't know.