Data processing method, data processing system, and non-transitory computer program product for controlling a workload delay time

A data processing method, a data processing system and a computer program product are provided. The data processing method includes executing a running operation. The data processing method also includes suspending the running operation at a preset time point in a period of the running operation and calculating a remaining processing time according to a transfer amount of a plurality of dirty pages which are collected before the preset time point in the period of the running operation. The data processing method further includes continuing to execute the running operation, suspending the running operation, and executing a snapshot operation to generate a corresponding data snapshot based on the remaining processing time, and executing a transfer operation to transfer the corresponding data snapshot.

CROSS-REFERENCE TO RELATED APPLICATION

This application claims the priority benefit of Taiwan application serial no. 106117127, filed on May 24, 2017. The entirety of the above-mentioned patent application is hereby incorporated by reference herein and made a part of this specification.

BACKGROUND

Technical Field

The disclosure relates to a server data processing method for a virtual machine architecture with a fault tolerance mechanism, and a data processing system using this method. The disclosure also relates to a computer program product using this method.

Description of Related Art

In recent years, the Internet has developed rapidly and cloud computing has risen, which contributes to the growing demand for better information services. Therefore, virtual machines (VM) having high computing capability are widely used in various solutions. For example, integrated computers become extensively used, which combine a large number of servers, in which the virtual machines operate, through the Internet to achieve high-speed computing and large storage capacity.

In order to prevent major losses due to shutdown or data loss caused by server failure, a virtual machine fault tolerance (FT) mechanism has been developed for switching to another server instantly and uninterruptedly to continue the services when the server used to provide the services fails.FIG. 1is a diagram illustrating a delay time caused by the virtual machine fault tolerance mechanism. Referring toFIG. 1, a backup mechanism of the server is illustrated as an example. Specifically, a data processing cycle (e.g., backup cycle) of the virtual machine with such a fault tolerance mechanism may be divided into four stages: running operation, snapshot operation, transfer operation, and output operation. When a workload request is received from a user during the operations of the first three stages, if outputs are generated for responding to the user, these outputs are temporarily stored in a buffer memory to be outputted together in the stage of the output operation. That is to say, in the virtual machine fault tolerance system, all the output information for responding to the user's request is released and transferred to the user only after the running operation, the snapshot operation, and the transfer operation are completed. Consequently, the response information corresponding to the workload requirement results in an additional delay time in the virtual machine fault tolerance system. When it comes to a delay-sensitive workload requirement (e.g., online game and real-time transaction), the system response time cannot be ensured, and disconnection or transaction failure may even occur. In view of the above, it is necessary to devise a method for controlling the delay time in the virtual machine fault tolerance system, so as to meet such a workload requirement.

SUMMARY

Embodiments of the disclosure provide a data processing method and a data processing system and a computer program product that use this method, which are capable of effectively controlling a workload delay time in a virtual machine architecture with a fault tolerance mechanism.

In an exemplary embodiment of the disclosure, a data processing method is provided, including: executing a running operation; suspending the running operation at a preset time point in a period of the running operation and calculating a remaining processing time according to a transfer amount of a plurality of dirty pages that are collected before the preset time point in the period of the running operation; continuing to execute the running operation, suspending the running operation, and executing a snapshot operation to generate a corresponding data snapshot according to the remaining processing time; and executing a transfer operation to transfer the data snapshot.

In an exemplary embodiment of the disclosure, a data processing system is provided, including: a first server and a second server. The first server is configured to run a first virtual machine. The second server is configured to run a second virtual machine and is coupled to the first server via a bus. The first virtual machine is configured to suspend the running operation at a preset time point in a period of the running operation and calculate a remaining processing time according to a transfer amount of a plurality of dirty pages that are collected before the preset time point in the period of the running operation. The first virtual machine is further configured to continue to execute the running operation, suspend the running operation, and execute a snapshot operation to generate a corresponding data snapshot according to the remaining processing time. The first virtual machine is further configured to execute a transfer operation to transfer the data snapshot.

In an exemplary embodiment of the disclosure, a computer program product having at least one code is provided. When an electronic device loads and executes the at least one code, the aforementioned data processing method is completed.

Based on the above, the data processing method, and the data processing system and the computer program product that use this method according to the exemplary embodiments of the disclosure may estimate the remaining processing time available for continuing to execute the running operation according to the transfer amount of the collected dirty pages to dynamically adjust the time of executing the running operation in the data processing cycle and determine the start time point of the operation following the running operation. Thereby, the delay time caused by the fault tolerance mechanism of the virtual machine is controlled effectively to enable the virtual machine to respond within the fixed delay time.

To make the disclosure more comprehensible, several embodiments accompanied with figures are described in detail as follows.

DESCRIPTION OF THE EMBODIMENTS

In order to control a delay time of a workload in a virtual machine architecture with a fault tolerance mechanism, the disclosure estimates a remaining processing time and thereby keeps the delay time within a set delay range.

FIG. 2Ais a schematic diagram illustrating a data processing system according to an exemplary embodiment, andFIG. 2Bis a block diagram illustrating the data processing system according to an exemplary embodiment. It should be understood thatFIG. 2AandFIG. 2Bare merely examples for ease of explanation and should not be construed as a limitation to the disclosure.

Referring toFIG. 2AandFIG. 2B, a data processing system100includes a first server110and a second server120. The first server110includes a processing device112, a buffer memory114, a communication device116, and a first virtual machine118, and the second server120includes a processing device122, a buffer memory124, a communication device126, and a second virtual machine128.

The processing device112is coupled to the buffer memory114and the communication device116and is configured to control an overall operation of the first server110. For example, the processing device112is a central processing unit (CPU).

The buffer memory114is configured to temporarily store a command or data executed by the processing device112. The buffer memory114may be a dynamic random access memory (DRAM) or a static random access memory (SRAM), for example. Nevertheless, it should be understood that the disclosure is not limited thereto, and the buffer memory114may also be other suitable memories.

The communication device116is configured to establish a network connection with other external devices in a wired or wireless manner. For example, the first server110may communicate with the second server120via the communication device116.

Likewise, the processing device122, the buffer memory124, and the communication device126are respectively the same as or similar to the processing device112, the buffer memory114, and the communication device116described above and thus are not repeated hereinafter.

The first server110and the second server120may respectively operate one or more virtual machines to provide different services. For example, the first virtual machine118runs in the first server110and the second virtual machine128runs in the second server120. It should be understood that two servers and two virtual machines are described in this exemplary embodiment as an example, but the disclosure is not limited thereto. In other words, the data processing system100may include two or more servers, and each of the servers may run one or more virtual machines. For example, the data processing system100may further include a third server configured to run at least one virtual machine (also referred to as a “third virtual machine”).

A bus130serves as a path for the server to transfer data. For example, the first server110and the second server120may transfer data that needs to be processed or accessed to each other via the bus130. In this exemplary embodiment, the bus130is compatible with the Peripheral Component Interconnect Express (PCIe) standard. Nevertheless, it should be understood that the disclosure is not limited thereto, and the bus130may also be compatible with other suitable standards.

In the operation of an operating system of the server, the memory is managed by pages. When the first virtual machine118needs to modify the data in a certain record, the first virtual machine118reads the page where the data is kept from a hard disk into the buffer memory114and modifies the record in this page. At this time, the page in the buffer memory114is different from the corresponding page in the hard disk. Therefore, the page that has been updated in the buffer memory114is called a dirty page.

To explain how to embody the data processing method and the data processing system of the disclosure, a backup operation of the server is described hereinafter as an example. Nevertheless, the data processing method and the data processing system of the disclosure are not only applicable to the backup operation. The data processing method and the data processing system of the disclosure may also be applied to other data processing operations, such as copying or moving data.

FIG. 3is a schematic diagram illustrating an operation of the virtual machine according to an exemplary embodiment.

Referring toFIG. 3, a data processing cycle (e.g., a backup cycle) for the virtual machine with the fault tolerance mechanism may be divided into four stages, e.g., a running operation302, a snapshot operation304, a transfer operation306, and an output operation308. Generally, in the running operation302, the first virtual machine118adds, modifies, or accesses the data in the hard disk according to a request command from a user. For example, in the running operation302, the first virtual machine118temporarily stores the aforementioned dirty page and response information for responding to the user in the buffer memory114. By executing the snapshot operation304, the dirty page obtained in the running operation302may be backed up to generate a data snapshot, and after completing the snapshot operation304, the first virtual machine118resumes execution of the running operation302. For example, a snapshot time of the snapshot operation304is about 1 to 2 ms. The snapshot time of the snapshot operation304is relatively short in the data processing cycle, and thus may be regarded as a fixed value in this exemplary embodiment. The first virtual machine118transfers the data snapshot to the second virtual machine128in the transfer operation306to complete backup of the data. When the second server120serves as a backup server of the first server110, in an example where the data processing system100includes a plurality of the first servers110, the second virtual machine128may simultaneously serve a plurality of the first virtual machines118of the first servers110. That is, the second server120may simultaneously serve as the backup server of a plurality of the first servers110. After completing transfer of the data snapshot, the data snapshot corresponding to the dirty page has been backed up to the second virtual machine128. Thus, if the first server110is damaged and unable to provide services, the second virtual machine128of the second server120may instantly take over the work performed by the first virtual machine118of the first server110and provide the corresponding services. In the example where the data processing system100further includes the third server, the second virtual machine128also executes the snapshot operation304and the transfer operation306to transfer the data snapshot to the virtual machine (e.g., the third virtual machine) that runs in the third server, so as to achieve more reliable backup. Moreover, the output operation308is to output the response information for responding to the user. For example, the first virtual machine118or the second virtual machine128executes the output operation308to transfer the response information to an electronic device. Since the transfer operation306is mainly for transferring the dirty page, a time of the transfer operation306changes based on a transfer amount of the dirty pages collected. Accordingly, the data processing system100of the disclosure controls the delay time with reference to the transfer amount of the dirty pages collected and the processing time of the transfer operation306.

The first virtual machine118calculates a remaining processing time according to the transfer amount of the dirty pages that are collected before a preset time point, and executes the running operation302according to the remaining processing time. If there is no remaining processing time after the calculation, the first virtual machine118directly executes the snapshot operation304and the transfer operation306to transfer the corresponding data snapshot to the second virtual machine128. In order to more clearly illustrate the operations of the data processing system100and the virtual machines thereof according to the disclosure, an example is described hereinafter also with reference toFIG. 3.

FIG. 4Ais a flowchart illustrating a data processing method according to an exemplary embodiment.

With reference toFIG. 3andFIG. 4A, in Step S401, the first virtual machine118executes the running operation302. In a period of the running operation302, the first virtual machine118collects a plurality of dirty pages. In Step S403, the first virtual machine118suspends the running operation302at a preset time point Tppin the period of the running operation302, and calculates a remaining processing time TRaccording to the transfer amount of the dirty pages that are collected before the preset time point Tppin the period of the running operation. By the preset time point Tpp, the running operation302of the first virtual machine118has been executed for a preset time TP. Therefore, the first virtual machine118calculates the remaining processing time TRaccording to the transfer amount of the dirty pages that are collected in the preset time TP. Then, in Step S405, the first virtual machine118continues to execute the running operation302, suspends the running operation302, and executes the snapshot operation304to generate the corresponding data snapshot according to the remaining processing time TR. In other words, the first virtual machine118continues to collect a plurality of dirty pages in the remaining processing time TR. Here, the remaining processing time TRrepresents a time between the preset time point Tppand a start time point Tbk. In other words, the first virtual machine118may determine the start time point Tbkaccording to the calculated remaining processing time TR. The start time point Tbkrefers to a time point of starting to execute another operation following the running operation in one data processing cycle. In this exemplary embodiment, the start time point Tbkmay be the time point of starting to execute the snapshot operation304. Therefore, after the first virtual machine118continues to execute the running operation302according to the remaining processing time TR, the first virtual machine118suspends the running operation302at the start time point Tbkand then executes the snapshot operation304. Thereafter, in Step S407, the first virtual machine118executes the transfer operation306to transfer the data snapshot to the second virtual machine128and thereby completes one data processing cycle.

If the user sends a request command to the first virtual machine118via an electronic device140at a time t1during the data processing cycle, the first virtual machine118executes a processing operation according to the request command to obtain the response information corresponding to the request command. In a data processing system of a virtual machine that does not use the fault tolerance mechanism, after the first virtual machine118receives the request command from the electronic device140at the time t1and executes the processing operation according to the request command to obtain the response information corresponding to the request command, the first virtual machine118may immediately transfer the response information to the electronic device140at a time t2. In contrast thereto, in the data processing system of the virtual machine that uses the fault tolerance mechanism, in order to ensure that all the dirty pages are successfully copied or backed up to the second virtual machine128, the first virtual machine118first temporarily stores the response information in the buffer memory114and waits for completion of the snapshot operation304and the transfer operation306to execute the output operation308to transfer the response information to the electronic device140at a time t3. Here, since a response time between the time t1and the time t2is a fixed value, in this exemplary embodiment, a period between the time t2and the time t3is defined as a delay time310. Nevertheless, the disclosure is not limited thereto. In another exemplary embodiment, for example, the delay time310may also be a period between the time t1and the time t3.

According to the disclosure, the delay time310described above is controlled within a specific range, so as to ensure that the response time of the data processing system100meets a workload requirement that is delay sensitive. In this exemplary embodiment of the disclosure, the first virtual machine118sets an expected delay TML. Further, the first virtual machine118calculates an estimated update rate according to the transfer amount of the dirty pages collected in the preset time TPand the preset time TP, and obtains a parameter according to the estimated update rate. Then, the first virtual machine118calculates the remaining processing time TRaccording to the expected delay TML, the preset time TP, a snapshot time Tbfor generating the corresponding data snapshot, and the aforementioned parameter.

The first virtual machine118calculates a transfer rate according to a transfer amount of a plurality of previous dirty pages (also referred to as a “previous transfer amount”) and a time for transferring these dirty pages (also referred to as a “previous transfer time”). A sum of the preset time TPand the remaining processing time TRmay represent a running time Taof the running operation302before the start time point Tbk. Therefore, the first virtual machine118may obtain an estimated transfer time Tcaccording to the estimated update rate, the running time Ta, and the transfer rate. For example, the first virtual machine118may multiply the estimated update rate by the running time Tato obtain an estimated transfer amount corresponding to the dirty pages collected in the running time Ta, and divide the estimated transfer amount by the transfer rate to obtain the estimated transfer time Tc. The obtained remaining processing time TRmay make the sum of the running time Ta, the snapshot time Tb, and the estimated transfer time Tcnot greater than (i.e., less than or equal to) the set expected delay TML. Thereby, the delay time310is controlled within the specific range.

As described above, the first virtual machine118obtains a parameter according to the estimated update rate. The first virtual machine118obtains the aforementioned parameter according to the estimated update rate and the transfer rate. For example, according to a correlation between the preset time TP, the remaining processing time TR, and the estimated transfer time Tc, the first virtual machine118may calculate a ratio of the estimated update rate to the transfer rate, and adds 1 to the ratio to serve as the aforementioned parameter. Here, RPrepresents the estimated update rate and RAVGrepresents the transfer rate. Therefore, the remaining processing time TRmay be obtained by the following equation (1).
TR=(TML−Tb)/(1+RP/RAVG)−TP(1)

In other words, when the estimated update rate RPis less than the transfer rate RAVG, the remaining processing time TRis relatively large; and when the estimated update rate RPis greater than the transfer rate, the remaining processing time TRis relatively small. In the case where the estimated update rate RPis the maximum update rate, there is no remaining processing time TRleft. The maximum update rate may be the maximum rate for the electronic device140to write data. In other words, the update rate of the dirty pages generated by various workloads does not exceed the maximum update rate. When the estimated update rate RPis the maximum update rate, the transfer amount of the dirty pages that the first virtual machine118collects in the preset time TPis close to or equal to a maximum transfer amount that the first virtual machine118is able to collect in the period of the running operation302before the start time point Tbk.

Based on the above, after obtaining the remaining processing time TR, the first virtual machine118may continue to execute the running operation302or not continue to execute the running operation302but execute the snapshot operation304instead according to the remaining processing time TR.FIG. 4Bis described hereinafter as an example.

FIG. 4Bis a flowchart illustrating the data processing method according to another exemplary embodiment.

With reference toFIG. 3andFIG. 4B, in Step S421, the first virtual machine118executes the running operation302. In Step S423, the first virtual machine118suspends the running operation302at the preset time point Tppin the period of the running operation302, and calculates the remaining processing time TRaccording to the transfer amount of a plurality of first dirty pages that are collected before the preset time point Tppin the period of the running operation. The operations of Steps S421to S423ofFIG. 4Bare the same as the operations of Steps S401to S403ofFIG. 4Aand thus are not repeated hereinafter.

In this exemplary embodiment, after obtaining the remaining processing time TR, the first virtual machine118determines whether to continue to execute the running operation302according to the remaining processing time TR. For example, in Step S425, the first virtual machine118determines whether the remaining processing time TRis greater than 0.

If the remaining processing time TRis greater than 0, the first virtual machine118determines that there is remaining processing time TRleft for continuing to execute the running operation302, and thus executes Step S427. In Step S427, the first virtual machine118continues to execute the running operation302to collect a plurality of second dirty pages according to the remaining processing time TR. When the first virtual machine118continues to execute the running operation302and the remaining processing time TRhas passed, the first virtual machine118determines that the operation of continuing to execute the running operation302to collect a plurality of second dirty pages according to the remaining processing time TR(i.e., Step S427) has been completed. After completing the operation of continuing to execute the running operation302according to the remaining processing time TR, in Step S429, the first virtual machine118suspends the running operation302and executes the snapshot operation304to generate the corresponding data snapshot. In this case, the data snapshot is generated based on the first dirty pages and the second dirty pages. In an exemplary embodiment, the time point of completing the operation of continuing to execute the running operation302according to the remaining processing time TRis equivalent to the start time point Tbk. Therefore, the first virtual machine118executes Step S429at the start time point Tbk. Thereafter, in Step S431, the first virtual machine118executes the transfer operation306to transfer the data snapshot to the second virtual machine128and thereby completes one data processing cycle.

However, if the remaining processing time TRis not greater than 0, the first virtual machine118does not continue to execute the running operation302, but directly executes Step S429. In other words, after determining that there is no remaining processing time TRleft, the first virtual machine118directly executes Step S429to suspend the running operation302and execute the snapshot operation304to generate the corresponding data snapshot. In an exemplary embodiment, the preset time point Tppis equivalent to the start time point Tbk. Because the first virtual machine118does not continue to execute the running operation302, the first virtual machine118does not collect dirty pages other than the first dirty pages before the start time point Tbk. In this case, the data snapshot is generated only based on the first dirty pages. Thereafter, in Step S431, the first virtual machine118executes the transfer operation306to transfer the data snapshot to the second virtual machine128and thereby completes one data processing cycle.

In an exemplary embodiment, the first virtual machine118may divide the collected dirty pages into a plurality of data units, and obtain the transfer amount of the dirty pages according to data units that are actually updated among all the data units. The number of the data units that are actually updated is not greater than the number of the data units divided from the collected dirty pages. When executing the snapshot operation304, the first virtual machine118generates the corresponding data snapshot according to the data units that are actually updated. Take the first dirty pages described above as an example, the first virtual machine118may divide each first dirty page into 128 first data units, and determine one or more second data units that are actually updated among the first data units. A total data amount of the second data units that are actually updated among all the first dirty pages is the transfer amount of all the first dirty pages. The first virtual machine118may obtain the transfer amount of all the second dirty pages in the same manner as described above.

In addition, the first virtual machine118may also estimate the transfer amount afterward according to the transfer amounts corresponding to a plurality of check time points by dividing each dirty page into a plurality of data units as described above. Here, the transfer amount corresponding to one certain check time point refers to the transfer amount of the dirty pages that are collected before this check time point in the period of the running operation. For ease of explanation, the data amount of one data unit is referred to as 1 data unit, and 1 data unit may be a plurality of bits.

In an exemplary embodiment, the estimated transfer amount may be obtained by dividing the transfer amount at one certain check time point by the elapsed time corresponding to this check time point to obtain a value, and multiplying the obtained value by an estimated time. For example, it is assumed that the estimated time is 5 ms and the check is performed per 1 ms. The transfer amount obtained at the first check time point (that is, 1 ms has elapsed) is 2 data units. Therefore, the transfer amount obtained at the time of 5 ms is estimated to be 10 data units. The transfer amount obtained at the second check time point (that is, 2 ms has elapsed) is 5 data units. Therefore, the transfer amount obtained at the time of 5 ms is estimated to be 12.5 data units (i.e., 5/2*5=12.5).

In another exemplary embodiment, the estimated transfer amount may also be obtained by multiplying a transfer amount difference between the transfer amount of one certain check time point and the transfer amount of the previous check time point by an estimated time. For example, it is assumed that the estimated time is 5 ms and the check is performed per 1 ms. The transfer amount obtained at the first check time point (that is, 1 ms has elapsed) is 2 data units, and the transfer amount difference between the start and the first check time point is 2 data units. Therefore, the transfer amount obtained at the time of 5 ms is estimated to be 10 data units (i.e., 2*5=10). The transfer amount obtained at the second check time point (that is, 2 ms has elapsed) is 5 data units, and the transfer amount difference between the second check time point and the first check time point is 3 data units. Therefore, the transfer amount obtained at the time of 5 ms is estimated to be 15 data units (i.e., 3*5=15).

Based on the above-mentioned method for obtaining the estimated transfer amount, optimal values of the expected delay TMLand the preset time point Tppmay be determined through experiment. In an exemplary embodiment, the expected delay TMLmay be set to 10 ms. Moreover, it is assumed that one expected delay TMLis 1 time unit, and the preset time TPcorresponding to the preset time point Tppmay be set to 0.4 time unit. For example, if the expected delay TMLis 10 ms, the preset time TPcorresponding to the preset time point Tppmay be set to 4 ms. In other words, the time point when the running operation302has been executed for 4 ms is the preset time point Tpp.

For example, in the example where the expected delay TMLis 10 ms, the preset time TPis 4 ms. It is assumed that the transfer amount of the dirty pages that the first virtual machine118collects in the preset time TPis equivalent to the size of 100 dirty pages. For example, the size of one dirty page is 4 KB (Bytes), and accordingly the size of 100 dirty pages is 400 KB. Then, based on the transfer amount of the dirty pages collected in the preset time TP, the first virtual machine118calculates the estimated update rate as 100 KB/ms. It is assumed that the transfer rate is 200 KB/ms (equivalent to 50 dirty pages/ms). Therefore, the first virtual machine118may determine that the remaining processing time is 2 ms through calculation according to the equation (1) described above. Accordingly, the first virtual machine118continues executing the running operation302for 2 ms and suspends the running operation302and executes the snapshot operation304.

According to another exemplary embodiment of the disclosure, a computer program product is provided for executing the data processing method described above. The computer program product includes at least one code, and may achieve the function of the data processing method and the data processing system100after the processing device of the electronic device (e.g., the first server110or the second server120) loads and executes the at least one code.

In conclusion, the data processing method, the processing system thereof, and the computer program product according to the exemplary embodiments of the disclosure may estimate the remaining processing time available for continuing to execute the running operation according to the transfer amount of the collected dirty pages to dynamically adjust the time of executing the running operation and determine the start time point. Thereby, the delay time is controlled within the specific expected delay time, so as to effectively prevent service interruption caused by the delay-sensitive workload requirement due to long delay time, and improve user experience.