In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
In this issue, the editor will bring you about how to optimize the performance of VMware vSphere. The article is rich in content and analyzed and described from a professional point of view. I hope you can get something after reading this article.
Preface
The following is mainly about how to tune the performance of CPU, memory, storage, network, and virtual machines of VMware vSphere architecture. It will run through those areas where there are performance limitations, and eliminate the old concept that virtualization and performance are contrary to each other. The most important thing is to show how to achieve performance tuning in a virtualized environment through small cases, so that virtualization technology can give full play to its advantages. Help the business to improve efficiency, scale on demand, and be flexible.
CPU performance optimization
The allocation of CPU resources is important to ensure the best performance of a virtualized environment. Today's processors generally match multi-core processors for each process, and provide a variety of technologies to help improve the performance of virtualized environments, such as hardware virtualization and acceleration technologies such as Intel-VT and AMD-V. CPU virtualization technology enables virtual machines to execute most of the instructions directly on the physical processor and enables multiple virtual machines to run together to directly access a physical processor.
The relationship between physical CPU and Virtual CPU
Before you do CPU performance tuning, understand what is physical CPU? What is virtual CPU? It's a very important premise. At present, almost all processors, whether X86 architecture or Power architecture, have multiple physical processor cores for each package. The general specifications are 4, 6, 8, 12 cores, and some even more. In VMware ESXi, each physical processing core is detected as a physical CPU. If there are hyperthreads on the Intel processor, then each physical processor core will have two hardware threads, and ESXi can detect each thread as a physical CPU. Virtual CPU is for CPU on virtual machines, each virtual machine is configured with at least one virtual CPU. VMM schedules each virtual CPU to run on any available physical CPU, which can define the number of physical CPU that any virtual machine can access at the same time at a given time.
How ESXi CPU works
CPU in VMware vSphere ESXi receives and executes instructions from users and outsiders through complex scheduling algorithms, and executes in turn according to the set policy. Here are several main actions of CPU in ESXi.
Proportional allocation algorithm for CPU:
When competing for resources between multiple virtual machines, ESXi uses a proportional allocation algorithm to determine which virtual machine should use more CPU and memory resources. The proportional allocation algorithm allows the VMware ESXi scheduler to perform important scheduling calculations by associating each execution context in a share of available physical processor resources. According to the resource allocation criteria, such as sharing, retention, and restriction, the calculated sharing rights and interests are assigned to each execution context.
CPU joint scheduling:
Our common joint scheduling is divided into strict joint scheduling and loose joint scheduling. This strict federated scheduling occurred mainly in earlier versions of VMware ESXi, where the CPU scheduler had a cumulative offset on each microCPU of a multiprocessor virtual machine when federated scheduling was performed. When a single process runs on a multiprocessor virtual machine, only one microprocessor is running on the physical processing, while the other microCPUs are idle, so you only need to require a physical CPU to be available.
Loose joint scheduling mainly appears after the VMware ESXi5 version, so that each micro-CPU process on each virtual machine can be tracked separately, and the offset value is obtained by measuring the difference between the slowest micro-CPUs and other micro-CPUs.
CPU performance tuning of ESXi
As we all know, VMware is a leader in the virtualization field, and the default settings it provides for the ESXi virtualization layer can meet the application scenarios and needs of most enterprises in terms of performance. For more stringent business requirements, the adoption of default settings may affect virtualization to its greatest advantage. How to tune it has become a necessary requirement for administrators.
How is CPU performance diagnosed? Which metrics are most important for performance tuning? VMware provides a command called ESXtop among many administrative instructions to help administrators locate it as soon as possible. Through the output results, we can clearly see the CPU and other related performance problems. The administrator logs in to the ESXi server as root and type C to switch to the CPU analysis interface. In addition to CPU can monitor CPU, you can also observe memory, network, and other performance. The specific method of use is beyond the scope of this article.
Table 1:VMware esxtop CPU performance metrics table
Memory performance optimization
The operation speed of memory is much faster than that of hard disk, so in general, the larger the memory, the faster the application speed of the server. As the carrier of VM, all ESXi must need the support of large memory. So before we talk about memory performance, let's introduce some layers of memory in ESXi.
Physical memory of the virtual host
This refers to the physical memory of the actual physical host, such as a server with 256 GB of physical memory, then the actual physical memory is 256 GB.
Physical memory of the virtual machine
This refers to the memory actually allocated by the administrator to the virtual machine, which can be called directly by the virtual machine, and is only visible to the allocated virtual machine.
Virtual memory of the virtual machine
This refers to the available memory allocated by the virtual machine operating system to the application, which is the address space that the virtual machine operating system maps to the physical memory of the virtual machine.
How ESXi memory works
So how does ESXi virtualization software manage the physical memory of hardware? So that it can run multiple virtual machines at the same time, and the memory is isolated from each other to ensure the stability and reliability of the data.
First, ESXi virtualizes all physical memory, creating contiguous virtual memory address spaces for the different virtual machines running on it. These memory address spaces are mapped to the physical memory of the virtual machine, forming different memory spaces. The memory space is isolated from each other to ensure the independence and security of the virtual machine content. All physical memory allocation calls need to be managed by ESXi. It is particularly important to note that before allocating physical memory to a virtual machine, the ESXi hypervisor sets the physical memory of the host to zero to avoid information leakage between different virtual machines on the host and cause page errors.
Memory recovery
Memory recovery in virtualization is a very professional topic, and the technology is also very difficult. At present, only VMware has implemented the management of memory excess. In order to achieve memory recovery, VMware is mainly carried out in the following ways, which are not provided in different environments to avoid performance bottlenecks and affect the normal operation of the virtual machine.
Transparent page sharing
Transparent page sharing (TPS) is a simple and effective way for hosts to reclaim physical memory. The principle is to make the same mirrored or applied memory redundant pages into a single shared page, leaving only one copy of the memory page. Therefore, the total amount of memory occupied by the virtual machine host is reduced, which can provide more memory to the virtual machine with different pages, thus realizing the excess memory.
Memory expansion
In order to achieve memory ballooning, each virtual machine needs to install VMware Tools, because Tools has a built-in memory ballooning driver to achieve this function. When the ESXi physical memory is in a high pressure state, the memory expansion mechanism is triggered to reclaim the memory. The hypervisor notifies the memory ballooning driver on the virtual machine and allocates "free" virtual machine physical memory pages to virtual machines that exceed the threshold to expand memory. Of course, it is not enabled by default, and enabling this feature will affect the performance of the virtual machine to some extent.
Memory compression
Through memory compression technology, ESXi can also compress some of the virtual machine memory that should have been paged to disk. Compressed memory pages are stored in the compression cache of the virtual machine's main memory. When it is detected that the memory page compression ratio is less than 50%, the memory page will not be compressed, but will be swapped to disk through the hypervisor memory swap. ESXi will only use the hypervisor to swap uncompressed memory pages and will not swap compressed memory pages to disk.
Hypervisor memory swap
In the VM configuration file, there is a file with the suffix .vswp, which is the memory swap file. Through this method, ESXi can swap the physical memory for the virtual machine with the physical disk device to achieve the purpose of freeing memory. This file is created when the virtual machine starts, and the file size is the same as the memory of the virtual machine.
Memory performance tuning of ESXi
Controlling the occupancy ratio of memory, that is, the utilization rate, is a prerequisite to ensure the stability and superior performance of VM and host computer. ESXi has a built-in memory performance tuning tool-ESXtop. Although VMware supports excessive memory technology, it is not recommended to use it casually, after all, excess will lead to memory expansion and memory swapping, affecting the overall performance of the virtual machine.
Table 2:VMware esxtop memory performance metrics table
Storage performance optimization
When we design the virtualization architecture, we should not only consider CPU, memory, network and other factors, but also carefully design the storage. Different business requirements have different requirements for the type of storage. Because the storage platform is different, it means that the protocols used and the characteristics of storage are different. Speed is not the only condition for choosing appropriate storage, such as protocols, connectivity, existing infrastructure, and costs. Currently, there are three main types of storage:
Storage area network
Referred to as SAN, is a dedicated network that provides block-level storage devices. The host and the storage are connected by optical fiber, and the optical fiber switch is often used for interface docking. SAN provides a storage center that works with it to dilute the functionality of local storage. The main protocols are Internet small computer system Interface (ISCSI), fibre Channel over Ethernet (FCoE) and Optical Fiber Communication (FC).
Network file system
In addition to block storage, ESXi also supports connection sharing with the Network File system (NFS) to store virtual machines and related templates. It is mainly transmitted through the network, and there is no need to purchase additional HBA cards.
Virtual SAN
Also known as VSAN, this concept is a new feature introduced by VMware after vSphere5.5. It removes the restrictions on the use of NFS and SAN, while ensuring the high reliability of the data. By aggregating the ESXi local disks and presenting the shared data store to the ESXi host. It supports flexible horizontal and vertical expansion, and it is also the main storage architecture promoted by VMware recently.
How to design physical storage
Reasonable design and selection of physical storage is an important part of the success of virtualization solutions. The quality of storage design directly affects the performance of the overall virtualized environment. The type of storage, RAID configuration, networking, and many other aspects can have a significant impact on the performance of virtualized environments. Here are the design recommendations for shared storage:
Business requirements
Technology always serves the business, and any good architecture design requires a thorough understanding of the business requirements, otherwise the architecture will not have any value. So the determination of business requirements is the first step in starting the design.
RAID level
Also known as redundant disk array, different RAID levels can meet different levels of business needs. Simply put, RAID is a technology that integrates multiple physical hard drives and presents them as one or more logical drives. The mainstream RAID levels are 0, 1, 5, 10 and so on. The higher the number, the higher the security level, and the stronger the ability to prevent data loss.
The use of solid state disk
With the continuous development of technology and hardware, the type of hard disk has also been expanded. From mechanical hard drives before to solid state drives and pure flash drives now. The speed is getting faster and faster, and the throughput of Ihammer O is getting bigger and bigger. This is not to say that in the overall storage architecture, which kind of disk must be good, in order to achieve maximum performance, must be combined with business needs, reasonable use. For permanent data preservation, it is recommended to use a mechanical hard disk. However, for cache areas and hot data areas, it is recommended to use SSD or Flash disk.
IP storage network
IP network storage technology completely depends on the transmission of Ethernet. In some cases, we should also consider combining the IP storage network to compensate for the non-critical components of the architecture. In terms of cost, hardware such as optical storage network and SSD is fast, but the cost is high. For example, mirroring problems such as ISO can be stored in IP network storage and presented by NFS or ISCSI because they are not called frequently.
How to design virtual storage
Unlike other well-known storage, VMware's VSAN is neither NFS nor VMF, it is a virtual SAN storage available over vSphere version 5.5. By integrating the local hard disk resources of all ESXi computing nodes, it creates a logical data store that can be accessed by all ESXi in the cluster. Virtual machine files and other data can be copied between hosts, so that a single host is damaged, there will be no single point of failure, affecting the normal business. Of course, VSAN also has some considerations to avoid performance bottlenecks:
Solid state disk
Each storage group in VSAN must have an SSD disk to create data storage, and requires a pass-through hard disk drive controller that can submit each individual disk drive data to vSphere. Among them, SSD is mainly used as a cache layer, and the ratio of SSD to mechanical disk is 1:10.
Storage strategy
VMware defines VSAN as software-defined storage, which manages storage resources by defining storage policies. Policy administrators can define a set of characteristic availability, performance, and size requirements and allow vSphere to manage the location of VMDK and choose the right data store when deploying new virtual machines.
The network
Because it is connected through Ethernet, VSAN relies on synchronous replication to replicate data in each ESXi host, which requires a higher demand on the network. Because of its low tolerance for delay, the increase of network delay may lead to serious performance degradation. Replication pressure between at least 10G network load ESXi is strongly recommended.
Storage performance tuning of ESXi
Network performance optimization
The performance of the network has a direct impact on the user's final experience. Almost all data transfers in virtualization are carried out through the network. User data extraction, data replication between host and host and so on. The more complex the network, the more detailed design and reasonable planning, otherwise once put into production, it will bring a lot of unnecessary trouble.
Network Design of ESXi
ESXi network design is mainly divided into two types, physical network design and virtual network design. Different levels of network design, the need to configure and support the team is also different, the general physical network design is mainly responsible for the company's network department, while the virtual network is generally responsible for the cloud computing team.
Physical network design:
In the process of network design, we should ensure that each network path should be redundant to avoid a single point of failure.
Ensure that the replication channel between the host and the host has sufficient bandwidth to avoid data latency caused by heavy traffic.
Ensure that there are sufficient physical network uplinks to provide network isolation and redundancy required by the environment.
Ensure isolation of the data network, Kernel, and management network.
Virtualized network design:
It is mainly divided into standard switch and virtual switch. Standard switch is recommended in smaller environment and distributed switch is recommended in larger environment. Because distributed switches are superior to standard switches in scalability, functionality, and backward continuity.
Standard switch:
The standard switch is the earliest virtual switch of VMware, and it is also a stand-alone switch. All incoming and outgoing traffic from each host passes through the standard switch, which requires more administrative overhead.
Suitable for small-scale deployment.
Ensure that the deployment and configuration of each vSwitch on each host is consistent to prevent the network from being unable to communicate after the virtual machine drifts.
Distributed switches:
It is suitable for large-scale deployment because it enables centralized configuration and management, making host settings more unified. It is also a web-enhanced version of the VMware platform.
Rational use of network IBO control
Distributed switch has the advantage of later extension and provides load balancing strategy.
ESXi distributed switch
In fact, how to choose a virtual switch depends entirely on their respective business needs. However, with the development of VMware update technology, the application of distributed switch is more and more popular, especially the deployment and application of large environment. So what are the performance benefits we can get when deploying distributed switches?
Have a good backward expansion ability, otherwise the development route of VMware technology
Support NIOC function to realize the management of different virtual machines using different network resources. In particular, it is widely used in SDN to achieve multiple functions to share less network card.
Provide load balancing function, which can effectively balance the traffic load across physical network cards.
Provides management capabilities for Netflow and LLDP, which is particularly important when virtualizing critical businesses.
Network performance tuning of ESXi
In the previous work of virtualized environment management, it can be found that most of the performance problems come from CPU, memory and storage, and there are almost no performance bottlenecks caused by the network. However, with the emergence of SDN, NSX and other technologies, the demand for the network is getting higher and higher, and the optimization of the network is becoming more and more important.
Performance optimization at host level of ESXi
Through years of work experience, good network performance should start at the ESXi host level.
First of all, select the hosts of the appropriate number of network cards to ensure redundancy and performance.
The load balancing strategy of virtual switch can effectively load the traffic between network cards and avoid the traffic bottleneck of single network card. Therefore, it is recommended that distributed switches should be used as much as possible in both large and small environments.
If the network throughput increases, it is recommended that the host CPU of the ESXi be increased as well. Because the larger the throughput, the greater the amount of CPU required.
Make rational use of the network Imax O control function, and use sharing instead of threshold to control network traffic. Because the threshold is the maximum limit that can be set. On the other hand, sharing depends on policy and optimizes the traffic of key virtual machines through priority.
It is recommended that the traffic of vMotion be isolated by a separate network card to avoid conflicts with other traffic. Both the migrated traffic and the FT traffic will use the kernel network card.
Performance optimization at the virtual machine level
Install VMware tools in all virtual machines and choose to use the VMXNET3 enhanced virtual network card because it provides more advanced functions, such as jumbo frames, receiving and playback, and so on.
Put the associated virtual machines on the same ESXi host as much as possible, because the network of the same host is transmitted through the kernel to maximize speed. However, it does not mean that VM does not need to be backed up or deployed in different places, but should be divided according to the actual application of the business.
For those applications that require low network latency, it is necessary to adjust the network delay sensitivity in the advanced settings of VMware to meet the business needs. Of course, the default settings can already meet the application scenarios of most users.
The above is the editor for you to share how to optimize the performance of VMware vSphere, if you happen to have similar doubts, you might as well refer to the above analysis to understand. If you want to know more about it, you are welcome to follow the industry information channel.
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
© 2024 shulou.com SLNews company. All rights reserved.