Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What is Linux dynamic memory configuration and timely backup?

2025-02-14 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

What is the dynamic memory configuration and timely backup of Linux? in view of this problem, this article introduces the corresponding analysis and solution in detail, hoping to help more partners who want to solve this problem to find a more simple and easy way.

Linux dynamic memory configuration

Dynamic memory configuration is one of the optional technologies in Hyper-V. If you enable this technology, Hyper-V will automatically reserve or release physical memory according to the amount of memory required by Guest OS. When dynamic memory is turned on, it can aggregate memory space that has not actually been used by Guest OS. This enables memory to be better utilized, to increase the number of virtual machines running on a single Host OS, to increase the overall density of virtual machines, to make higher utilization of hardware and to reduce the cost of each virtual machine. Dynamic memory configuration technology can be used in both Windows and Linux client operating systems, and even a mixed configuration of the two operating systems can be used on a single Hyper-V host.

Dynamic memory configuration is a technology that maximizes memory utilization in a variety of mixed environments. Hyper-V will reduce the number of client operating systems that use less memory and assign it to client operating systems that use more memory. And Hyper-V will do its own memory configuration and adjustment and do not need managers to adjust and other work.

If the current memory requirements of the client operating system have reached a stable level, the benefits of dynamic memory will not be obvious. If your configuration is stable, we will recommend that you turn off this technology. In addition, some programs on the client operating system will try to plan and manage all the memory allocated to him, bypassing the operating system. For example, if such a program plans its own memory configuration, dynamic memory is not recommended to be enabled, because such programs may conflict with the technology provided by Hyper-V. The most common examples are large scalable databases and some Java application servers.

The technology of dynamic memory in Hyper-V supports most Linux distributions, but it is not currently supported on FreeBSD. This section allows you to keep an eye on the LIS/BIS technology table on TechNet to see which distributions have supported dynamic memory technology.

How does dynamic memory technology work?

Dynamic memory technology is implemented using two technologies, both of which are independent of each other: "Hot-Add" and "Ballooning". To understand these two technologies, let's first see that Hyper-V allows you to set three dynamic memory configuration parameters in a virtual machine:

◆ starting memory-the amount of memory that should be configured when the virtual machine is enabled at the beginning.

◆ * memory limit-the amount of memory that can be configured from dynamic memory in this virtual machine.

◆ minimum memory limit-when the minimum memory is a dynamic memory configuration, a minimum amount of memory is required for this virtual machine.

The starting memory is usually between the * memory limit and the minimum memory limit.

The "Hot-add" technology mentioned earlier is that when the amount of memory required by a virtual machine increases, it will gradually increase the available memory of the virtual machine to the memory limit. This approach will only gradually increase the amount of memory available in the virtual machine, but there is no way to "Hot-remove", that is, it can only increase memory but not reclaim unused memory.

The "Ballooning" technology is used to reclaim the configured size from the virtual machine in memory. This is the dynamic memory driver within LIS to declare to the client operating system that this memory must be reserved for LIS, so there is no way to use it on the Linux client operating system. The LIS memory driver then returns the memory occupied by LIS to Hyper-V so that Hyper-V can be configured for use by other virtual machines. This operation does not reduce the total memory capacity of the original Linux client operating system, but its Linux client operating system believes that memory should be used as a buffer area for some programs. Therefore, Ballooning technology does not reduce the actual available memory space seen by its Linux client operating system to less than the value set by the minimum memory limit.

Ballooning technology can also configure the available memory back to the virtual machine, and when Hyper-V decides to return the boundary memory, the memory space previously claimed to be used in the LIS will be returned to the Linux client operating system. When the virtual machine memory requirements increase and the memory of the Ballooned has been returned, the Hyper-V will use Hot-add to configure more memory to the required virtual machines.

Example of dynamic memory configuration

Let's take a look at the dynamic memory configuration process, and we use the following examples to illustrate these three steps:

◆ A virtual machine is enabled, and its memory size will be configured according to the memory size set by the starting memory.

The demand for memory of the ◆ virtual machine increases, so Hyper-V increases the memory of the virtual machine through Hot-add technology.

◆ virtual machines require less memory, so Hyper-V frees up free memory through Ballooning technology.

The process of the above three steps is observed in several ways:

◆ shows the current memory configuration from an overview of the memory configuration diagram.

◆ looks at the memory status through the memory pages within the Hyper-V administrator.

◆ uses the free-m command under Linux to query the memory status.

The first two ways are to observe memory consumption from the virtual machine, while the third way is to observe memory usage from within the client operating system.

In the * steps, there is no obvious program consumption of memory after the virtual machine is booted at this time. A memory of the corresponding size according to the starting memory configuration set by the virtual machine. At this point, the same amount of memory can be seen in the Hyper-V and Linux client operating systems, but note that the memory size of 32MB has been reserved in Linux for BIOS for other purposes.

In the second step, significant memory requirements begin to appear in the virtual machine, and Hyper-V will begin to allocate more memory to the virtual machine through Hot-add technology. You can see the increase in the size of the fields shown in Assigned Memory and the increase in the Linux client operating system (32MB is still reserved for BIOS).

In the third step, when the previously memory-consuming program completes the operation, the memory usage decreases, and the Hyper-V starts to reclaim the memory using Ballooning technology through LIS, while the Assigned memory in the Hyper-V begins to decline. However, when you view the memory status within the Linux client operating system, no change is made, still maintaining the additional memory size that was just added at the high memory usage. Although there seems to be no change in the memory available to the Linux client operating system, in fact, in the bright green blocks, LIS takes it and claims to be used by LIS, thus making the Linux client operating system think of it as Buffer use. If these bright green blocks are used by Linux and the memory demand of the Linux client operating system starts to grow again, then go back to step 1 and use Hot-add to configure more memory to the virtual machine.

Linux backup in time

Next, let's talk about another feature, timely backup. Just-in-time backup allows you to establish a full backup of a Linux virtual machine, including the virtual disk drives, without stopping or shutting down the virtual machine. The main purpose of this feature is to ensure that the environment you use during the production phase can maintain its online time.

The backup of the file system must be consistent. When a backup action is performed, the file system on the Linux client operating system will write the data in the memory Buffer back to the virtual disk. This action is to ensure that the operating system writes all the data back to disk, otherwise you may encounter data inconsistencies when restoring the virtual machine from backup files.

Let's see how just-in-time backup works through the example above.

◆ requires Hyper-V to back up one or more virtual machines through backup software provided by Microsoft or third-party vendors.

Through the VSS driver in LIS, ◆ communicates with the Linux virtual machine and starts the backup program. The driver, called VSS, is actually named because some of its functions are similar to "Volume Shadow Copy Service" in Windows. But they are different, so don't think of the two names as the same technology.

◆ while the VSS driver communicates with the VSS service within the Linux User space, while the VSS service will issue a request to Linux to suspend the file system and write back memory back to the virtual disk.

◆ Hyper-V will establish a backup checkpoint (Check point) and tell LIS that the system state can be unpaused. The Linux file system only pauses during steps 3 and 4, which is enough to write back data in memory and establish a virtual machine checkpoint, usually less than 2 seconds.

The Windows VSS of ◆ within Hyper-V will create a snapshot disk volume (VHD/VHDX) of the virtual disk.

◆ and the backup software copies the VHD/VHDX to other storage space.

Dynamic memory configuration and timely backup are important features when you run Linux on Hyper-V. These two functions require close cooperation between the Hyper-V host and the client operating system to achieve the function. Now Microsoft has brought these two functions to Hyper-V and Linux.

This is the answer to the question about Linux dynamic memory configuration and timely backup. I hope the above content can be of some help to you. If you still have a lot of doubts to be solved, you can follow the industry information channel to learn more about it.

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.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report