In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
What is the principle of CPU and memory virtualization, many novices are not very clear about this, in order to help you solve this problem, the following editor will explain in detail for you, people with this need can come to learn, I hope you can gain something.
CPU Virtualization
The virtualization of KVM requires CPU hardware support. Remember that we talked about using commands to see if CPU supports KVM virtualization in the previous section?
Root@ubuntu:~# egrep-o'(vmx | svm)'/ proc/cpuinfovmx
If there is an output vmx or svm, the current CPU supports KVM. CPU vendors Intel and AMD support virtualization unless it is very old CPU.
A KVM virtual machine is actually a qemu-kvm process in the host, which is scheduled like other Linux processes. For example, the virtual machine kvm1 running on my experimental machine can see the corresponding progress in the host ps.
Each virtual vCPU in the virtual machine corresponds to a thread in the qemu-kvm process. Look at the picture below.
In this example, the host has two physical CPU with two virtual machines, VM1 and VM2. VM1 has two vCPU,VM2 and four vCPU. You can see that VM1 and VM2 have two and four threads scheduled on two physical CPU, respectively.
Another knowledge point is also demonstrated here, that is, the total number of vCPU of virtual machines can exceed the number of physical CPU, which is called CPU overcommit. KVM allows overcommit, which allows virtual machines to make full use of the host's CPU resources, but only if not all virtual machines are running at full capacity at the same time. Of course, if each virtual machine is busy, it will affect the overall performance, so when using overcommit, you need to know the load of the virtual machine and need to test.
Memory virtualization
KVM shares physical system memory through memory virtualization and dynamically allocates it to virtual machines. Look at the picture below.
In order to run multiple virtual machines on one machine, KVM needs to implement direct address translation of VA (virtual memory)-> PA (physical memory)-> MA (machine memory). The virtual machine OS controls the mapping of the virtual address to the physical address of the guest memory (VA-> PA), but the virtual machine OS cannot directly access the actual machine memory, so the KVM is responsible for mapping the customer physical memory to the actual machine memory (PA-> MA). The specific implementation will not be introduced too much, and you can check the information if you are interested.
Another reminder is that memory can also be overcommit, that is, the sum of the memory of all virtual machines can exceed the physical memory of the host. However, it also needs to be fully tested when in use, otherwise the performance will be affected.
Is it helpful for you to read the above content? If you want to know more about the relevant knowledge or read more related articles, please follow the industry information channel, thank you for your support.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
04. Use vbs script to import accounts in bulk
© 2024 shulou.com SLNews company. All rights reserved.