1.6.3 Monitoring the CPU resource
This subsection explains how to monitor the CPU resource of a KVM system.
- Organization of this subsection
(1) Overview
In a KVM system, multiple virtual machines share the physical server's CPU. The CPU resource allocated to each virtual machine is called a virtual CPU. The OS running on a virtual machine recognizes a virtual CPU as a normal physical CPU.
The CPU resource of the physical server is distributed according to each virtual machine's CPU resource requirement. However, if the combined total of the CPU resource requirements for the individual virtual machines exceeds the CPU resource on the physical server, the required amount of CPU resource cannot be distributed, resulting in a virtual CPU resource shortage. This adversely affects the performance of the virtual machine.
The schematic diagram below shows a state in which a virtual CPU resource shortage has occurred.
|
By monitoring CPU performance data, you can detect such performance deterioration in the virtual machines, and thus you can take appropriate corrective action.
Furthermore, in a virtual environment all physical devices are virtualized, such as memory, disks, and network interfaces. The CPU performs this virtualization of physical devices. Therefore, the CPU resource is an important resource that also affects the performance of other virtual devices.
The following four records are used to monitor the CPU resource. For details about records, see 5. Records.
-
PI record
This record is used to monitor the performance data of the physical server's CPU.
-
PI_HCI record
This record is used to monitor the performance data of each core of the physical CPU.
-
PI_VI record
This record is used to monitor the performance data of the CPU that is being used by each virtual machine.
-
PI_VCI record
This record is used to monitor the performance data of each virtual CPU.
The following figure shows the range of performance data collected in each record.
|
(2) Monitoring examples
Using CPU resource monitoring on virtual machines vhost1 through vhost3 as an example, this subsection explains the factors that cause insufficient CPU resources, and how to solve this problem. The following figure shows the items monitored here and the flow of actions to take.
|
(a) Example of monitoring the CPU usage rate for virtual machines
You can check the CPU usage rate for virtual machines in the Used % field of the PI_VI record.
An example of monitoring is shown below. This example is based on using the monitoring template to display a VM CPU Used Status report. The chart in this report displays the Used field that indicates the CPU usage for the virtual machines. To monitor the Used % field, check the table that is displayed under the chart.
|
- Monitoring template report to be checked
In this example, the CPU usage of vhost2 is high. If the performance of a virtual machine has degraded due to high CPU usage, review the number of allocated CPUs and other configuration information of the virtual environment. If the problem still cannot be solved, consider whether you can add physical CPUs or physical servers.