How esxi hosts manage memory resources

Source: Internet
Author: User

Because the memory is usually the most limited resource, esxi uses the memory overprovisioning configuration (memory overcommitment, that is, the memory of the configured virtual machine may exceed the physical memory (RAM) to manage the memory. During memory overuse configuration, esxi must use technology to reclaim memory from one or more VMS. These technologies are called transparent page sharing (TPS) and ballooning) swap and memory compression ).

1. Transparent page sharing

When an esxi host runs a VM of the same operating system, it saves a page with the same memory and releases the page with the same memory. This process is completely transparent to the OS and does not know that you and other VMS share the same memory page.

2. Balloon

Obtain unnecessary memory from the running Vm and allocate it to other VMS that require memory resources. In the production environment, the system requires a small amount of memory for normal operation, and the memory allocated during startup is much larger than the memory required for normal operation, as a result, a large amount of memory resources are not used (called idle memory, idle memory) and are rarely used. Because the memory is shared, it can be withdrawn for other VMS.

In this case, how does esxi determine which VM will release the memory when the balloon technology is used to recycle memory resources?

Sharing solves this problem. Share defines the priority of the VM. There are four levels: low, medium, high, and custom (use a or custom ratio ). The esxi host preferentially recycles memory from the VM with lower sharing level for the VM with higher sharing level.

At this point, another problem occurs: VMS with higher priority may accumulate some or a large amount of memory is not used, while VMS with lower priority need to use a large amount of active memory, since sharing does not specify the standard for using active memory, VMS with lower priority will be punished.

We can have a idea: regardless of the VM's sharing priority, idle memory is preferentially recycled. This idea is the idle memory tax of esxi ). By default, the idle memory tax parameter is set to 75%, that is, 75% of the idle memory is recycled. The idle memory tax grants the esxi host a memory recovery method using the sample Probability Method of the Memory Page. Each VM samples data independently within a configurable interval. By default, esxi samples 100 pages every 30 seconds.

3. Exchange

The comprehensiveness of the balloon Technology ensures efficient memory recovery. However, a problem needs to be solved, that is, all memory resources are in use, so that memory resources cannot be recycled.

When the VM is started, a swap file with the. vswp extension is created. VM can be started only when this file can be created and accessed (this means that you should pay attention to the available storage space ).

The esxi host uses swap files to prevent memory from being reclaimed from other VMS due to excessive memory usage. In this case, esxi uses the disk as the memory. However, this technology may never be used, because disk access will greatly affect performance. The only benefit of swap is that the VM will not crash when the memory is insufficient.

Note: the hard disk access time is measured in milliseconds (MS, 1‰ seconds), and the memory access time is calculated in nanoseconds (NS, 1 million in one), the difference between the two is times. Therefore, the exchange technology should not be used forever.

4. Memory Compression

The principle of memory compression is that pages to be exchanged are stored in the protected memory space in the form of compression. When the system accesses this page, the system will find the compressed page in the memory and decompress it for use by the system. The memory compression layer is logically added to the system storage layer: the memory compression layer. Therefore, it can be said that the memory compression layer is the middle layer that the virtualization Manager decides to switch pages on the hard disk.

Access to compressed memory is faster than hard disk access, with no performance loss. When a virtual page must be switched, esxi first tries to compress on 2 kb or smaller blocks.

This is my first blog on virtualization and my first blog. If you have any questions, I hope you can give me some advice.


This article is from the virtualization blog, please be sure to keep this source http://haozhaoyang.blog.51cto.com/5204735/1550971

How esxi hosts manage memory resources

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.