Ring Buffer Memory Replication for VM High Availability
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Existing virtual machine (VM) memory replication systems face inefficiencies due to buffer overflow issues, leading to prolonged suspension times and increased resource usage, as they require frequent synchronization between read and write threads and rely on large buffers to prevent overflow, which are costly and resource-intensive.
Innovation Solution
A special ring buffer is introduced that operates with a lockless scheme, prioritizing the copy process over the transmission process, allowing both to run simultaneously, and employs a notification threshold to manage data transmission independently of the VM's status, separating the copying and sending processes into parallel threads to prevent buffer overflow and reduce synchronization overhead.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Reliability
If a large local memory buffer is used to prevent overflow, then buffer overflow is avoided, but memory resource usage increases significantly
Solution Approach 1:
The patent implements a dynamic buffer management mechanism where the buffer size is not fixed but adapts based on the actual replication needs. The buffer dynamically adjusts its capacity during operation, allowing it to prevent overflow during peak dirty page generation while releasing resources during low-activity periods, thus resolving the contradiction between reliability and resource consumption
Solution Approach 2:
The system changes the parameter of buffer capacity from a static large allocation to a dynamic value that adjusts based on replication progress and dirty page generation rate. This parameter change allows the buffer to maintain sufficient size for reliability while avoiding permanent allocation of excessive memory resources
2Reliability
If the VM is suspended to copy all dirty pages to the buffer, then complete replication is ensured, but suspension time increases
Solution Approach 1:
The system performs preliminary actions by starting to transmit dirty pages to the standby host before the VM suspension is complete. The transmission process is initiated in advance and continues during the suspension period, ensuring that replication is already in progress when the VM resumes, thereby reducing the effective suspension time while maintaining completeness
Solution Approach 2:
The patent maintains continuity of the replication action by overlapping the dirty page copying and transmission processes. Instead of completing all copying before transmission starts, the system continues the useful action of data movement throughout the suspension period, ensuring replication completeness while minimizing the time the VM is non-operational
3Reliability
If frequent synchronization between read and write threads is performed, then data consistency is maintained, but system performance decreases
Solution Approach 1:
The patent segments the buffer into multiple regions or chunks that can be independently managed by read and write threads. This segmentation allows threads to operate on different segments simultaneously without requiring frequent global synchronization, maintaining data consistency within each segment while improving overall system performance through reduced synchronization overhead
Data Source
AI summary
High availability (HA) protection is provided for an executing virtual machine. At a checkpoint in the HA process, the active server suspends the virtual machine; and the active server copies dirty memory pages to a buffer. During the suspension of the virtual machine on the active host server, dirty memory pages are copied to a ring buffer. A copy process copies the dirty pages to a first location in the buffer. At a predetermined benchmark or threshold, a transmission process can begin. The transmission process can read data out of the buffer at a second location to send to the standby host. Both the copy and transmission processes can operate asynchronously on the ring buffer. The ring buffer cannot overflow because the transmission process continues to empty the ring buffer as the copy process continues. This arrangement allows for using smaller buffers and prevents buffer overflows, and thereby, it reduces the VM suspension time and improves the system efficiency.


