CN107291527B - Pre-copy migration stop pre-judgment method and device - Google Patents

Pre-copy migration stop pre-judgment method and device Download PDF

Info

Publication number
CN107291527B
CN107291527B CN201710370661.7A CN201710370661A CN107291527B CN 107291527 B CN107291527 B CN 107291527B CN 201710370661 A CN201710370661 A CN 201710370661A CN 107291527 B CN107291527 B CN 107291527B
Authority
CN
China
Prior art keywords
migration
copy migration
round
copy
finished
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201710370661.7A
Other languages
Chinese (zh)
Other versions
CN107291527A (en
Inventor
陈晓
李龙
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Huawei Technologies Co Ltd
Original Assignee
Huawei Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Priority to CN201710370661.7A priority Critical patent/CN107291527B/en
Publication of CN107291527A publication Critical patent/CN107291527A/en
Application granted granted Critical
Publication of CN107291527B publication Critical patent/CN107291527B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/4557Distribution of virtual machine instances; Migration and load balancing

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Memory System (AREA)
  • Retry When Errors Occur (AREA)

Abstract

The embodiment of the application provides a pre-copy migration stop prejudging method and device, and solves the problem that a pre-copy migration stage cannot be stopped in time in the prior art. The method comprises the following steps: acquiring a value of at least one preset parameter after the ith round of pre-copy migration is finished, wherein the at least one preset parameter comprises the internal memory dirty page number, the internal memory dirty page number after the ith round of pre-copy migration is the modified quantity of the internal memory page from the i-1 th round of pre-copy migration to the ith round of pre-copy migration, i is more than 1 and less than N, and i is a positive integer; determining a first threshold value according to the dirty memory pages, wherein the first threshold value is the threshold value of the dirty memory pages after the ith round of pre-copy migration is finished; and if the internal memory dirty pages are smaller than the first threshold value, stopping the pre-copy migration stage.

Description

Pre-copy migration stop pre-judgment method and device
Technical Field
The application relates to the technical field of virtualization, in particular to a method and a device for prejudging stop of pre-copy migration.
Background
Live migration (live migration) is an extremely important part of virtualization technology, and a migrated system can be migrated from a source location to a target location online by using the live migration technology under the condition that the load in the migrated system is ensured to be unaware.
The current major live migration method is the pre-copy (pre-copy) method, which includes a pre-copy migration phase and a stop copy phase. In the pre-copy migration stage, a write-copy technology is utilized to firstly transmit a memory mirror image of the whole system, continuously generated memory dirty pages are tracked in the transmission process, each round of pre-copy migration stage transmits the previous round of memory dirty pages, and when a pre-copy stop condition is triggered, a stop copy stage is entered. In the shutdown copy stage, the virtual machine on the source physical host is suspended, and the state of a Central Processing Unit (CPU) and the last round of unsynchronized dirty memory pages are copied to the destination physical host. Finally, the virtual machine may resume running on the destination physical host.
The current pre-copy stop condition includes that the number of the remaining internal dirty pages is smaller than a preset threshold or the iteration number exceeds a set maximum iteration number. However, the number of dirty memory pages in the live migration process cannot be controlled or predicted, and when the transmission rate is lower than the modified memory rate, the number of dirty memory pages cannot meet the preset threshold condition, so that the iteration can only be stopped until the iteration number exceeds the set maximum iteration number, which obviously results in a long time for entering the shutdown copy stage, and further results in an overlong total migration time.
Therefore, how to enter the shutdown copy stage in time when performing the live migration by the pre-copy method, so as to shorten the total migration time, is a problem to be solved at present.
Disclosure of Invention
The embodiment of the application provides a pre-copy migration stop prejudging method and device, so that when the pre-copy method is used for carrying out hot migration, a shutdown copying stage is timely started, and the total migration time is shortened.
In order to achieve the above purpose, the embodiment of the present application adopts the following technical solutions:
in one aspect, a method for prejudging a stop of pre-copy migration is provided, where the method includes: acquiring a value of at least one preset parameter after the ith round of pre-copy migration is finished, wherein the at least one preset parameter comprises the internal memory dirty page number, the internal memory dirty page number after the ith round of pre-copy migration is the number of internal memory page modifications from the end of the ith-1 round of pre-copy migration to the end of the ith round of pre-copy migration, i is more than 1 and less than N, and i is a positive integer; determining a first threshold value according to the dirty memory number, wherein the first threshold value is the threshold value of the dirty memory number after the ith round of pre-copy migration is finished; and if the internal memory dirty page number is smaller than the first threshold value, stopping the pre-copy migration stage. According to the pre-copy migration stop pre-judging method provided by the embodiment of the application, the value of at least one preset parameter after the ith round of pre-copy migration is finished is obtained, the at least one preset parameter comprises the internal memory dirty number, the first threshold value can be determined according to the internal memory dirty number generated by the ith round of pre-copy migration, and the first threshold value is related to the actual running condition of a migrated system, so that the shutdown copying stage can be timely entered according to the running condition of the system, and the total migration time is shortened.
In a possible implementation manner, the at least one preset parameter further includes the number i of the transferred rounds after the i-th round of pre-copy transfer is finished; after the determining the first threshold according to the number of the dirty pages in the memory, the method further includes: if the internal memory dirty page number is not less than the first threshold value and i is greater than a second threshold value, stopping the pre-copy migration stage, wherein the second threshold value is the threshold value of the number i of the migrated rounds after the ith round of pre-copy migration is finished; and if the internal memory dirty page number is not less than the first threshold value and i is not greater than the second threshold value, determining a third threshold value according to the internal memory dirty page number, wherein the third threshold value is a threshold value of the number i +1 of the transferred rounds after the i +1 round of pre-copy migration is finished. According to the pre-copy migration stop pre-judging method provided by the embodiment of the application, the value of at least one preset parameter after the ith round of pre-copy migration is finished is obtained, the at least one preset parameter further comprises the number i of the rounds that have been migrated after the ith round of pre-copy migration is finished, on one hand, the threshold value of the number of internal memory dirty pages is firstly judged, the threshold value of the number of the migrated rounds is judged under the condition that the number of the internal memory dirty pages is not smaller than the first threshold value, and the pre-copy migration stop pre-judging device stops the pre-copy migration stage under the condition that i is larger than the second threshold value, so that the pre-copy migration stop stage can be judged timely according to the preset parameter; on the other hand, the threshold value of the internal memory dirty number is judged firstly, when the internal memory dirty number is not smaller than the first threshold value, the threshold value of the number of the migration turns is judged, when i is not larger than the second threshold value, the pre-copy migration stop pre-judging device determines the third threshold value, and the threshold value of the number i of the next round of pre-copy migration turns can be determined, so that whether the pre-copy migration stage is stopped in time or not can be determined according to the third threshold value during the next round of pre-copy migration.
In a possible implementation manner, determining the first threshold according to the number of internal dirty pages includes: determining the internal memory dirty page rate after the ith round of pre-copy migration is finished according to the internal memory dirty page number, wherein the internal memory dirty page rate after the ith round of pre-copy migration is the rate of internal memory page modification after the ith-1 round of pre-copy migration is finished and after the ith round of pre-copy migration is finished; acquiring the internal memory dirty page rate after the i-1 st round of pre-copy migration is finished; determining the first threshold value by combining a first preset formula according to the dirty page rate of the memory after the ith round of pre-copy migration is finished, the dirty page rate of the memory after the ith-1 round of pre-copy migration is finished and a fourth threshold value, wherein the fourth threshold value is the threshold value of the dirty page number of the memory after the ith-1 round of pre-copy migration is finished; the first preset formula includes:
Figure GDA0002273460980000021
wherein D isi,minRepresents the first threshold value, Di-1,minRepresents the fourth threshold value, ViIndicating the i-th round of pre-copyingDirty page rate in memory after migration is finished, Vi-1And the dirty page rate of the internal memory after the i-1 th round of pre-copy migration is finished is shown. Based on the scheme, the threshold value of the dirty page number in the pre-copy migration of the ith round can be determined according to the memory dirty page rate of the pre-copy migration of the ith round-1, the memory dirty page rate of the pre-copy migration of the ith round and the threshold value of the dirty page number in the pre-copy migration of the ith round-1, and when the threshold value is used, the threshold value of the dirty page number in the pre-copy migration of the ith round is determined
Figure GDA0002273460980000022
When the number of the dirty pages in the memory per unit time is more than or equal to 1, the change of the dirty pages in the memory per unit time is large, the modification of the memory pages by the load is frequent at this time, and the overlong pre-copy migration stage can reduce the total migration time and the downtime, so that the pre-copy migration stage needs to be ended as soon as possible, and the threshold value of the dirty pages in the memory needs to be increased at this time, so that the migrated system stops the pre-copy migration stage according to the threshold value of the dirty pages
Figure GDA0002273460980000023
When the number of the dirty pages in the memory is less than 1, the change of the number of the dirty pages in the memory per unit time is small, the load does not frequently modify the memory pages, and the total migration time and the downtime can be reduced through a pre-copy migration stage. Therefore, the threshold value of the dirty number of the memory adopted in each round in the embodiment of the application is related to the actual operation condition of the migrated system, so that whether the migrated system needs to stop the pre-copy migration stage in the live migration process can be reflected in time according to the threshold value of the dirty number of the memory, and the total migration time is shortened.
In a possible implementation manner, determining the third threshold according to the number of internal dirty pages includes: determining the internal memory dirty page rate after the ith round of pre-copy migration is finished according to the internal memory dirty page number, wherein the internal memory dirty page rate after the ith round of pre-copy migration is the rate of internal memory page modification after the ith-1 round of pre-copy migration is finished and after the ith round of pre-copy migration is finished; acquiring the memory writing speed in the pre-copy migration stage and the network transmission speed in the pre-copy migration stage; according to the memory writing speed of the pre-copy migration stage, the network transmission speed of the pre-copy migration stage and the i-th round of pre-copy migration after finishingDetermining the third threshold value by combining the dirty page rate of the internal memory and the second threshold value and a second preset formula; the second predetermined formula includes:
Figure GDA0002273460980000031
wherein N isi+1,maxRepresents the third threshold value, VmenIndicates the memory write speed, VnetIndicates the network transmission speed, Ni,maxRepresents the second threshold value, ViIndicating the internal memory dirty page rate after the ith round of pre-copy migration is finished,
Figure GDA0002273460980000032
means taking greater than
Figure GDA0002273460980000033
Is the largest integer of (a). Based on the scheme, the pre-copy migration stop pre-judgment device can realize that the pre-copy migration stop pre-judgment device is to be used for judging the pre-copy migration stop time according to the memory writing-in speed, the network transmission speed, the threshold value of the number i of the rounds of migration after the ith round of pre-copy migration is finished and the memory dirty page rate of the ith round of pre-copy
Figure GDA0002273460980000034
And Ni,maxThe minimum value in the pre-copy migration period is determined as a threshold value of the number of the (i + 1) rounds which have been migrated after the (i + 1) th round of pre-copy migration is finished, when the internal memory dirty page rate is increased, the internal memory page modification is frequent, the migration total time is increased when the pre-copy migration period is too long, and according to a second preset formula, the internal memory dirty page rate is increased
Figure GDA0002273460980000035
And
Figure GDA0002273460980000036
the smaller, the threshold of the number of rounds that have been migrated can therefore be made to decrease with increasing internal dirty page rate, which can stop the pre-copy migration phase in time.
In a possible implementation manner, determining the internal dirty page rate after the i-th round of pre-copy migration is finished according to the internal dirty page number includes: obtaining the ith roundTime taken for copy migration; determining the internal memory dirty page rate after the ith round of pre-copy migration is finished by combining a third preset formula according to the time used by the ith round of pre-copy migration and the internal memory dirty page number; the third predetermined formula includes:
Figure GDA0002273460980000037
wherein D isiIndicates the dirty page number m of the internal memory after the ith round of pre-copy migration is finished0Indicates the unit memory page size, LiIndicating the time taken for the i-th round of pre-copy migration. Based on the scheme, the dirty page number D in the memory of the ith round of pre-copy migration can be obtainediThe time for finishing the pre-copy migration of the ith round and the page size m of the unit memory0Internal dirty page rate V for realizing acquisition of ith round of pre-copy migrationi
In a possible implementation manner, after determining the memory dirty page rate after the i-th round of pre-copy migration is finished according to the memory dirty page number, the method further includes: and if the internal memory dirty page number is not less than the first threshold value and the internal memory dirty page rate after the ith round of pre-copy migration is finished is greater than a fifth threshold value, stopping the pre-copy migration stage, wherein the fifth threshold value is a preset threshold value of the internal memory dirty page rate of the pre-copy migration stage. Based on the scheme, firstly, the threshold value of the memory dirty page number is judged, the threshold value of the memory dirty page rate is further judged under the condition that the memory dirty page number is not smaller than the first threshold value, the pre-copy migration stop pre-judgment device stops the pre-copy migration stage under the condition that the memory dirty page rate is larger than the fifth threshold value, whether the pre-copy migration stage is stopped in time can be determined at multiple angles, the condition of stopping the pre-copy migration stage can be timely reached by timely and adaptively adjusting the threshold value corresponding to the preset parameter according to the condition of the system through the judgment of the mutual combination of multiple parameters, the shutdown and copying stage can be timely started, the total migration time is shortened, the shutdown time in the pre-copy migration stage is shortened, the system operation efficiency can be further improved, and a wider migration scene can be adapted.
In a possible implementation manner, the at least one parameter further includes estimated total downtime after the i-th round of pre-copy migration is finished; after the determining the first threshold according to the number of the dirty pages in the memory, the method further includes: and if the internal memory dirty pages are not smaller than the first threshold value and the estimated total downtime is larger than a sixth threshold value, stopping the pre-copy migration stage, wherein the sixth threshold value is a preset threshold value of the total downtime. Based on the scheme, the pre-copy migration stop pre-judging device can also obtain the estimated total shutdown time after the ith round of pre-copy migration is finished, when the number of internal memory pages is determined to be not less than the first threshold value, the pre-copy migration stop pre-judging device stops the pre-copy migration stage by judging the relationship between the estimated total shutdown time and the sixth threshold value and if the estimated total shutdown time is not greater than the sixth threshold value, the pre-copy migration stop pre-judging device can realize a plurality of angles to determine whether the pre-copy migration stage is stopped in time, and can timely enter the pre-copy shutdown stage by adaptively adjusting the threshold value corresponding to the preset parameter according to the condition of the system through the judgment of the mutual combination of a plurality of parameters, so that the total migration time is shortened, the shutdown time in the pre-copy migration stage is shortened, and the running efficiency of the system is improved, and may accommodate a wider range of migration scenarios.
In a possible implementation manner, obtaining the estimated total downtime after the i-th round of pre-copy migration is finished includes: determining estimated total shutdown time after the ith round of pre-copy migration is finished according to a fourth preset formula; the fourth predetermined formula includes:
Figure GDA0002273460980000041
wherein, TT,iRepresenting the estimated total downtime after the ith round of pre-copy migration is finished,
Figure GDA0002273460980000042
represents the accumulated downtime T from the end of the 1 st round of pre-copy migration to the end of the ith round of pre-copy migration in the pre-copy migration stage1Indicating the downtime, T, used for the shutdown copy migration phaseiIndicating the downtime for the i-th round of pre-copy migration. Based on the scheme, the pre-copy migration stop pre-judging device can realize acquisitionAnd pre-copying the estimated total shutdown time after the transfer of the ith round is finished.
In a possible implementation manner, the at least one parameter further includes estimated total migration time after the ith round of pre-copy migration is finished; after the determining the first threshold according to the number of the dirty pages in the memory, the method further includes: and if the internal memory dirty page number is not less than the first threshold value and the estimated total migration time is greater than a seventh threshold value, stopping the pre-copy migration stage, wherein the seventh threshold value is a preset threshold value of the total migration time. Based on the scheme, the pre-copy migration stop pre-judging device can also obtain the estimated total shutdown time after the ith round of pre-copy migration is finished, when the number of the dirty pages in the internal memory is determined to be not more than the first threshold value, the pre-copy migration stop pre-judging device can stop the pre-copy migration stage by judging the relationship between the estimated total migration time and the seventh threshold value and if the estimated total migration time is not less than the seventh threshold value, so that whether the pre-copy migration stage is stopped in time can be determined by multiple angles, the condition of stopping the pre-copy migration stage can be timely reached by timely and adaptively adjusting the threshold value of the corresponding preset parameter according to the condition of the system through the judgment of the mutual combination of multiple parameters, the shutdown and the total migration time can be shortened, the shutdown time in the pre-copy migration stage can be further improved, and the efficiency of system operation can be further improved, and may accommodate a wider range of migration scenarios.
In a possible implementation manner, obtaining the estimated total migration time after the i-th round of pre-copy migration is finished includes:
determining the estimated total migration time after the ith round of pre-copy migration is finished according to a fifth preset formula; the fifth predetermined formula includes:
Figure GDA0002273460980000043
wherein, TQ,iThe estimated total migration time after the ith round of pre-copy migration is finished,
Figure GDA0002273460980000044
represents the cumulative time, T, taken for the 1 st round of pre-copy migration to the ith round of pre-copy migration in the pre-copy migration stageL,1To representTotal time for migration of the shutdown copy migration phase, TL,iIndicating the time taken for migration after the end of the i-th round of pre-copy migration. Based on the scheme, the pre-copy migration stop pre-judging device can obtain the estimated total shutdown time after the ith round of pre-copy migration is finished.
In another aspect, a pre-copy migration stop pre-judging device is provided, where the pre-copy migration stop pre-judging device has a function of implementing a terminal behavior in the above method. The function can be realized by hardware, and can also be realized by executing corresponding software by hardware. The hardware or software includes one or more modules corresponding to the functions described above.
In another aspect, a pre-copy migration stop anticipation apparatus is provided, including: a processor, a memory, and a communication interface; the memory is used for storing computer execution instructions, and when the pre-copy migration stop anticipation device runs, the processor executes the computer execution instructions stored in the memory, so that the pre-copy migration stop anticipation device executes the pre-copy migration stop anticipation method in each aspect.
In yet another aspect, the present application provides a computer-readable storage medium, which stores instructions that, when executed on a computer, cause the computer to execute the method for pre-copy migration stop anticipation of the above aspects.
In yet another aspect, the present application provides a computer program product containing instructions that, when executed on a computer, cause the computer to perform the method for pre-copy migration stop anticipation of the above aspects.
In addition, the technical effects brought by any design method in the above device embodiments may refer to the technical effects brought by different design methods in the above pre-copy migration stop pre-determination method embodiments, and are not described herein again.
These and other aspects of the present application will be more readily apparent from the following description of the embodiments.
Drawings
FIG. 1 is a block diagram of a thermal migration system according to an embodiment of the present disclosure;
FIG. 2 is a schematic diagram of a computer device according to an embodiment of the present application;
fig. 3 is a schematic flowchart of a method for pre-copy migration stop pre-determination according to an embodiment of the present application;
fig. 4 is a schematic flowchart of another method for pre-copy migration stop pre-judgment according to an embodiment of the present application;
FIG. 5 is a schematic diagram illustrating a logical process of hot migration according to an embodiment of the present application;
FIG. 6 is a schematic diagram of a computing system live migration downtime and migration time provided by an embodiment of the present application;
fig. 7 is a schematic diagram of a specific execution flow of pre-copy migration stop pre-judgment according to an embodiment of the present application;
fig. 8 is a schematic structural diagram of a pre-copy migration stop pre-determination apparatus according to an embodiment of the present application;
fig. 9 is a schematic structural diagram of another pre-copy migration stop anticipation device according to an embodiment of the present application.
Detailed Description
First, in order to facilitate understanding of the scheme of the present application, definitions related to the present application are given.
The system comprises the following steps: refer to migratable target instance objects such as: processes, virtual machines, containers, and the like.
Loading: refers to an application deployed in a system.
Checking points: refers to restoring the computational state data required for program execution.
Checking the point file: it means that the checkpoint data is stored in a stable memory in the form of a file, called a checkpoint file.
Checking the point time: refers to the time when the system checkpoints the system during operation.
And (3) storing a dirty page: refers to the memory page that was modified.
Internal dirty page rate: refers to the number of memory pages modified per unit time.
The shutdown time is as follows: refers to the blocking time of the live migration to the load on the migrated system.
Total migration time: refers to the time from the beginning of the system's warm migration to the completion of the system's warm migration.
The technical solutions in the embodiments of the present application will be described below with reference to the drawings in the embodiments of the present application.
It should be noted that "/" in this context means "or", for example, A/B may mean A or B; "and/or" herein is merely an association describing an associated object, and means that there may be three relationships, e.g., a and/or B, which may mean: a exists alone, A and B exist simultaneously, and B exists alone. "plurality" means two or more than two.
It should be noted that in the embodiments of the present application, words such as "exemplary" or "for example" are used to indicate examples, illustrations or explanations. Any embodiment or design described herein as "exemplary" or "e.g.," is not necessarily to be construed as preferred or advantageous over other embodiments or designs. Rather, use of the word "exemplary" or "such as" is intended to present concepts related in a concrete fashion.
It should be noted that in the embodiments of the present application, "of", "corresponding" and "corresponding" may be sometimes used in combination, and it should be noted that the intended meaning is consistent when the difference is not emphasized.
Fig. 1 is a schematic diagram of a thermal migration system according to an embodiment of the present application, including: the system comprises a migrated system at a source position, a migrated system at a target position, a checkpoint service module, a checkpoint setting module, a data synchronization module, a migration daemon module, a recovery module and a log module. The disk images of the migrated system at the source position and the migrated system at the target position adopt a shared storage mode.
The following briefly introduces modules in a hot migration system architecture provided in an embodiment of the present application:
the checkpoint service module: and the method is responsible for flow control of the system in the hot migration process, such as pre-copy migration stage stop triggering, checkpoint file synchronization switching and the like.
A checkpoint setting module: the method mainly comprises the steps of setting a check point for a migrated system of a source position, and storing data of the migrated system of the source position during operation, wherein the data comprises a CPU register, memory data, a lock and the like.
A data synchronization module: the method is used for synchronizing the checkpoint file of the source position to the target position in a real-time synchronization mode, and in order to reduce IO (input/output) overhead, the memory file system is used as stable storage of the checkpoint file.
The migration daemon module: and the shutdown trigger of the migrated system of the source position and the recovery trigger of the migrated system of the target position are responsible for the system live migration process.
A recovery module: the migrated system, which is responsible for restoring the target location from the specified checkpoint file, includes reconstruction of CPU registers, memory data, locks, etc.
A log module: responsible for logging of other modules, etc.
As shown in fig. 2, the pre-copy migration stop anticipation means in the embodiment of the present application may be implemented by a computer device (or system) in fig. 2.
Fig. 2 is a schematic diagram of a computer device according to an embodiment of the present application. The computer device 200 comprises at least one processor 201, a communication bus 202, a memory 203 and at least one communication interface 204.
The processor 201 may be a general processing unit (CPU), a microprocessor, an application-specific integrated circuit (ASIC), or one or more ics for controlling the execution of programs in accordance with the present invention.
The communication bus 202 may include a path that conveys information between the aforementioned components.
The communication interface 204 may be any device, such as a transceiver, for communicating with other devices or communication networks, such as an ethernet, a Radio Access Network (RAN), a Wireless Local Area Network (WLAN), etc.
The memory 203 may be a read-only memory (ROM) or other type of static storage device that can store static information and instructions, a Random Access Memory (RAM) or other type of dynamic storage device that can store information and instructions, an electrically erasable programmable read-only memory (EEPROM), a compact disc read-only memory (CD-ROM) or other optical disk storage, optical disk storage (including compact disc, laser disc, optical disc, digital versatile disc, blu-ray disc, etc.), magnetic disk storage media or other magnetic storage devices, or any other medium that can be used to carry or store desired program code in the form of instructions or data structures and that can be accessed by a computer, but is not limited to these. The memory may be self-contained and coupled to the processor via a bus. The memory may also be integral to the processor.
The memory 203 is used for storing application program codes for executing the scheme of the application, and the processor 201 controls the execution. The processor 201 is configured to execute the application program code stored in the memory 203, so as to implement the method for pre-copy migration stop anticipation in the embodiment of the present application.
In particular implementations, processor 201 may include one or more CPUs such as CPU0 and CPU1 in fig. 2, for example, as one embodiment.
In particular implementations, computer device 200 may include multiple processors, such as processor 201 and processor 208 in FIG. 2, as an example. Each of these processors may be a single-core (single-CPU) processor or a multi-core (multi-CPU) processor. A processor herein may refer to one or more devices, circuits, and/or processing cores for processing data (e.g., computer program instructions).
In particular implementations, computer device 200 may also include an output device 205 and an input device 206, as one embodiment. The output device 205 is in communication with the processor 201 and may display information in a variety of ways. For example, the output device 205 may be a Liquid Crystal Display (LCD), a Light Emitting Diode (LED) display device, a Cathode Ray Tube (CRT) display device, a projector (projector), or the like. The input device 206 is in communication with the processor 201 and can accept user input in a variety of ways. For example, the input device 206 may be a mouse, a keyboard, a touch screen device, or a sensing device, among others.
The computer device 200 described above may be a general purpose computer device or a special purpose computer device. In a specific implementation, the computer device 200 may be a desktop computer, a laptop computer, a web server, a Personal Digital Assistant (PDA), a mobile phone, a tablet computer, a wireless terminal device, a communication device, an embedded device, or a device with a similar structure as in fig. 2. The embodiment of the present application does not limit the type of the computer device 200.
Fig. 3 is a schematic flow chart of a method for pre-copy migration stop pre-determination according to an embodiment of the present application.
S301, the pre-copy migration stopping pre-judging device obtains the value of at least one preset parameter after the ith round of pre-copy migration is finished.
The at least one preset parameter comprises the dirty memory page number, the dirty memory page number after the ith round of pre-copy migration is the modified number of the memory page after the ith-1 round of pre-copy migration is finished and after the ith round of pre-copy migration is finished, i is more than 1 and less than N, and i is a positive integer.
S302, the pre-copy migration stop pre-judging device determines a first threshold value according to the internal memory dirty page number.
And the first threshold is the threshold of the number of the dirty pages in the memory after the ith round of pre-copy migration is finished.
And S303, if the number of the internal memory dirty pages is less than the first threshold value, the pre-copy migration stop pre-judging device stops the pre-copy migration stage.
It should be noted that the pre-copy migration stop prejudging method provided by the embodiment of the present application can be applied to a live migration process of a system, where the live migration process includes two stages, a pre-copy migration stage and a shutdown copy migration stage, the first N-1 round of migration is the pre-copy migration stage, and the nth round of migration is the shutdown copy migration stage. The pre-copy migration stopping and pre-judging device can suspend the running system in each round of pre-copy migration process, restore the system running after the round of pre-copy migration is completed, and suspend the running system again when the next round of pre-copy migration is performed until the round of pre-copy migration is completed. In the shutdown copy migration stage, the system always stops running in the migration process, and in order to ensure the consistency of the running states of the system before and after the live migration, the internal memory dirty pages and other contents of the system, such as open files, network programming interfaces and other data generated from the last round of pre-copy migration stage to the shutdown copy stage, are all copied to the system at the migrated position in the shutdown copy stage.
Generally, during the 1 st round of pre-copy migration, the pre-copy migration stop pre-determination device identifies the memory pages occupied by the migrated system, stores the memory pages occupied by the migrated system in the checkpoint file and counts the number of the memory pages occupied by the migrated system, and after each round of pre-copy migration, the pre-copy migration stop pre-determination device needs to synchronize the checkpoint files of the migrated system at the source location and the target location. Optionally, after the 1 st round of migration, it may be determined whether the number of memory pages occupied by the migrated system is smaller than a preset threshold of the number of dirty memory pages, and if the counted number of memory pages occupied by the migrated system is smaller than the preset threshold of the number of dirty memory pages, the shutdown copy migration stage may be directly entered; and if the counted number of the memory pages occupied by the migration system is more than or equal to the preset threshold of the dirty number of the memory, executing the 2 nd round of pre-copy migration operation.
It should be noted that, during the 1 st round of pre-copy migration, there is no internal memory dirty page in the migrated system, and the internal memory page at this time is a page occupied by the system before the hot migration, and after the 1 st round of pre-copy migration is completed, the migrated system operates again to modify the internal memory page, and the internal memory dirty page starts to appear. Generally, starting from the 2 nd round of pre-copy migration, only the internal memory dirty pages generated by the migration system in the previous round of pre-copy migration are saved in the checkpoint file.
Optionally, only the memory dirty page generated by the migration system in the previous round of pre-copy migration process may be saved in the checkpoint file according to the existing memory dirty page tracking mechanism.
Optionally, in order to reduce downtime caused by IO operations, the checkpoint file is stored in the memory file system in the embodiment of the present application, and of course, the checkpoint file may also be stored in another stable memory, which is not specifically limited in the embodiment of the present application.
According to the pre-copy migration stop pre-judging method provided by the embodiment of the application, the value of at least one preset parameter after the ith round of pre-copy migration is finished is obtained, the at least one preset parameter comprises the internal memory dirty number, the first threshold value can be determined according to the internal memory dirty number generated by the ith round of pre-copy migration, and the first threshold value is related to the actual running condition of a migrated system, so that the shutdown copying stage can be timely entered according to the running condition of the system, and the total migration time is shortened.
The actions of the devices in step S301, step S302, and step S303 may be executed by the processor 201 in the computer device 200 shown in fig. 2 calling the application program code stored in the memory 203, which is not limited in this embodiment of the present application.
In a possible implementation manner, the at least one preset parameter further includes the number i of the migrated rounds after the i-th round of pre-copy migration is finished, as shown in fig. 4, step S303 includes S303A and S303B:
S303A, if the dirty page number in the memory is not less than the first threshold and i is greater than the second threshold, the pre-copy migration stop pre-determination device stops the pre-copy migration stage.
And the second threshold is the threshold of the number i of the transferred rounds after the ith round of pre-copy transfer is finished.
S303B, if the dirty memory number is not less than the first threshold and i is not greater than the second threshold, the pre-copy migration stop pre-determination device determines a third threshold according to the dirty memory number.
And the third threshold is a threshold of the number i +1 of the transferred rounds after the i +1 round of pre-copy transfer is finished.
Generally, before the system hot migration is executed, the pre-copy migration stop pre-judging device may preset a value according to an empirical value as an initial value of the threshold value of the number of rounds of pre-copying, which is not specifically limited in this embodiment of the present application.
According to the pre-copy migration stop pre-judging method provided by the embodiment of the application, the value of at least one preset parameter after the ith round of pre-copy migration is finished is obtained, the at least one preset parameter further comprises the number i of the rounds that have been migrated after the ith round of pre-copy migration is finished, on one hand, the threshold value of the number of internal memory dirty pages is firstly judged, the threshold value of the number of the migrated rounds is judged under the condition that the number of the internal memory dirty pages is not smaller than the first threshold value, and the pre-copy migration stop pre-judging device stops the pre-copy migration stage under the condition that i is larger than the second threshold value, so that the pre-copy migration stop stage can be judged timely according to the preset parameter; on the other hand, the threshold value of the internal memory dirty number is judged firstly, when the internal memory dirty number is not smaller than the first threshold value, the threshold value of the number of the migration turns is judged, when i is not larger than the second threshold value, the pre-copy migration stop pre-judging device determines the third threshold value, and the threshold value of the number i of the next round of pre-copy migration turns can be determined, so that whether the pre-copy migration stage is stopped in time or not can be determined according to the third threshold value during the next round of pre-copy migration.
The actions of the above-mentioned means in step S303A and step S303B may be executed by the processor 201 in the computer device 200 shown in fig. 2 calling the application program code stored in the memory 203, which is not limited in this embodiment of the present application.
In a possible implementation manner, the step S302 may specifically include steps S302A-S302C:
S302A, the pre-copy migration stop pre-judging device determines the internal dirty page rate after the i-th round of pre-copy migration is finished according to the internal dirty page number.
And the memory dirty page rate after the ith round of pre-copy migration is the memory page modification rate from the ith-1 round of pre-copy migration to the ith round of pre-copy migration.
S302B, the pre-copy migration stop pre-judging device obtains the internal memory dirty page rate after the i-1 st round of pre-copy migration is finished.
S302C, the pre-copy migration stop pre-judging device determines the first threshold value according to the internal dirty page rate after the ith round of pre-copy migration is finished, the internal dirty page rate after the ith-1 round of pre-copy migration is finished and the fourth threshold value in combination with the formula (1).
And the fourth threshold is the threshold of the number of the internal dirty pages after the i-1 th round of pre-copy migration is finished.
Figure GDA0002273460980000091
Wherein D isi,minDenotes a first threshold value, Di-1,minDenotes a fourth threshold value, ViRepresenting the dirty page rate, V, of the memory after the ith round of pre-copy migration is finishedi-1And the internal memory dirty page rate after the i-1 th round of pre-copy migration is finished is shown.
Generally, before the system hot migration is executed, the pre-copy migration stop pre-determination device may preset a value according to an empirical value as an initial value of the threshold value of the number of dirty pages in the pre-copy migration stage, which is not specifically limited in this embodiment of the present application.
Specifically, the threshold D for determining the threshold of the dirty page number in the 2 nd round of pre-copy1,minIs a predetermined threshold value Dmin
Based on the scheme, the threshold value of the dirty page number in the pre-copy migration of the ith round can be determined according to the memory dirty page rate of the pre-copy migration of the ith round-1, the memory dirty page rate of the pre-copy migration of the ith round and the threshold value of the dirty page number in the pre-copy migration of the ith round-1, and when the threshold value is used, the threshold value of the dirty page number in the pre-copy migration of the ith round is determined
Figure GDA0002273460980000092
When the number of the internal memory dirty pages in unit time is more than or equal to 1, the change of the internal memory dirty pages in unit time is large, the load modifies the internal memory pages frequently at the moment, and the overlong pre-copy migration stage reduces the total migration time and the downtime, so that the pre-copy migration stage needs to be ended as soon as possible, and the threshold value of the internal memory dirty pages needs to be increased at the moment, so that the migrated system stops the pre-copy migration stage according to the threshold value of the internal memory dirty pages in time,when in use
Figure GDA0002273460980000093
When the number of the dirty pages in the memory is less than 1, the change of the number of the dirty pages in the memory per unit time is small, the load does not frequently modify the memory pages, and the total migration time and the downtime can be reduced through a pre-copy migration stage. Therefore, the threshold value of the dirty number of the memory adopted in each round in the embodiment of the application is related to the actual operation condition of the migrated system, so that whether the migrated system needs to stop the pre-copy migration stage in the live migration process can be reflected in time according to the threshold value of the dirty number of the memory, and the total migration time is shortened.
The actions of the devices in step S302A, step S302B, and step S302B may be executed by the processor 201 in the computer device 200 shown in fig. 2 calling the application program code stored in the memory 203, which is not limited in this embodiment.
In a possible implementation manner, the determining, by the pre-copy migration stop pre-judging device, the third threshold according to the number of internal dirty pages includes steps W1-W3:
w1, the pre-copy migration stop pre-judging device determines the internal memory dirty page rate after the i-th round of pre-copy migration is finished according to the internal memory dirty page number.
And the memory dirty page rate after the ith round of pre-copy migration is the memory page modification rate from the ith-1 round of pre-copy migration to the ith round of pre-copy migration.
W2, the pre-copy migration stop pre-judging device obtains the memory writing speed in the pre-copy migration stage and the network transmission speed in the pre-copy migration stage.
W3, determining a third threshold value by the pre-copy migration stop pre-judging device according to the memory writing speed in the pre-copy migration stage, the network transmission speed in the pre-copy migration stage, the memory dirty page rate after the ith round of pre-copy migration is finished and the second threshold value, in combination with the formula (2).
Figure GDA0002273460980000101
Wherein N isi+1,maxDenotes a third threshold value, VmenIndicates the memory write speed, VnetIndicating the network transmission speed, Ni,maxDenotes a second threshold value, ViIndicating the internal memory dirty page rate after the ith round of pre-copy migration is finished,
Figure GDA0002273460980000102
means taking greater than
Figure GDA0002273460980000103
Is the largest integer of (a).
According to the formula (2), the threshold of the number of migrated rounds is related to the internal dirty page rate. In practical application, the dirty memory page is generated only after the 1 st round of pre-copy migration is finished, that is, the dirty memory page rate starts to exist, so that the threshold of the number of pre-copy migration rounds used in the 1 st round of pre-copy migration is the preset threshold NmaxAnd when the pre-copy migration stop pre-judgment device determines that the internal dirty page number is not less than the first threshold value and i is not greater than the second threshold value, determining the threshold value of the number of the 2 nd pre-copy migration rounds. Wherein the threshold N for round 2 is determined1,maxFor presetting a threshold value Nmax
It should be noted that the determined threshold of the (i + 1) th round is a threshold used by the pre-copy migration stop pre-determination device after the (i + 1) th round of migration to determine whether the value of the preset parameter exceeds the threshold range of the preset parameter, and details are not described below.
Based on the scheme, the pre-copy migration stop pre-judgment device can realize that the pre-copy migration stop pre-judgment device is to be used for judging the pre-copy migration stop time according to the memory writing-in speed, the network transmission speed, the threshold value of the number i of the rounds of migration after the ith round of pre-copy migration is finished and the memory dirty page rate of the ith round of pre-copy
Figure GDA0002273460980000104
And Ni,maxThe minimum value in the pre-copy migration is determined as a threshold value of the number of the (i + 1) rounds which have been migrated after the (i + 1) th round of pre-copy migration is finished, when the internal memory dirty page rate is increased, the internal memory page modification is frequent, the migration total time is increased when the pre-copy migration stage is too long, and according to a formula (2), the internal memory dirty page rate is increased
Figure GDA0002273460980000105
And
Figure GDA0002273460980000106
the smaller, the threshold of the number of rounds that have been migrated can therefore be made to decrease with increasing internal dirty page rate, which can stop the pre-copy migration phase in time.
The actions of the devices in step W1, step W2, and step W3 may be executed by the processor 201 in the computer device 200 shown in fig. 2 calling the application program code stored in the memory 203, which is not limited in this embodiment of the present application.
In a possible implementation manner, the step W1 specifically includes steps W1A-W1B:
W1A, the pre-copy migration stop pre-judging device obtains the time used by the ith round of pre-copy migration.
W1B, and the pre-copy migration stop pre-judging device determines the internal memory dirty page rate after the ith round of pre-copy migration is finished by combining a formula (3) according to the time and the internal memory dirty page number used by the ith round of pre-copy migration.
Figure GDA0002273460980000111
Wherein D isiIndicating the dirty page number m of the memory after the ith round of pre-copy migration is finished0Indicates the unit memory page size, LiIndicating the time taken for the ith round of pre-copy migration.
Based on the scheme, the dirty page number D in the memory of the ith round of pre-copy migration can be obtainediThe time for finishing the pre-copy migration of the ith round and the page size m of the unit memory0Internal dirty page rate V for realizing acquisition of ith round of pre-copy migrationi
The actions of the devices in step W1A and step W1B may be executed by the processor 201 in the computer device 200 shown in fig. 2 calling the application program code stored in the memory 203, which is not limited in this embodiment of the present application.
In a possible implementation manner, after the step W1, the method further includes the step W4:
w4, if the internal memory dirty page number is not less than the first threshold value, and the internal memory dirty page rate after the ith round of pre-copy migration is finished is greater than the fifth threshold value, the pre-copy migration stop pre-judgment device stops the pre-copy migration stage.
And the fifth threshold is a threshold preset for the memory dirty page rate in the pre-copy migration stage.
It should be noted that the preset threshold of the dirty memory page rate is generally the maximum value of the network transmission speed.
Optionally, the preset threshold of the memory dirty page rate may be a network transmission rate or other values, which is not specifically limited in this embodiment of the present application.
Based on the scheme, firstly, by judging the threshold value of the internal dirty page number, under the condition that the internal dirty page number is not less than the first threshold value, the threshold value of the internal dirty page rate is further judged, when the internal memory dirty page rate is greater than the fifth threshold, the pre-copy migration stop pre-judging device stops the pre-copy migration stage, multiple angles can be implemented to determine whether to stop the pre-copy migration stage in time, and by the judgment of the mutual combination of multiple parameters, the condition of stopping the pre-copying and transferring stage can be timely reached by timely and adaptively adjusting the threshold value corresponding to the preset parameter according to the condition of the system, the shutdown copying stage can be timely entered, therefore, the total migration time and the downtime in the pre-copy migration stage are shortened, the system operation efficiency can be improved, and the method can be suitable for wider migration scenes.
The actions of the means in step W4 may be executed by the processor 201 in the computer device 200 shown in fig. 2 calling the application program code stored in the memory 203, which is not limited in this embodiment of the present application.
In a possible implementation manner, the at least one parameter further includes an estimated total downtime after the end of the ith round of pre-copy migration, and after step S302, the method further includes step S304:
s304, if the number of the internal memory pages is not less than the first threshold value and the estimated total downtime is greater than a sixth threshold value, the pre-copy migration stop pre-judgment device stops the pre-copy migration stage.
And the sixth threshold is a preset threshold of total shutdown time.
It should be noted that, in the pre-copy migration phase, the checkpoint data transmission and checkpoint data recovery operations have less influence on the downtime of the migrated system, and therefore, in the pre-copy migration phase, the downtime is mainly the downtime for checkpointing.
It should be noted that the preset threshold value of the total downtime is the maximum value that can be tolerated by the user, in the embodiment of the present application, by comparing the estimated total downtime with the preset threshold value of the total downtime, the method can only enter the shutdown copy stage as quickly as possible when the estimated total downtime exceeds the maximum value that can be tolerated by the user, and cannot complete the live migration before the preset threshold value of the total downtime.
Based on the scheme, the pre-copy migration stop pre-judging device can also obtain the estimated total shutdown time after the ith round of pre-copy migration is finished, when the number of internal memory pages is determined to be not less than the first threshold value, the pre-copy migration stop pre-judging device stops the pre-copy migration stage by judging the relationship between the estimated total shutdown time and the sixth threshold value, if the estimated total shutdown time is greater than the sixth threshold value, the pre-copy migration stop pre-judging device can realize a plurality of angles to determine whether the pre-copy migration stage is stopped in time by the pre-copy migration stop pre-judging method provided by the embodiment of the application, can adjust the threshold value of the corresponding preset parameter in time according to the condition of the system by mutually combining a plurality of parameters to reach the condition of stopping the pre-copy migration stage in time, can enter the shutdown copying stage in time, thereby shortening the total migration time and shutdown time in the pre-copy migration stage, and further, the system operation efficiency can be improved, and the method can be suitable for wider migration scenes.
The actions of the apparatus in step S304 may be executed by the processor 201 in the computer device 200 shown in fig. 2 calling the application program code stored in the memory 203, which is not limited in this embodiment of the present application.
In a possible implementation manner, step S301 may further be step S301A:
S301A, the pre-copy migration stop pre-judging device determines the estimated total shutdown time after the ith round of pre-copy migration is finished according to the formula (4).
Figure GDA0002273460980000121
Wherein, TT,iRepresenting the estimated total downtime after the ith round of pre-copy migration is finished,
Figure GDA0002273460980000122
represents the accumulated downtime T from the end of the 1 st round of pre-copy migration to the end of the ith round of pre-copy migration in the pre-copy migration stage1Indicating the downtime, T, used for the shutdown copy migration phaseiIndicating the downtime for the i-th round of pre-copy migration.
It should be noted that, in the following description,
Figure GDA0002273460980000123
ciindicating the downtime used for checkpointing the i-th round of migration.
When 0 < i < N, TiIndicating the downtime of the system to which the pre-copy migration of the ith round of the pre-copy migration phase is migrated.
When i ═ N, TiRepresenting downtime of a migrated system of a shutdown copy migration phase, comprising: the Nth migration round sets up the downtime for checkpointing and the time for transferring the dirty pages and other content saved from the last pre-copy round.
It should be noted that, since the total downtime is the sum of the downtime of the pre-copy migration phase and the downtime of the shutdown copy migration phase, when the total downtime is estimated, the downtime accumulated from the 1 st round of pre-copy migration to the ith round of pre-copy migration is determined first, and since the downtime used in the shutdown copy migration phase in practical application is aboutEqual to the downtime for the 1 st round of pre-copy migration, so the estimated total downtime needs to be added to the downtime of the shutdown copy migration phase, i.e., T in equation (4)1Therefore, the formula of the estimated total downtime given in the embodiment of the present application is formula (4).
Optionally, the time used in the shutdown copy migration stage in the embodiment of the present application is estimated according to the shutdown time of the 1 st round of pre-copy migration, and may also be estimated according to other times, which is not specifically limited in the embodiment of the present application.
Based on the scheme, the pre-copy migration stop pre-judging device can obtain the estimated total shutdown time after the ith round of pre-copy migration is finished.
The actions of the apparatus in step S301A may be executed by the processor 201 in the computer device 200 shown in fig. 2 calling the application program code stored in the memory 203, which is not limited in this embodiment of the present application.
In a possible implementation manner, the at least one parameter further includes an estimated total migration time after the end of the ith round of pre-copy migration, and after S302, the method further includes step S305:
s305, if the internal memory dirty page number is not less than the first threshold value and the estimated total migration time is greater than a seventh threshold value, the pre-copy migration stop pre-judgment device stops the pre-copy migration stage.
And the seventh threshold is a threshold of the preset total migration time.
It should be noted that the preset threshold value of the total migration time is the maximum value that can be tolerated by the user, in the embodiment of the present application, by comparing the estimated total migration time with the preset threshold value of the total migration time, the shutdown copy stage can only be entered as quickly as possible when the estimated total migration time has exceeded the maximum value that can be tolerated by the user, and the live migration cannot be completed before the preset threshold value of the total migration time.
Based on the scheme, the pre-copy migration stop pre-judging device can also obtain the estimated total shutdown time after the ith round of pre-copy migration is finished, when the number of the dirty pages in the internal memory is determined to be not more than the first threshold value, the pre-copy migration stop pre-judging device stops the pre-copy migration stage by judging the relationship between the estimated total migration time and the seventh threshold value, if the estimated total migration time is not less than the seventh threshold value, the pre-copy migration stop pre-judging device can realize the determination of whether the pre-copy migration stage is stopped in time or not by a plurality of angles by the pre-copy migration stop pre-judging method provided by the embodiment of the application, the condition of stopping the pre-copy migration stage can be reached in time by adjusting the threshold values of corresponding preset parameters in time according to the condition of the system by mutually combining a plurality of parameters, the shutdown copying stage can be entered in time, so as to shorten the total migration time and the shutdown time in the pre-copy, and further, the system operation efficiency can be improved, and the method can be suitable for wider migration scenes.
The actions of the apparatus in step S305 may be executed by the processor 201 in the computer device 200 shown in fig. 2 calling the application program code stored in the memory 203, which is not limited in this embodiment of the application.
In a possible implementation manner, step S301 may further include step S301B:
S301B, determining the estimated total migration time after the ith round of pre-copy migration is finished according to a formula (5);
Figure GDA0002273460980000131
wherein, TQ,iThe estimated total migration time after the ith round of pre-copy migration is finished,
Figure GDA0002273460980000132
represents the cumulative time, T, taken for the 1 st round of pre-copy migration to the ith round of pre-copy migration in the pre-copy migration stageL,1Represents the total time, T, taken to migrate the shutdown copy migration phaseL,iIndicating the time taken for migration after the end of the pre-copy migration of the ith round.
It should be noted that, in the following description,
Figure GDA0002273460980000141
when i is 1, L1Indicating the time taken by the migration system to migrate during the 1 st round of pre-copy migration.
When 2 < i < N, LiThe time taken by the migration system to migrate during the ith round of pre-copy migration,
Figure GDA0002273460980000142
indicating the time taken to transfer the number of internal dirty pages generated in round i-1 during the pre-copy migration of round i.
When i ═ N, LiIndicating the time taken for the shutdown copy migration phase to be migrated by the migration system,
Figure GDA0002273460980000143
represents the time taken for the last round of pre-copy saved dirty pages to be transferred in the shutdown copy migration stage, TR,iIndicating the time taken for the system to recover during the shutdown copy migration phase.
It should be noted that, since the total migration time is the sum of the migration time of the pre-copy migration phase and the migration time of the shutdown copy migration phase, the cumulative time for migration from the 1 st round of pre-copy migration to the ith round of pre-copy migration is first determined when the total migration time is estimated, and then the time for migration of the shutdown copy migration phase is added, i.e. T in the formula (5)L,1Since the time taken for migration in the stop copy migration stage in practical application is approximately equal to the total time taken for migration in the 1 st round of pre-copy migration, the formula of the estimated total migration time given in the embodiment of the present application is formula (5).
Optionally, the migration time used in the stop copy migration stage is estimated according to the migration time used in the 1 st round of pre-copy, and may also be estimated according to other times, which is not specifically limited in the embodiment of the present application.
It should be noted that the preset threshold value of the total migration time is the maximum value that can be tolerated by the user, in the embodiment of the present application, by comparing the estimated total migration time with the preset threshold value of the total migration time, the shutdown copy stage can only be entered as quickly as possible when the estimated total migration time has exceeded the maximum value that can be tolerated by the user, and the live migration cannot be completed before the preset threshold value of the total migration time.
Based on the scheme, the pre-copy migration stop pre-judging device can obtain the estimated total shutdown time after the ith round of pre-copy migration is finished.
It should be noted that, the judgment of the preset parameters does not have a sequence, and one of the parameters may be arbitrarily selected as a parameter to be judged first, which is not specifically limited in this embodiment of the application.
Optionally, the embodiment of the present application provides a determination manner of total downtime and total migration time for actually completing system live migration.
The pre-copy migration stop pre-judging means calculates the total downtime for completing the system live migration according to formula (6).
Figure GDA0002273460980000144
Wherein,
Figure GDA0002273460980000145
indicating the time taken by the shutdown copy migration phase to transfer the dirty pages in memory saved in the last round of pre-copy.
The pre-copy migration stop pre-judging device calculates the total migration time for completing the system live migration according to the formula (7).
Figure GDA0002273460980000151
Wherein,
Figure GDA0002273460980000152
indicating the migration time used to migrate only the system throughout the live migration process,
Figure GDA0002273460980000153
represents the time taken to transfer a dirty page in the system from the 2 nd round of pre-copy to the last stop-copy phase, TR,NIndicating the recovery time of the migrated system during the shutdown copy phase.
Based on this scheme, the actual total downtime and total migration time may be determined by the above equations.
The actions of the apparatus in step S301B may be executed by the processor 201 in the computer device 200 shown in fig. 2 calling the application program code stored in the memory 203, which is not limited in this embodiment of the present application.
Fig. 5 is a schematic diagram of a logical process of live migration according to an embodiment of the present application. As shown in fig. 5, each round of migration pre-copy migration stop pre-determination device copies the memory pages of the migrated system, where the copy in round 1 is all the memory pages occupied by the migrated system, and after round 2, each round of migration copy is a memory page modified with respect to the previous round, and after each round of migration, threshold calculation and determination of parameters are performed, and each round is provided with a check point and stores the generated dirty memory page in a check point file. Wherein, the first N-1 round is a pre-copying migration stage, and the Nth round is a halt copying migration stage. When entering a shutdown copy migration stage, the pre-copy migration stop pre-judging device stores the dirty memory page generated by the (N-1) th in the checkpoint file, and acquires other contents of the system, such as an opened file, a network programming interface and the like. The pre-copy migration stopping pre-judging device carries out shutdown copy migration, synchronizes the checkpoint data of the source position and the target position, and recovers a migrated system at the target position according to all the checkpoint data of the target position.
FIG. 6 is a schematic diagram of a down time and a migration time of a computing system live migration according to an embodiment of the present application. Referring to fig. 5, as shown in fig. 6, in the pre-copy migration phase, each migration may freeze the migrated system at the source location, the system is stopped and the modified dirty memory page is saved, after the saving, the migrated system at the source location continues to run and synchronize the checkpoint file, the running and the freezing of the migrated system at the source location are performed alternately, the pre-copy migration phase of the live migration is from time t1 to time t8, and the stop-copy migration phase is from time t8 to time t11, where from time t8 to time t9 is a system migration phase, from time t9 to time t10 is a last checkpoint data synchronization phase, and from time t10 to time t11 is a phase of performing system recovery according to the checkpoint data at the target location. The system running time of the 1 st round of pre-copy migration is t2-t1, and the shutdown time is t3-t 2; the running time of the system of the 2 nd round of pre-copy migration is t4-t3, and the shutdown time is t5-t 4; the running time of the system for the 3 rd round of pre-copy migration is t 6-t 5, and the shutdown time is t7-t 6. In the shutdown migration stage, the pre-copy migration stopping prejudging device carries out the last 1 round of migration, and the shutdown time of a migration system is t 9-t 8; the pre-copy migration stopping pre-judging device performs the data synchronization of the checkpoint of the last 1 round, and the downtime used for the data synchronization of the checkpoint of the last 1 round is t10-t 9; the pre-copy migration stop prejudging device carries out system recovery according to all the checkpoint data, and the stop time for system recovery is t11-t 10.
It should be noted that the system migration and data synchronization are performed while the system is running before entering the shutdown copy migration.
It should be noted that, in practical applications, the downtime for the migration phase is about equal to the time for the 1 st round of migration, and the migration time for the migration phase is about equal to the time for the migration during the 1 st round of pre-copy migration.
A specific example of performing pre-copy migration stop anticipation on the system by combining the pre-copy migration stop anticipation method provided in the foregoing embodiment will be given below.
Fig. 7 is a schematic diagram illustrating a specific execution flow of pre-copy migration stop pre-judgment according to an embodiment of the present application.
For example, suppose that the system a is migrated from the source location S1 to the target location S2, the number of memory pages D of the system a is 500000, and the memory write speed V is set to 500000men3000MB/s, network transmission speed Vnet=1000MB/s。
Step 1, initializing a preset threshold value of each preset parameter by a pre-copy migration stop pre-judging device.
As shown in table 1, the preset parameters and the preset threshold values of the preset parameters are obtained when the system a is subjected to the thermal migration.
TABLE 1
Preset parameters Preset threshold of preset parameter
Dirty page number D in memoryi Dmin=1000
Number of pre-copy migration rounds i Nmax=10
Dirty memory page rate Vi Vmax=1000MB/s
Total time of shutdown Tmax=3s
Total time of migration Lmax=10s
And 2, executing the 1 st round of pre-copy migration by the pre-copy migration stopping pre-judging device.
The pre-copy migration stop pre-judging device counts the number D of the memory pages of the system A, and synchronizes the checkpoint data of the source position S1 and the target position S2 of the system A.
The pre-copy migration stopping and pre-judging device counts the downtime T of the pre-copy migration of the 1 st round1The total downtime T is estimated according to equation (4) at 0.7sT,1=1.5s。
The pre-copy migration stopping pre-judging device counts the migration time T of the pre-copy migration of the 1 st roundL,1The total migration time T is estimated according to equation (5) at 2.5sQ,1=3s。
As shown in Table 2, the values of the parameters after the 1 st round of pre-copy migration is completed are shown.
TABLE 2
Preset parameters Statistical value of preset parameters
Dirty page number D in memoryi D1=0
Number of pre-copy migration rounds i i=1
Dirty memory page rate Vi V1=0MB/s
Estimated total downtime TT,1=1.5s
Estimated total migration time TQ,1=3s
As can be seen from the comparison between Table 1 and Table 2, after the 1 st round of pre-copy migration, the values of the parameters do not exceed the corresponding threshold ranges.
It should be noted that after the 1 st round of pre-copy migration is completed, all the memory pages to be migrated are stored in the checkpoint data, and the system a does not generate a memory dirty page, and does not have a memory dirty page rate, so that the system D does not generate a memory dirty page, and does not have a memory dirty page rate1=0,V10 MB/s. Before the 2 nd round of pre-copy migration, the system A modifies the memory page after running, and starts to generate the memory dirty page, so as to generate the speed of the memory dirty page, namely the memory dirty page rate.
And 3, executing the 2 nd round of pre-copy migration operation.
The number D of the memory pages of the system A is 500000>DminAfter the 1 st round of the pre-copy migration operation, the pre-copy migration stop pre-determination means determines that the number D of memory pages of the system a is 500000 greater than the preset threshold of the number of dirty memory pages, performs the 2 nd round of the pre-copy migration operation, and synchronizes the checkpoint data of the source location S1 and the destination location S2 of the system a.
The pre-copy migration stopping pre-judging device counts the time T used by the 2 nd round of pre-copy migrationL,2Dirty page number D in 2s and 2 nd round of pre-copy migration2Acquiring the internal dirty page rate V of the 2 nd round of copy migration according to the formula (1) as 500002=50MB/S。
The pre-copy migration stopping and pre-judging device counts the downtime T of the 2 nd round of pre-copy migration2The total downtime T is estimated according to equation (4) at 0.2sT,2=2.2s
The pre-copy migration stopping and pre-judging device counts the pre-copy migration time T of the 2 nd roundL,2The total migration time T is estimated according to equation (5) as 2sQ,2=5s。
As shown in Table 3, the values of the parameters after the 2 nd round of pre-copy migration are completed.
TABLE 3
Preset parameters Statistical value of preset parameters
Dirty page number D in memoryi D2=50000
Number of pre-copy migration rounds i i=2
Dirty memory page rate Vi V2=150MB/s
Estimated total downtime TT,2=2s
Estimated total migration time TQ,2=5s
Step 4, the pre-copy migration stopping pre-judging device takes the threshold value of the number of rounds that the 2 nd round of pre-copy migration has migrated as N according to the formula (3)2,max=7。
And 5, the pre-copy migration stopping pre-judging device confirms whether the preset parameters exceed the threshold range.
As can be seen from the comparison between the data in tables 2 and 3 and the threshold of the number of pre-copy migration rounds determined in step 4, there is no parameter in the corresponding threshold range, and therefore, the pre-copy migration stop pre-determination device performs the 3 rd round of pre-copy migration.
And 6, executing the 7 th round of pre-copy migration by the pre-copy migration stopping pre-judging device, wherein all preset parameters do not exceed the threshold range.
The pre-copy migration stopping pre-judging device counts the time T used by the 7 th round of pre-copy migrationL,7Dirty page number D in 0.1s and 7 th round of pre-copy migration7Obtaining the internal dirty page rate V of the 7 th round of copy migration according to the formula (1) as 10007=300MB/S。
The pre-copy migration stopping and pre-judging device counts the downtime T of the 7 th round of pre-copy migration7=c7The estimate of the 7 th round of migration is determined according to equation (4) at 0.1sTotal time of shutdown TT,7=2.6s;
The pre-copy migration stopping pre-judging device counts the time T used by the 7 th round of pre-copy migrationL,7Determining the estimated total migration time T of the 7 th round of migration according to the formula (5) as 0.3sQ,7=7.5s。
As shown in Table 4, the values of the parameters after the 7 th round of pre-copy migration is finished are shown.
TABLE 4
Preset parameters Statistical value of preset parameters
Dirty page number D in memoryi D7=1000
Number of pre-copy migration rounds i i=7
Dirty memory page rate Vi V7=300MB/s
Estimated total downtime TT,7=2.6s
Estimated total migration time TQ,7=7.5s
After the 6 th round of pre-copy migration is finished, the pre-copy migration stop pre-judging device determines the threshold value D of the internal dirty page number of the 7 th round of pre-copy migration according to the formula (2)7,min1500; determining the threshold value of the number of rounds that the 7 th round of pre-copy has been migrated as N according to formula (3)7,max=9;
The pre-copy migration stopping pre-judging device counts a threshold value N for determining the number of rounds that the 8 th round of pre-copy has migrated according to a formula (3)8,max9, determining the threshold D of the internal dirty page number of the 8 th round of pre-copy migration according to the formula (2)8,min=1300。
And 7, counting and executing the hot migration to the 8 th round by the pre-copying migration stopping pre-judging device.
The pre-copy migration stop pre-judging device determines the dirty page number D in the preset parameter81000 is less than threshold D8,minThe pre-copy migration phase is stopped 1300.
And 8, counting the system A of the frozen source position S1 by the pre-copy migration stop pre-judging device, synchronizing the checkpoint data of the source position S1 and the checkpoint data of the target position S2, and restoring the operation of the system A by the pre-copy migration stop pre-judging device according to all the checkpoint data of the target position S2.
At this point, system A is done with the warm migration.
It should be noted that, in this example, only the memory dirty pages and the memory dirty page rate of the migrated system of the ith round are obtained at the time when the checkpoint is set in the ith round and the ith-1 round of pre-copy, and the obtained time is only to illustrate that the memory dirty pages and the memory dirty page rate used in the current round are generated in the current round relative to the previous round, and in practical applications, the memory dirty pages and the memory dirty page rate may be obtained at any time before the threshold determination is performed, for example, both the memory dirty pages and the memory dirty page rate are obtained at the time when the migration starts and both the memory dirty page rate are obtained at the time when the migration completes, which is not specifically limited in this embodiment of the present application.
It should be noted that, in this example, the threshold value is calculated and determined only in the above-mentioned order by way of example, and in a specific application, the above-mentioned order may be any order, which is not specifically limited in this embodiment of the present application.
The scheme provided by the embodiment of the present application is mainly introduced from the perspective of a pre-copy migration stop pre-judging device. It is to be understood that, in order to implement the above functions, the pre-copy migration stop anticipation means includes hardware structures and/or software modules for performing the respective functions. Those of skill in the art would readily appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as hardware or combinations of hardware and computer software. Whether a function is performed as hardware or computer software drives hardware depends upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
In the embodiment of the present application, the functional modules of the pre-copy migration stop pre-determination apparatus may be divided according to the above method example, for example, each functional module may be divided corresponding to each function, or two or more functions may be integrated into one processing module. The integrated module can be realized in a hardware mode, and can also be realized in a software functional module mode. It should be noted that, in the embodiment of the present application, the division of the module is schematic, and is only one logic function division, and there may be another division manner in actual implementation.
For example, in the case of dividing each functional module by corresponding functions, fig. 8 shows a schematic diagram of a possible structure of the pre-copy migration stop pre-determination apparatus 800 according to the foregoing embodiment. As shown in fig. 8, the pre-copy migration stop anticipation apparatus 800 includes an acquisition module 801, a determination module 802, and a stop module 803. The obtaining module 801 is configured to support the pre-copy migration stop anticipation device 800 to perform step S301, step S301A, and step S301B in the foregoing method embodiment; the determining module 802 is configured to support the pre-copy migration stop pre-judging apparatus 800 to perform step S302, step S303B, step S302A, step S302B, step S302C, step W1, step W2, step W3, step W1A, and step W1B in the above method embodiment; the stop module 803 is used to support the pre-copy migration stop prejudging apparatus 800 to execute step S303, step S303A, step W4, step S304 and step S305 in the above method embodiment.
All relevant contents of each step related to the above method embodiment may be referred to the functional description of the corresponding functional module, and are not described herein again.
In the case of dividing each functional module in an integrated manner, fig. 9 shows a schematic diagram of a possible structure of the pre-copy migration stop pre-determination apparatus 900 according to the foregoing embodiment. As shown in fig. 9, the pre-copy migration stop anticipation means 900 includes a processing module 901. The processing module 901 is configured to support the pre-copy migration stop pre-determination apparatus 900 to perform steps S301, S302, S303A, S303B, S302A, S302B, S302C, W1, W2, W3, W1A, W1B, W4, S304, S301A, S305, and S301B in the foregoing method embodiment.
All relevant contents of each step related to the above method embodiment may be referred to the functional description of the corresponding functional module, and are not described herein again.
In the above embodiments, the implementation may be wholly or partially realized by software, hardware, firmware, or any combination thereof. When implemented using a software program, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. The procedures or functions described in accordance with the embodiments of the present application are all or partially generated upon loading and execution of computer program instructions on a computer. The computer may be a general purpose computer, a special purpose computer, a network of computers, or other programmable device. The computer instructions may be stored on a computer readable storage medium or transmitted from one computer readable storage medium to another, for example, from one website, computer, server, or data center to another website, computer, server, or data center via wire (e.g., coaxial cable, fiber optic, Digital Subscriber Line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer or can comprise one or more data storage devices, such as a server, a data center, etc., that can be integrated with the medium. The usable medium may be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., Digital Video Disk (DVD)), or a semiconductor medium (e.g., Solid State Disk (SSD)), among others.
While the present application has been described in connection with various embodiments, other variations to the disclosed embodiments can be understood and effected by those skilled in the art in practicing the claimed application, from a review of the drawings, the disclosure, and the appended claims. In the claims, the word "comprising" does not exclude other elements or steps, and the word "a" or "an" does not exclude a plurality. A single processor or other unit may fulfill the functions of several items recited in the claims. The mere fact that certain measures are recited in mutually different dependent claims does not indicate that a combination of these measures cannot be used to advantage.
Although the present application has been described in conjunction with specific features and embodiments thereof, it will be evident that various modifications and combinations can be made thereto without departing from the spirit and scope of the application. Accordingly, the specification and figures are merely exemplary of the present application as defined in the appended claims and are intended to cover any and all modifications, variations, combinations, or equivalents within the scope of the present application. It will be apparent to those skilled in the art that various changes and modifications may be made in the present application without departing from the spirit and scope of the application. Thus, if such modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is intended to include such modifications and variations as well.

Claims (20)

1. A method for prejudging a stop of pre-copy migration, the method comprising:
acquiring a value of at least one preset parameter after the ith round of pre-copy migration is finished, wherein the at least one preset parameter comprises the internal memory dirty page number, the internal memory dirty page number after the ith round of pre-copy migration is the modified quantity of the internal memory page from the i-1 th round of pre-copy migration to the ith round of pre-copy migration, i is more than 1 and less than N, and i is a positive integer;
determining a first threshold value according to the dirty memory pages, wherein the first threshold value is the threshold value of the dirty memory pages after the ith round of pre-copy migration is finished;
if the internal memory dirty page number is smaller than the first threshold value, stopping the pre-copy migration stage;
the at least one preset parameter further comprises the number i of the transferred rounds after the ith round of pre-copy transfer is finished;
after the first threshold value is determined according to the internal dirty page number, the method further includes:
if the internal memory dirty page number is not less than the first threshold value and i is greater than a second threshold value, stopping the pre-copy migration stage, wherein the second threshold value is the threshold value of the number i of the migrated rounds after the ith round of pre-copy migration is finished;
and if the internal memory dirty pages are not smaller than the first threshold and i is not larger than the second threshold, determining a third threshold according to the internal memory dirty pages, wherein the third threshold is the threshold of the internal memory dirty pages after the (i + 1) th round of pre-copy migration is finished.
2. The method of claim 1, wherein determining the first threshold based on the number of internal dirty pages comprises:
determining the internal memory dirty page rate after the ith round of pre-copy migration is finished according to the internal memory dirty page number, wherein the internal memory dirty page rate after the ith round of pre-copy migration is the rate of internal memory page modification after the ith-1 round of pre-copy migration is finished and after the ith round of pre-copy migration is finished;
acquiring the internal memory dirty page rate after the i-1 st round of pre-copy migration is finished;
determining the first threshold value by combining a first preset formula according to the dirty page rate of the memory after the ith round of pre-copy migration is finished, the dirty page rate of the memory after the ith-1 round of pre-copy migration is finished and a fourth threshold value, wherein the fourth threshold value is the threshold value of the dirty page number of the memory after the ith-1 round of pre-copy migration is finished;
the first preset formula includes:
Figure FDA0002326039490000011
wherein D isi,minRepresenting said first threshold value, Di-1,minRepresents the fourth threshold value, ViRepresenting the internal memory dirty page rate V after the ith round of pre-copy migration is finishedi-1And representing the internal memory dirty page rate after the i-1 th round of pre-copy migration is finished.
3. The method of claim 1, wherein determining the third threshold based on the number of internal dirty pages comprises:
determining the internal memory dirty page rate after the ith round of pre-copy migration is finished according to the internal memory dirty page number, wherein the internal memory dirty page rate after the ith round of pre-copy migration is the rate of internal memory page modification after the ith-1 round of pre-copy migration is finished and after the ith round of pre-copy migration is finished;
acquiring the memory writing speed in the pre-copy migration stage and the network transmission speed in the pre-copy migration stage;
determining the third threshold value by combining a second preset formula according to the memory writing speed of the pre-copy migration stage, the network transmission speed of the pre-copy migration stage, the memory dirty page rate after the ith round of pre-copy migration is finished and the second threshold value;
the second preset formula includes:
Figure FDA0002326039490000021
wherein N isi+1,maxRepresents the third threshold value, VmenRepresents the memory write speed, VnetRepresenting the network transmission speed, Ni,maxRepresents the second threshold value, ViRepresenting the internal memory dirty page rate after the ith round of pre-copy migration is finished,
Figure FDA0002326039490000022
means taking greater than
Figure FDA0002326039490000023
Is the largest integer of (a).
4. The method as claimed in claim 2, wherein said determining the internal dirty page rate after the i-th round of pre-copy migration is finished according to the internal dirty page number comprises:
acquiring the time for the ith round of pre-copy migration;
determining the internal memory dirty page rate after the ith round of pre-copy migration is finished by combining a third preset formula according to the time used by the ith round of pre-copy migration and the internal memory dirty page number;
the third preset formula includes:
Figure FDA0002326039490000024
wherein D isiRepresenting the dirty page number m of the internal memory after the ith round of pre-copy migration is finished0Indicates the unit memory page size, LiRepresenting the time taken for the i-th round of pre-copy migration.
5. The method according to any one of claims 2 or 4, wherein after determining the internal dirty page rate after the i-th round of pre-copy migration is finished according to the internal dirty page number, the method further comprises:
and if the internal memory dirty page number is not less than a first threshold value and the internal memory dirty page rate after the ith round of pre-copy migration is finished is greater than a fifth threshold value, stopping the pre-copy migration stage, wherein the fifth threshold value is a preset threshold value of the internal memory dirty page rate of the pre-copy migration stage.
6. The method according to any one of claims 1 to 4, wherein the at least one preset parameter further comprises an estimated total downtime after the end of the i-th round of pre-copy migration;
after the first threshold value is determined according to the internal dirty page number, the method further includes:
and if the internal memory dirty pages are not smaller than the first threshold value and the estimated total downtime is larger than a sixth threshold value, stopping the pre-copy migration stage, wherein the sixth threshold value is a preset threshold value of the total downtime.
7. The method of claim 6, wherein obtaining the estimated total downtime after the end of the ith round of pre-copy migration comprises:
determining estimated total shutdown time after the ith round of pre-copy migration is finished according to a fourth preset formula;
the fourth preset formula includes:
Figure FDA0002326039490000025
wherein, TT,iRepresenting the estimated total downtime after the end of the ith round of pre-copy migration,
Figure FDA0002326039490000026
representing the accumulated downtime T from the end of the 1 st round of pre-copy migration to the end of the ith round of pre-copy migration in the pre-copy migration stage1Indicating the downtime, T, used for the shutdown copy migration phaseiIndicating the downtime for the i-th round of pre-copy migration.
8. The method according to any one of claims 1 to 4 or 7, wherein the at least one preset parameter further comprises an estimated total migration time after the end of the ith round of pre-copy migration;
after the first threshold value is determined according to the internal dirty page number, the method further includes:
and if the internal memory dirty page number is not less than the first threshold value and the estimated total migration time is greater than a seventh threshold value, stopping the pre-copy migration stage, wherein the seventh threshold value is a preset threshold value of the total migration time.
9. The method of claim 8, wherein obtaining the estimated total migration time after the end of the ith round of pre-copy migration comprises:
determining the estimated total migration time after the ith round of pre-copy migration is finished according to a fifth preset formula;
the fifth preset formula includes:
Figure FDA0002326039490000031
wherein, TQ,iRepresents the estimated total migration time after the ith round of pre-copy migration is finished,
Figure FDA0002326039490000032
represents the cumulative time, T, used for the 1 st round of pre-copy migration to the ith round of pre-copy migration in the pre-copy migration stageL,1Represents the total time, T, taken to migrate the shutdown copy migration phaseL,iAnd the time taken for migration after the ith round of pre-copy migration is finished is represented.
10. An apparatus for pre-copy migration stop anticipation, the apparatus comprising: the device comprises an acquisition module, a determination module and a stop module;
the acquisition module is used for acquiring a value of at least one preset parameter after the ith round of pre-copy migration is finished, wherein the at least one preset parameter comprises the internal memory dirty page number, the internal memory dirty page number after the ith round of pre-copy migration is the modified number of the internal memory page after the ith-1 round of pre-copy migration is finished and after the ith round of pre-copy migration is finished, i is more than 1 and less than N, and i is a positive integer;
the determining module is configured to determine a first threshold according to the dirty memory number, where the first threshold is a threshold of the dirty memory number after the i-th round of pre-copy migration is finished;
the stopping module is used for stopping the pre-copy migration stage if the internal memory dirty page number is smaller than the first threshold value;
the at least one preset parameter further comprises the number i of the transferred wheels after the ith round of pre-copy transfer is finished;
the stop module is further configured to:
after the determining module determines a first threshold according to the dirty memory number, if the dirty memory number is not less than the first threshold and i is greater than a second threshold, stopping the pre-copy migration stage, where the second threshold is a threshold of the number i of the rounds that have been migrated after the ith round of pre-copy migration is finished;
the determining module is further configured to:
and if the internal memory dirty pages are not smaller than the first threshold and i is not larger than the second threshold, determining a third threshold according to the internal memory dirty pages, wherein the third threshold is the threshold of the internal memory dirty pages after the (i + 1) th round of pre-copy migration is finished.
11. The apparatus of claim 10, wherein the determining module is specifically configured to:
determining the internal memory dirty page rate after the ith round of pre-copy migration is finished according to the internal memory dirty page number, wherein the internal memory dirty page rate after the ith round of pre-copy migration is the rate of internal memory page modification after the ith-1 round of pre-copy migration is finished and after the ith round of pre-copy migration is finished;
acquiring the internal memory dirty page rate after the i-1 st round of pre-copy migration is finished;
determining the first threshold value by combining a first preset formula according to the dirty page rate of the memory after the ith round of pre-copy migration is finished, the dirty page rate of the memory after the ith-1 round of pre-copy migration is finished and a fourth threshold value, wherein the fourth threshold value is the threshold value of the dirty page number of the memory after the ith-1 round of pre-copy migration is finished;
the first preset formula includes:
Figure FDA0002326039490000033
wherein D isi,minRepresenting said first threshold value, Di-1,minRepresents the fourth threshold value, ViRepresenting the internal memory dirty page rate V after the ith round of pre-copy migration is finishedi-1And representing the internal memory dirty page rate after the i-1 th round of pre-copy migration is finished.
12. The apparatus of claim 10, wherein the determining module is specifically configured to:
determining the internal memory dirty page rate after the ith round of pre-copy migration is finished according to the internal memory dirty page number, wherein the internal memory dirty page rate after the ith round of pre-copy migration is the rate of internal memory page modification after the ith-1 round of pre-copy migration is finished and after the ith round of pre-copy migration is finished;
acquiring the memory writing speed in the pre-copy migration stage and the network transmission speed in the pre-copy migration stage;
determining the third threshold value by combining a second preset formula according to the memory writing speed of the pre-copy migration stage, the network transmission speed of the pre-copy migration stage, the memory dirty page rate after the ith round of pre-copy migration is finished and the second threshold value;
the second preset formula includes:
Figure FDA0002326039490000041
wherein N isi+1,maxRepresents the third threshold value, VmenRepresents the memory write speed, VnetRepresenting the network transmission speed, Ni,maxRepresents the second threshold value, ViRepresenting the internal memory dirty page rate after the ith round of pre-copy migration is finished,
Figure FDA0002326039490000042
means taking greater than
Figure FDA0002326039490000043
Is the largest integer of (a).
13. The apparatus of claim 11, wherein the determining module is specifically configured to:
determining the internal memory dirty page rate after the ith round of pre-copy migration is finished according to the internal memory dirty page number, wherein the determining the internal memory dirty page rate after the ith round of pre-copy migration is finished comprises the following steps:
acquiring the time for the ith round of pre-copy migration;
determining the internal memory dirty page rate after the ith round of pre-copy migration is finished by combining a third preset formula according to the time used by the ith round of pre-copy migration and the internal memory dirty page number;
the third preset formula includes:
Figure FDA0002326039490000044
wherein D isiRepresenting the dirty page number m of the internal memory after the ith round of pre-copy migration is finished0Indicates the unit memory page size, LiRepresenting the time taken for the i-th round of pre-copy migration.
14. The apparatus of claim 11, wherein the stopping module is further configured to:
after the determining module determines the memory dirty page rate after the ith round of pre-copy migration is finished according to the memory dirty page number, if the memory dirty page number is not less than a first threshold value and the memory dirty page rate after the ith round of pre-copy migration is finished is greater than a fifth threshold value, stopping the pre-copy migration stage, wherein the fifth threshold value is a preset threshold value of the memory dirty page rate in the pre-copy migration stage.
15. The apparatus according to any one of claims 10-14, wherein the at least one preset parameter further comprises an estimated total downtime after the end of the i-th round of pre-copy migration;
the stop module is further configured to:
after the determining module determines a first threshold according to the dirty memory number, if the dirty memory number is not less than the first threshold and the estimated total downtime is greater than a sixth threshold, stopping the pre-copy migration stage, wherein the sixth threshold is a preset threshold of the total downtime.
16. The apparatus of claim 15, wherein the obtaining module is specifically configured to:
determining estimated total shutdown time after the ith round of pre-copy migration is finished according to a fourth preset formula;
the fourth preset formula includes:
Figure FDA0002326039490000045
wherein, TT,iRepresenting the estimated total downtime after the end of the ith round of pre-copy migration,
Figure FDA0002326039490000046
representing the accumulated downtime T from the end of the 1 st round of pre-copy migration to the end of the ith round of pre-copy migration in the pre-copy migration stage1Indicating the downtime, T, used for the shutdown copy migration phaseiIndicating the downtime for the i-th round of pre-copy migration.
17. The apparatus of any of claims 10-14 or 16, wherein the stopping module is further configured to:
after the determining module determines a first threshold according to the memory dirty pages, if the memory dirty pages are not smaller than the first threshold and the estimated total migration time is greater than a seventh threshold, stopping the pre-copy migration stage, where the seventh threshold is a preset threshold of the total migration time.
18. The apparatus of claim 17, wherein the obtaining module is specifically configured to:
determining the estimated total migration time after the ith round of pre-copy migration is finished according to a fifth preset formula;
the fifth preset formula includes:
Figure FDA0002326039490000051
wherein, TQ,iRepresents the estimated total migration time after the ith round of pre-copy migration is finished,
Figure FDA0002326039490000052
represents the cumulative time, T, used for the 1 st round of pre-copy migration to the ith round of pre-copy migration in the pre-copy migration stageL,1Represents the total time, T, taken to migrate the shutdown copy migration phaseL,iAnd the time taken for migration after the ith round of pre-copy migration is finished is represented.
19. A pre-copy migration stop anticipation apparatus, comprising: a processor, a memory, and a communication interface;
the memory is used for storing computer-executable instructions, and when the pre-copy migration stop anticipation device runs, the processor executes the computer-executable instructions stored by the memory, so that the pre-copy migration stop anticipation device executes the pre-copy migration stop anticipation method according to any one of claims 1 to 9.
20. A computer-readable storage medium comprising computer instructions which, when executed on a computer, cause the computer to perform the method of pre-copy migration stop anticipation as claimed in any one of claims 1 to 9.
CN201710370661.7A 2017-05-23 2017-05-23 Pre-copy migration stop pre-judgment method and device Active CN107291527B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710370661.7A CN107291527B (en) 2017-05-23 2017-05-23 Pre-copy migration stop pre-judgment method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710370661.7A CN107291527B (en) 2017-05-23 2017-05-23 Pre-copy migration stop pre-judgment method and device

Publications (2)

Publication Number Publication Date
CN107291527A CN107291527A (en) 2017-10-24
CN107291527B true CN107291527B (en) 2020-04-03

Family

ID=60094729

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710370661.7A Active CN107291527B (en) 2017-05-23 2017-05-23 Pre-copy migration stop pre-judgment method and device

Country Status (1)

Country Link
CN (1) CN107291527B (en)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108595250B (en) * 2018-05-02 2021-05-28 南京大学 IaaS cloud platform-oriented resource scheduling efficiency optimization method and system
CN109669771B (en) * 2018-12-20 2021-02-19 中国联合网络通信集团有限公司 Dependency environment alternation method and device
CN110119377B (en) * 2019-04-24 2021-01-15 华中科技大学 Docker container-oriented online migration system implementation and optimization method
US11436043B2 (en) 2019-11-13 2022-09-06 International Business Machines Corporation Operating system code patching during live migration
US11520612B2 (en) 2019-11-13 2022-12-06 International Business Machines Corporation Virtual machine migration detection by a hosted operating system
CN113254421B (en) * 2021-05-31 2023-07-14 重庆富民银行股份有限公司 Database double-writing-based cross-database account migration method

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8478725B2 (en) * 2009-09-14 2013-07-02 Vmware, Inc. Method and system for performing live migration of persistent data of a virtual machine
CN103955399B (en) * 2014-04-30 2017-06-20 华为技术有限公司 A kind of virtual machine migration method and device and physical host
CN104298339B (en) * 2014-10-11 2017-02-15 东北大学 Server integration method oriented to minimum energy consumption
CN106469085B (en) * 2016-08-31 2019-11-08 北京航空航天大学 The online migration method, apparatus and system of virtual machine

Also Published As

Publication number Publication date
CN107291527A (en) 2017-10-24

Similar Documents

Publication Publication Date Title
CN107291527B (en) Pre-copy migration stop pre-judgment method and device
US10156986B2 (en) Gang migration of virtual machines using cluster-wide deduplication
CN110622478B (en) Method and device for data synchronous processing
CN103955399B (en) A kind of virtual machine migration method and device and physical host
US8413145B2 (en) Method and apparatus for efficient memory replication for high availability (HA) protection of a virtual machine (VM)
US9152474B2 (en) Context aware synchronization using context and input parameter objects associated with a mutual exclusion lock
CN107870732B (en) Method and apparatus for flushing pages from solid state storage devices
US9588844B2 (en) Checkpointing systems and methods using data forwarding
CN104123171B (en) Virtual machine migrating method and system based on NUMA architecture
TW201413456A (en) Method and system for processing nested stream events
US20170168756A1 (en) Storage transactions
WO2016014182A1 (en) Mid-thread pre-emption with software assisted context switch
KR20170096103A (en) Improved function callback mechanism between a central processing unit (cpu) and an auxiliary processor
WO2019028682A1 (en) Multi-system shared memory management method and device
US20140215060A1 (en) Software migration method and apparatus in micro-server environment
CN110990133A (en) Edge computing service migration method and device, electronic equipment and medium
KR102315102B1 (en) Method, device, apparatus, and medium for booting a virtual machine
US20230409206A1 (en) Systems and methods for ephemeral storage snapshotting
US11656919B2 (en) Real-time simulation of compute accelerator workloads for distributed resource scheduling
US10929238B2 (en) Management of changed-block bitmaps
CN114201109B (en) Computing system, medium, and method for computing system
WO2017107828A1 (en) Method and device for processing data after restart of node
US10809939B2 (en) Disk synchronization
CN111694635A (en) Service quality control method and device
US20220155847A1 (en) Technologies for a processor to enter a reduced power state while monitoring multiple addresses

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant