In layman's terms, a virtual machine virtualizes a computer to realize the functions of one computer with multiple computers. However, the performance of the entire machine will also be allocated and divided by each virtual machine, so the division The more virtual machines there are, the fewer CPU, memory, and storage space resources allocated to each virtual machine. Therefore, the higher the configuration, the better when setting up virtual machines. Therefore, it is widely used in server and other industries.
The role of virtual machines in reality is quite large. For example, in the simplest case, our computer does not have an optical drive. If we want to install a system, we can use a virtual machine to install the system. The virtual machine has a virtual optical drive inside, which supports Open the system image file directly to install the system. In addition, virtual machine technology is also very practical in the eyes of game enthusiasts. For example, we know that many games on a computer generally do not support multiple games at the same time, but we can create several more virtual machines on the computer. Then you can run the program separately in the virtual machine system, so that one computer can open multiple games at the same time. In addition, there are many functions of virtual machines, so I won’t introduce them one by one here.
In fact, virtual machines are widely used in enterprises. Because servers usually have very high configurations, many server network providers usually divide one server into multiple virtual machine servers in order to meet the needs of small and medium-sized webmasters. Each website can be allocated a portion of independent server resources without affecting each other and can be assigned an independent IP address, which greatly solves the problem of high costs for small and medium-sized enterprises to use independent servers. Currently, all VPS servers purchased use this technology. The virtual space used by friends of the website in the early days is also based on this principle. Friends who are interested may wish to learn about it.
Virtual machine (VirtualMachine) refers to a complete computer system with complete hardware system functions simulated by software and running in a completely isolated environment.
When installing a virtual machine, the computer will become stuck.
A virtual machine can simulate other types of operating systems. It needs to simulate the underlying hardware instructions, so the application running speed is much slower than the virtual system.
Popular virtual machine software includes VMware (VMWareACE), VirtualBox and VirtualPC, all of which can virtualize multiple computers on Windows systems.
Extended information:
Virtual machine resources involve many aspects: CPU, memory, network and disk. The relationship between these resources should be considered when planning virtual machines. Otherwise, unreasonable allocation of resources will lead to poor application performance within the virtual machine.
1. CPU
Each vCPU of a virtual machine only runs on one physical core, so the higher the CPU frequency, the higher the running speed of the virtual machine. A larger number of vCPUs helps improve application performance. One complicating factor is that within an ESXi server, all virtual machines share the same physical CPU. The more cores an ESXi server has, the greater the core share each vCPU gets.
2. RAM
RAM resources in ESXi servers are usually limited, so you need to be extra careful when allocating RAM to virtual machines. The VMkernel is very clever when it comes to handling RAM; it allows virtual machines to use all the physical memory of the ESXi server and tries to avoid occupying physical memory without actually using it.
After the physical memory is completely used up, the VMkernel must determine which virtual machines can retain physical memory and which virtual machines need to release physical memory. This is called "memory recycling". When the physical memory occupied by a virtual machine is reclaimed, there is a risk that it will affect the performance of the virtual machine. The more memory that is reclaimed by a virtual machine, the greater the corresponding risk.
It is wisest to allocate only the memory that a virtual machine needs to do its job. Allocating additional memory will increase the risk of collection. On the other hand, when the virtual machine operating system uses unused memory as disk cache, it will significantly reduce the performance requirements on the disk system, so there is a trade-off issue here.
For database servers and VDI desktops, it is often more cost-effective to allocate more memory to virtual machines—running fewer virtual machines on an ESXi server—rather than purchasing high-performance disk arrays. The key is to allocate enough memory for the workload of the virtual machine without wasting it.
3. Network bandwidth
Network bandwidth includes two aspects: one is the bandwidth between the virtual machine and the virtual switch, and the other is the bandwidth between the virtual switch and the external network. If you want the virtual machine to get maximum bandwidth, you should use the VMXNET3 network adapter.
For connections to external physical networks, be sure to ensure that the ESXi host has the fastest physical network card. Virtual machines that perform a large number of network transmissions, virtual machines, and data packet transmission will consume CPU time.
4. Disk performance
Virtual machine disk performance is limited by the number and type of array disks and the number of virtual machines running on them. Because a centralized shared storage architecture will result in all virtual machine disks being accessed from the same location, it is easy for the array's storage controller and disks to become overloaded, leaving virtual machines waiting for a response from the storage.
The effects of virtual machines waiting for disk IO and virtual machine CPU idleness on performance are very different. A VM waiting for IO cannot do other work, so high I/O wait time means performance will definitely degrade. Careful storage design is critical to avoid the above situations.
Reference source: Baidu Encyclopedia Virtual Machine
上一篇:在虚拟机里面可以干什么
下一篇:用虚拟机有啥好处