CN107341060B - Virtual machine memory allocation method and device - Google Patents
Virtual machine memory allocation method and device Download PDFInfo
- Publication number
- CN107341060B CN107341060B CN201710580787.7A CN201710580787A CN107341060B CN 107341060 B CN107341060 B CN 107341060B CN 201710580787 A CN201710580787 A CN 201710580787A CN 107341060 B CN107341060 B CN 107341060B
- Authority
- CN
- China
- Prior art keywords
- memory
- virtual machine
- period
- low
- scheduling
- 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
Links
- 230000015654 memory Effects 0.000 title claims abstract description 256
- 238000000034 method Methods 0.000 title claims abstract description 20
- 238000012544 monitoring process Methods 0.000 claims abstract description 8
- 238000013508 migration Methods 0.000 claims description 3
- 230000005012 migration Effects 0.000 claims description 3
- 238000005070 sampling Methods 0.000 description 3
- 238000010586 diagram Methods 0.000 description 2
- 238000005259 measurement Methods 0.000 description 2
- 208000003028 Stuttering Diseases 0.000 description 1
- 230000007246 mechanism Effects 0.000 description 1
- 239000002699 waste material Substances 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements 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/46—Multiprogramming arrangements
- G06F9/50—Allocation of resources, e.g. of the central processing unit [CPU]
- G06F9/5005—Allocation of resources, e.g. of the central processing unit [CPU] to service a request
- G06F9/5011—Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals
- G06F9/5016—Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals the resource being the memory
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements 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/44—Arrangements for executing specific programs
- G06F9/455—Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
- G06F9/45533—Hypervisors; Virtual machine monitors
- G06F9/45558—Hypervisor-specific management and integration aspects
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 Of A Hierarchy Structure (AREA)
- Memory System (AREA)
Abstract
The embodiment of the invention discloses a virtual machine memory allocation method, which comprises the following steps: monitoring the memory use conditions of the physical host and each virtual machine and periodically collecting memory use information; judging whether the memory use of the multiple virtual machines is reasonable or not according to the memory use information and preset memory scheduling reference conditions; and determining a memory scheduling strategy of the virtual machine according to the judgment result. The embodiment of the invention discloses a virtual machine memory allocation device. By the scheme of the embodiment of the invention, the memory utilization rate of the virtual machine is kept balanced, and the resource utilization efficiency of the physical machine is improved.
Description
Technical Field
The present invention relates to the field of virtualization, and in particular, to a method and an apparatus for allocating memory of a virtual machine.
Background
Virtualization technology refers to the virtual simulation of multiple logical computers, also called virtual machines, on one host. Each virtual machine has a complete operating system and a complete hardware system, and can run independently without mutual influence. Virtualization technology can greatly improve the resource utilization efficiency. When a virtual machine is created on a host, a memory with a fixed size is allocated to the virtual machine, and because the demand on memory resources during the operation of the virtual machine is dynamically changed, the allocation of the fixed memory may cause the memory utilization rate of the virtual machine to be too low, thereby causing resource waste; or the memory usage is too high, resulting in virtual machine stuttering. To solve this problem, Xen, VmWare and KVM provide underlying mechanisms such as balloon driving, page swapping and memory sharing to dynamically adjust the virtual machine memory, but lack a memory scheduling policy for multi-virtual machine cooperative management.
Disclosure of Invention
In order to solve the above technical problems, embodiments of the present invention provide a method and an apparatus for allocating a virtual machine memory, which can keep the virtual machine memory utilization rate balanced and improve the physical machine resource utilization rate.
To achieve the purpose of the embodiments of the present invention, an embodiment of the present invention provides a method for allocating a memory of a virtual machine, where the method includes:
monitoring the memory use conditions of the physical host and each virtual machine and periodically collecting memory use information;
judging whether the memory use of the multiple virtual machines is reasonable or not according to the memory use information and preset memory scheduling reference conditions;
and determining a memory scheduling strategy of the virtual machine according to the judgment result.
Optionally, the memory usage information includes:
physical memory size P being used by physical hostiWherein, i refers to the ith period for collecting the memory use information; and the number of the first and second groups,
maximum available memory size ML of operating system of each virtual machineijAnd memory size M being usedijThe current free memory size and the memory size submitted to the system by all application programs in the operating system;
wherein, all virtual machines on the physical host are integrated into a set of VjThe element belongs to VM, j is more than 0 and less than n, n is the total number of the virtual machines, j refers to the jth virtual machine, and i, j and n are positive integers.
Optionally, the preset memory scheduling reference condition includes: first relation, predetermined utilization rate threshold upper limit ΔupThe lower limit of the preset utilization rate threshold is deltalowAnd a predetermined weighting coefficient betaij;
Wherein the first relation comprises: (M)ij×βij)/MLij。
Optionally, the determining whether the memory usage of the plurality of virtual machines is reasonable according to the memory usage information and a preset memory scheduling reference condition includes:
when Δ is satisfiedlow≤(Mij×βij)/MLij≤ΔupThen, the virtual machine V in the period i is judgedjThe memory use condition is reasonable;
when satisfying (M)ij×βij)/MLij≤ΔlowThen, the virtual machine V in the period i is judgedjThe memory is in an excessive state, and the use condition is unreasonable;
when Δ is satisfiedup≤(Mij×βij)/MLijThen, the virtual machine V in the period i is judgedjThe memory is in a shortage state, and the use condition is unreasonable.
Optionally, determining the memory scheduling policy of the virtual machine according to the determination result includes:
when Δ is satisfiedlow≤(Mij×βij)/MLij≤ΔupIn time, not aiming at the virtual machine V in the (i + 1) th periodjMaximum usable memory ML(i+1)jMake adjustments, ML(i+1)j=MLij;
When satisfying (M)ij×βij)/MLij≤ΔlowThen, the virtual machine V in the (i + 1) th period is adjustedjMemory ML(i+1)jSatisfies the following conditions: ML(i+1)j=(Δup+Δlow)MLij/2;
When Δ is satisfiedup≤(Mij×βij)/MLijThen, the virtual machine V in the (i + 1) th period is adjustedjMemory ML(i+1)jSatisfies the following conditions: ML(i+1)j=MLij+(Δup+Δlow)MLij/2。
Optionally, the method further comprises: after the memory scheduling strategy of each virtual machine is determined, whether the memory use condition of the physical host is normal or not is judged if the memory scheduling is carried out on the virtual machines according to the memory scheduling strategy.
Optionally, the method further comprises: judging whether the memory use condition of the physical host is normal if the virtual machine is subjected to memory scheduling according to the memory scheduling strategy according to the relationship between the following inequality and a preset memory use ratio threshold a of the physical host:
an embodiment of the present invention further provides a virtual machine memory allocation apparatus, where the apparatus includes: the device comprises an acquisition module, a judgment module and a determination module;
the acquisition module is used for monitoring the memory use conditions of the physical host and each virtual machine and periodically acquiring the memory use information;
the judging module is used for judging whether the memory use of the plurality of virtual machines is reasonable or not according to the memory use information and a preset memory scheduling reference condition;
and the determining module is used for determining the memory scheduling strategy of the virtual machine according to the judgment result.
Optionally, the memory usage information includes:
physical memory size P being used by physical hostiWherein, i refers to the ith period for collecting the memory use information; and the number of the first and second groups,
maximum available memory size ML of operating system of each virtual machineijAnd memory size M being usedijThe current free memory size and the memory size submitted to the system by all application programs in the operating system;
wherein, all virtual machines on the physical host are integrated into a set of VjThe element belongs to VM, j is more than 0 and less than n, n is the total number of the virtual machines, j refers to the jth virtual machine, and i, j and n are positive integers.
Optionally, the preset memory scheduling reference condition includes: first relation, predetermined utilization rate threshold upper limit ΔupThe lower limit of the preset utilization rate threshold is deltalowAnd a predetermined weighting coefficient betaij;
Wherein the first relation comprises: (M)ij×βij)/MLij。
Optionally, the determining module determines whether the memory usage of the plurality of virtual machines is reasonable according to the memory usage information and a preset memory scheduling reference condition, and includes:
when Δ is satisfiedlow≤(Mij×βij)/MLij≤ΔupThen, the virtual machine V in the period i is judgedjThe memory use condition is reasonable;
when satisfying (M)ij×βij)/MLij≤ΔlowThen, the virtual machine V in the period i is judgedjThe memory is in an excessive state, and the use condition is unreasonable;
when Δ is satisfiedup≤(Mij×βij)/MLijThen, the virtual machine V in the period i is judgedjThe memory is in a shortage state, and the use condition is unreasonable.
Optionally, the determining, by the determining module, the determining the memory scheduling policy of the virtual machine according to the determination result includes:
when Δ is satisfiedlow≤(Mij×βij)/MLij≤ΔupIn time, not aiming at the virtual machine V in the (i + 1) th periodjMaximum usable memory ML(i+1)jMake adjustments, ML(i+1)j=MLij;
When satisfying (M)ij×βij)/MLij≤ΔlowThen, the virtual machine V in the (i + 1) th period is adjustedjMemory ML(i+1)jSatisfies the following conditions: ML(i+1)j=(Δup+Δlow)MLij/2;
When Δ is satisfiedup≤(Mij×βij)/MLijThen, the virtual machine V in the (i + 1) th period is adjustedjMemory ML(i+1)jSatisfies the following conditions: ML(i+1)j=MLij+(Δup+Δlow)MLij/2。
Optionally, the determining module is further configured to: after the memory scheduling strategy of each virtual machine is determined, whether the memory use condition of the physical host is normal or not is judged if the memory scheduling is carried out on the virtual machines according to the memory scheduling strategy.
Optionally, the determining module is further configured to: judging whether the memory use condition of the physical host is normal if the virtual machine is subjected to memory scheduling according to the memory scheduling strategy according to the relationship between the following inequality and a preset memory use ratio threshold a of the physical host:
the embodiment of the invention comprises the following steps: monitoring the memory use conditions of the physical host and each virtual machine and periodically collecting memory use information; judging whether the memory use of the multiple virtual machines is reasonable or not according to the memory use information and preset memory scheduling reference conditions; and determining a memory scheduling strategy of the virtual machine according to the judgment result. By the scheme of the embodiment of the invention, the memory utilization rate of the virtual machine is kept balanced, and the resource utilization efficiency of the physical machine is improved.
Additional features and advantages of embodiments of the invention will be set forth in the description which follows, and in part will be obvious from the description, or may be learned by practice of embodiments of the invention. The objectives and other advantages of the embodiments of the invention will be realized and attained by the structure particularly pointed out in the written description and claims hereof as well as the appended drawings.
Drawings
The accompanying drawings are included to provide a further understanding of the embodiments of the invention and are incorporated in and constitute a part of this specification, illustrate embodiments of the invention and together with the examples of the application do not constitute a limitation of the embodiments of the invention.
FIG. 1 is a flowchart of a method for allocating memory of a virtual machine according to an embodiment of the present invention;
fig. 2 is a block diagram of a virtual machine memory allocation apparatus according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention more apparent, the embodiments of the present invention will be described in detail below with reference to the accompanying drawings. It should be noted that the embodiments and features of the embodiments in the present application may be arbitrarily combined with each other without conflict.
The steps illustrated in the flow charts of the figures may be performed in a computer system such as a set of computer-executable instructions. Also, while a logical order is shown in the flow diagrams, in some cases, the steps shown or described may be performed in an order different than here.
To achieve the object of the embodiments of the present invention, an embodiment of the present invention provides a method for allocating a memory of a virtual machine, where the method includes S101 to S103:
s101, monitoring the memory use conditions of the physical host and each virtual machine and periodically collecting memory use information.
In the embodiment of the present invention, in order to implement reasonable allocation of the memory of the virtual machines, the memory usage of the physical host and each virtual machine needs to be monitored, and the memory usage information of the physical host and each virtual machine needs to be collected in real time, so that the memory allocation of the virtual machines in the subsequent sampling period can be specifically adjusted according to the collected memory usage information.
Optionally, the memory usage information may include, but is not limited to:
physical memory size P being used by physical hostiAnd free memory size FiWherein, i refers to the ith period for collecting the memory use information; and the number of the first and second groups,
maximum available memory size ML of operating system of each virtual machineijAnd memory size M being usedijThe current free memory size and the memory size submitted to the system by all application programs in the operating system;
wherein, all virtual machines on the physical host are integrated into a set of VjThe element belongs to VM, j is more than 0 and less than n, n is the total number of the virtual machines, j refers to the jth virtual machine, and i, j and n are positive integers.
In the embodiment of the invention, each item in the memory use information can be collected in a targeted manner according to different application scenes and specific requirements, and the specific item is not limited.
S102, judging whether the memory usage of the multiple virtual machines is reasonable or not according to the memory usage information and preset memory scheduling reference conditions.
Optionally, the preset memory scheduling reference condition includes: first relation, predetermined utilization rate threshold upper limit ΔupThe lower limit of the preset utilization rate threshold is deltalowAnd a predetermined weighting coefficient betaij;
Wherein the first relation comprises: (M)ij×βij)/MLij。
In the embodiment of the present invention, a memory scheduling reference condition may be preset, so as to measure the collected memory usage information according to the reference condition. For example, upper and lower limits of memory utilization, such as the utilization threshold upper limit Δ, may be presetupAnd a lower utilization threshold limit of ΔlowAbove the upper threshold orThe lower limit may be that the memory of the virtual machine is unreasonable to use and needs to be scheduled. It is also possible to preset weighting coefficients corresponding to different items in the memory usage information, such as the weighting coefficient β mentioned aboveijSo as to reserve the memory safety margin for the virtual machine with larger memory use information fluctuation. In addition, a reasonable measurement algorithm may be set to measure the memory usage information according to the various reference conditions, and the measurement algorithm may use, but is not limited to, the first relational expression.
Optionally, the determining whether the memory usage of the plurality of virtual machines is reasonable according to the memory usage information and a preset memory scheduling reference condition may include:
when Δ is satisfiedlow≤(Mij×βij)/MLij≤ΔupThen, the virtual machine V in the period i is judgedjThe memory use condition is reasonable;
when satisfying (M)ij×βij)/MLij≤ΔlowThen, the virtual machine V in the period i is judgedjThe memory is in an excessive state, the memory resource is seriously wasted, and the use condition is unreasonable;
when Δ is satisfiedup≤(Mij×βij)/MLijThen, the virtual machine V in the period i is judgedjThe memory is in a shortage state, more memory needs to be allocated, and the use condition is unreasonable.
S103, determining a memory scheduling strategy of the virtual machine according to the judgment result.
In the embodiment of the present invention, after the memory usage conditions of different virtual machines in different sampling periods are determined through the above steps, memory adjustment can be performed on the different virtual machines according to the memory usage conditions, so that the virtual machine can work according to the adjusted memory conditions in one sampling period, and the work efficiency is improved.
Optionally, determining the memory scheduling policy of the virtual machine according to the determination result may include:
when Δ is satisfiedlow≤(Mij×βij)/MLij≤ΔupWhen it is not rightVirtual machine V in i +1 th periodjMaximum usable memory ML(i+1)jMake adjustments, ML(i+1)j=MLij;
When satisfying (M)ij×βij)/MLij≤ΔlowThen, the virtual machine V in the (i + 1) th period is adjustedjMemory ML(i+1)jSatisfies the following conditions: ML(i+1)j=(Δup+Δlow)MLij/2;
When Δ is satisfiedup≤(Mij×βij)/MLijThen, the virtual machine V in the (i + 1) th period is adjustedjMemory ML(i+1)jSatisfies the following conditions: ML(i+1)j=MLij+(Δup+Δlow)MLij/2。
Optionally, the method further comprises: after the memory scheduling strategy of each virtual machine is determined, whether the memory use condition of the physical host is normal or not is judged if the memory scheduling is carried out on the virtual machines according to the memory scheduling strategy.
Optionally, the method further comprises: judging whether the memory use condition of the physical host is normal if the virtual machine is scheduled according to the memory scheduling strategy by the relation between the following inequality and a preset memory use ratio threshold a of the physical host:
in the embodiment of the present invention, the preset threshold a of the memory utilization of the physical host may be defined by itself according to different application scenarios, and a specific value of the threshold is not limited, and optionally, a is 90%.
If it is notThe utilization rate of the memory of the physical host is not more than 90%, the memory use condition is normal, and the memory scheduling of the virtual machine can be carried out according to the memory scheduling strategy;
if it is notIt is indicated that the physical host memory utilization rate exceeds 90%, and if the memory is in a memory shortage state and the memory scheduling policy is not reasonable, an alarm should be given or a virtual machine should be selected for migration.
In the embodiment of the present invention, under the condition that the memory scheduling policy is available, the dynamic allocation and scheduling of the virtual machine memory in the i +1 cycle are performed according to the memory scheduling policy.
According to the embodiment of the invention, the use conditions of the physical host and the virtual machine memory are monitored and periodically acquired, the virtual machine memory scheduling strategy is determined according to the scheduling algorithm, the memory allocation is reduced for the virtual machine with the low memory utilization rate, and more memories are allocated for the virtual machine with the high memory utilization rate, so that the virtual machine memory utilization rate is kept balanced, and the physical machine resource utilization rate is improved.
The embodiment of the present invention further provides a virtual machine memory allocation apparatus 1, and it should be noted that any embodiment of the foregoing method embodiments is applicable to this apparatus embodiment, and details are not repeated here. As shown in fig. 2, the apparatus may include: the device comprises an acquisition module 11, a judgment module 12 and a determination module 13;
the acquisition module 11 is configured to monitor the memory usage of the physical host and each virtual machine and periodically acquire memory usage information;
the judging module 12 is configured to judge whether memory usage of the plurality of virtual machines is reasonable according to the memory usage information and a preset memory scheduling reference condition;
and the determining module 13 is configured to determine a memory scheduling policy of the virtual machine according to the determination result.
Optionally, the memory usage information includes:
physical memory size P being used by physical hostiAnd free memory size FiWherein, i refers to the ith period for collecting the memory use information; and the number of the first and second groups,
maximum available memory size ML of operating system of each virtual machineijAnd memory size M being usedijCurrent free memory size, and the operationsMaking the memory size submitted to the system by all application programs in the system;
wherein, all virtual machines on the physical host are integrated into a set of VjThe element belongs to VM, j is more than 0 and less than n, n is the total number of the virtual machines, j refers to the jth virtual machine, and i, j and n are positive integers.
Optionally, the preset memory scheduling reference condition includes: first relation, predetermined utilization rate threshold upper limit ΔupThe lower limit of the preset utilization rate threshold is deltalowAnd a predetermined weighting coefficient betaij;
Wherein the first relation comprises: (M)ij×βij)/MLij。
Optionally, the determining module 12 determines whether the memory usage of the multiple virtual machines is reasonable according to the memory usage information and the preset memory scheduling reference condition, including:
when Δ is satisfiedlow≤(Mij×βij)/MLij≤ΔupThen, the virtual machine V in the period i is judgedjThe memory use condition is reasonable;
when satisfying (M)ij×βij)/MLij≤ΔlowThen, the virtual machine V in the period i is judgedjThe memory is in an excessive state, and the use condition is unreasonable;
when Δ is satisfiedup≤(Mij×βij)/MLijThen, the virtual machine V in the period i is judgedjThe memory is in a shortage state, and the use condition is unreasonable.
Optionally, the determining module 13 determines the memory scheduling policy of the virtual machine according to the determination result, including:
when Δ is satisfiedlow≤(Mij×βij)/MLij≤ΔupIn time, not aiming at the virtual machine V in the (i + 1) th periodjMaximum usable memory ML(i+1)jMake adjustments, ML(i+1)j=MLij;
When satisfying (M)ij×βij)/MLij≤ΔlowThen, the virtual machine V in the (i + 1) th period is adjustedjMemory ML(i+1)jSatisfies the following conditions: ML(i+1)j=(Δup+Δlow)MLij/2;
When Δ is satisfiedup≤(Mij×βij)/MLijThen, the virtual machine V in the (i + 1) th period is adjustedjMemory ML(i+1)jSatisfies the following conditions: ML(i+1)j=MLij+(Δup+Δlow)MLij/2。
Optionally, the determining module 12 is further configured to: after the memory scheduling strategy of each virtual machine is determined, whether the memory use condition of the physical host is normal or not is judged if the memory scheduling is carried out on the virtual machines according to the memory scheduling strategy.
Optionally, the determining module 12 is further configured to: judging whether the memory use condition of the physical host is normal if the virtual machine is subjected to memory scheduling according to the memory scheduling strategy according to the relationship between the following inequality and a preset memory use ratio threshold a of the physical host:
the embodiment of the invention comprises the following steps: monitoring the memory use conditions of the physical host and each virtual machine and periodically collecting memory use information; judging whether the memory use of the multiple virtual machines is reasonable or not according to the memory use information and preset memory scheduling reference conditions; and determining a memory scheduling strategy of the virtual machine according to the judgment result. By the scheme of the embodiment of the invention, the memory utilization rate of the virtual machine is kept balanced, and the resource utilization efficiency of the physical machine is improved.
Although the embodiments of the present invention have been described above, the above descriptions are only for the convenience of understanding the present invention, and are not intended to limit the embodiments of the present invention. It will be understood by those skilled in the art that various changes in form and details may be made therein without departing from the spirit and scope of the embodiments of the invention as defined by the appended claims.
Claims (7)
1. A method for allocating memory of a virtual machine, the method comprising:
monitoring the memory use conditions of the physical host and each virtual machine and periodically collecting memory use information;
judging whether the memory use of the multiple virtual machines is reasonable or not according to the memory use information and preset memory scheduling reference conditions;
determining the memory scheduling strategy of the virtual machine according to the judgment result,
judging whether the memory use condition of the physical host is normal if the memory scheduling is carried out on the virtual machine according to the memory scheduling strategy, if so, judging whether the memory use condition of the physical host is normal, otherwisePerforming virtual machine memory scheduling according to the memory scheduling strategy; if it is not The virtual machine is alerted or selected for migration,
the memory usage information includes:
the physical memory size P being used by the physical hostiWherein, i refers to the ith period for collecting the memory use information; and the number of the first and second groups,
the maximum available memory size ML of the operating system of each virtual machineijAnd memory size M being usedij;
Wherein, all virtual machines on the physical host are integrated into a set of VjThe element belongs to VM, j is more than 0 and less than n, n is the total number of the virtual machines, j refers to the jth virtual machine, and i, j and n are positive integers.
2. The method according to claim 1, wherein the preset memory scheduling reference condition comprises: first, theA relation, a predetermined utilization rate threshold upper limit DeltaupThe lower limit of the preset utilization rate threshold is deltalowAnd a predetermined weighting coefficient betaij;
Wherein the first relation comprises: (M)ij×βij)/MLij。
3. The method according to claim 2, wherein the determining whether the memory usage of the plurality of virtual machines is reasonable according to the memory usage information and a preset memory scheduling reference condition comprises:
when Δ is satisfiedlow≤(Mij×βij)/MLij≤ΔupIn time, the virtual machine V in the period i is judgedjThe memory use condition is reasonable;
when satisfying (M)ij×βij)/MLij≤ΔlowThen, the virtual machine V in the period i is judgedjThe memory is in an excessive state, and the use condition is unreasonable;
when Δ is satisfiedup≤(Mij×βij)/MLijThen, the virtual machine V in the period i is judgedjThe memory is in a shortage state, and the use condition is unreasonable.
4. The method according to claim 3, wherein the determining the memory scheduling policy of the virtual machine according to the determination result comprises:
when Δ is satisfiedlow≤(Mij×βij)/MLij≤ΔupIn time, not aiming at the virtual machine V in the (i + 1) th periodjMaximum usable memory ML(i+1)jMake adjustments, ML(i+1)j=MLij;
When satisfying (M)ij×βij)/MLij≤ΔlowThen, the virtual machine V in the (i + 1) th period is adjustedjMemory ML(i+1)jSatisfies the following conditions: ML(i+1)j=(Δup+Δlow)MLij/2;
When Δ is satisfiedup≤(Mij×βij)/MLijThen, the virtual machine V in the (i + 1) th period is adjustedjMemory ML(i+1)jSatisfies the following conditions: ML(i+1)j=MLij+(Δup+Δlow)MLij/2。
5. An apparatus for allocating memory of a virtual machine, the apparatus comprising: the device comprises an acquisition module, a judgment module and a determination module;
the acquisition module is used for monitoring the memory use conditions of the physical host and each virtual machine and periodically acquiring the memory use information;
the judging module is used for judging whether the memory use of the multiple virtual machines is reasonable or not according to the memory use information and a preset memory scheduling reference condition;
the determining module is used for determining a memory scheduling strategy of the virtual machine according to the judgment result; judging whether the memory use condition of the physical host is normal if the memory scheduling is carried out on the virtual machine according to the memory scheduling strategy, if so, judging whether the memory use condition of the physical host is normal, otherwisePerforming virtual machine memory scheduling according to the memory scheduling strategy; if it is notThe virtual machine is alerted or selected for migration,
the memory usage information includes:
the physical memory size P being used by the physical hostiWherein, i refers to the ith period for collecting the memory use information; and the number of the first and second groups,
the maximum available memory size ML of the operating system of each virtual machineijAnd memory size M being usedij;
Wherein, all virtual machines on the physical host are integrated into a set of VjThe element belongs to VM, j is more than 0 and less than n, n is the total number of the virtual machines, j refers to the jth virtual machine, and i, j and n are positive integers.
6. The apparatus according to claim 5, wherein the preset memory scheduling reference condition comprises: first relation, predetermined utilization rate threshold upper limit ΔupThe lower limit of the preset utilization rate threshold is deltalowAnd a predetermined weighting coefficient betaij;
Wherein the first relation comprises: (M)ij×βij)/MLij。
7. The apparatus according to claim 6, wherein the determining module determines whether the memory usage of the plurality of virtual machines is reasonable according to the memory usage information and a preset memory scheduling reference condition includes:
when Δ is satisfiedlow≤(Mij×βij)/MLij≤ΔupIn time, the virtual machine V in the period i is judgedjThe memory use condition is reasonable;
when satisfying (M)ij×βij)/MLij≤ΔlowThen, the virtual machine V in the period i is judgedjThe memory is in an excessive state, and the use condition is unreasonable;
when Δ is satisfiedup≤(Mij×βij)/MLijThen, the virtual machine V in the period i is judgedjThe memory is in a shortage state, and the use condition is unreasonable;
the determining module determines the memory scheduling policy of the virtual machine according to the judgment result, including:
when Δ is satisfiedlow≤(Mij×βij)/MLij≤ΔupIn time, not aiming at the virtual machine V in the (i + 1) th periodjMaximum usable memory ML(i+1)jMake adjustments, ML(i+1)j=MLij;
When satisfying (M)ij×βij)/MLij≤ΔlowThen, the virtual machine V in the (i + 1) th period is adjustedjMemory ML(i+1)jSatisfies the following conditions: ML(i+1)j=(Δup+Δlow)MLij/2;
When Δ is satisfiedup≤(Mij×βij)/MLijThen, the virtual machine V in the (i + 1) th period is adjustedjMemory ML(i+1)jSatisfies the following conditions: ML(i+1)j=MLij+(Δup+Δlow)MLij/2。
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710580787.7A CN107341060B (en) | 2017-07-17 | 2017-07-17 | Virtual machine memory allocation method and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710580787.7A CN107341060B (en) | 2017-07-17 | 2017-07-17 | Virtual machine memory allocation method and device |
Publications (2)
Publication Number | Publication Date |
---|---|
CN107341060A CN107341060A (en) | 2017-11-10 |
CN107341060B true CN107341060B (en) | 2021-02-05 |
Family
ID=60219217
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201710580787.7A Active CN107341060B (en) | 2017-07-17 | 2017-07-17 | Virtual machine memory allocation method and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN107341060B (en) |
Families Citing this family (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108196942B (en) * | 2018-02-01 | 2021-09-03 | 成都禾苗云科技有限公司 | Quick starting method of memory over-allocation virtual machine |
CN112965792B (en) * | 2021-05-18 | 2021-07-30 | 云宏信息科技股份有限公司 | Method for allocating memory for multiple virtual machines, computer readable storage medium |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103259813A (en) * | 2012-02-17 | 2013-08-21 | 鸿富锦精密工业(深圳)有限公司 | Method of automatically expanding virtual machines |
CN103605613A (en) * | 2013-11-21 | 2014-02-26 | 中标软件有限公司 | Method and system for dynamically adjusting virtual-machine memory in cloud computing environment |
CN105677485A (en) * | 2016-01-08 | 2016-06-15 | 中电科华云信息技术有限公司 | Memory dynamic adjusting method for cloud desktop host and virtual machine |
CN106648885A (en) * | 2016-10-17 | 2017-05-10 | 深圳市深信服电子科技有限公司 | Dynamic allocation method, device and system for resources of virtual machine |
CN106776048A (en) * | 2017-01-24 | 2017-05-31 | 郑州云海信息技术有限公司 | A kind of real time virtual machine scheduling memory method and device |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US8095931B1 (en) * | 2006-04-27 | 2012-01-10 | Vmware, Inc. | Controlling memory conditions in a virtual machine |
-
2017
- 2017-07-17 CN CN201710580787.7A patent/CN107341060B/en active Active
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103259813A (en) * | 2012-02-17 | 2013-08-21 | 鸿富锦精密工业(深圳)有限公司 | Method of automatically expanding virtual machines |
CN103605613A (en) * | 2013-11-21 | 2014-02-26 | 中标软件有限公司 | Method and system for dynamically adjusting virtual-machine memory in cloud computing environment |
CN105677485A (en) * | 2016-01-08 | 2016-06-15 | 中电科华云信息技术有限公司 | Memory dynamic adjusting method for cloud desktop host and virtual machine |
CN106648885A (en) * | 2016-10-17 | 2017-05-10 | 深圳市深信服电子科技有限公司 | Dynamic allocation method, device and system for resources of virtual machine |
CN106776048A (en) * | 2017-01-24 | 2017-05-31 | 郑州云海信息技术有限公司 | A kind of real time virtual machine scheduling memory method and device |
Also Published As
Publication number | Publication date |
---|---|
CN107341060A (en) | 2017-11-10 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN101488098B (en) | Multi-core computing resource management system based on virtual computing technology | |
US8910153B2 (en) | Managing virtualized accelerators using admission control, load balancing and scheduling | |
CN104102543B (en) | The method and apparatus of adjustment of load in a kind of cloud computing environment | |
CN102521055B (en) | Virtual machine resource allocating method and virtual machine resource allocating system | |
CN102508718A (en) | Method and device for balancing load of virtual machine | |
CN103336722B (en) | A kind of CPU resources of virtual machine monitoring and dynamic allocation method | |
US20130167152A1 (en) | Multi-core-based computing apparatus having hierarchical scheduler and hierarchical scheduling method | |
CN105389211B (en) | Memory allocation method and delay perception-Memory Allocation device suitable for NUMA architecture | |
CN109558216B (en) | Single root I/O virtualization optimization method and system based on online migration | |
CN103955398A (en) | Virtual machine coexisting scheduling method based on processor performance monitoring | |
CN114048006B (en) | Virtual machine dynamic migration method, device and storage medium | |
CN103984602A (en) | VM (virtual machine) resource scheduling method, device and system | |
CN104598298A (en) | Virtual machine dispatching algorithm based on task load and current work property of virtual machine | |
WO2021206711A1 (en) | Execution prediction for compute clusters with multiple cores | |
CN103823541A (en) | Equipment and method for energy-saving dispatching of virtual data center | |
CN111190739A (en) | Resource allocation method and device, electronic equipment and storage medium | |
CN105117285A (en) | Non-volatile memory schedule optimization method based on mobile virtualization system | |
CN107341060B (en) | Virtual machine memory allocation method and device | |
CN107370783B (en) | Scheduling method and device for cloud computing cluster resources | |
CN104572279A (en) | Node binding-supporting virtual machine dynamic scheduling method | |
CN114579284B (en) | Task scheduling method and device | |
CN107423114B (en) | Virtual machine dynamic migration method based on service classification | |
CN110096339A (en) | A kind of scalable appearance configuration recommendation system and method realized based on system load | |
CN105528054A (en) | Cluster system comprehensive scheduling energy saving method and device | |
CN110825212B (en) | Energy-saving scheduling method and device and computer storage medium |
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 | ||
TA01 | Transfer of patent application right | ||
TA01 | Transfer of patent application right |
Effective date of registration: 20210107 Address after: Building 9, No.1, guanpu Road, Guoxiang street, Wuzhong Economic Development Zone, Wuzhong District, Suzhou City, Jiangsu Province Applicant after: SUZHOU LANGCHAO INTELLIGENT TECHNOLOGY Co.,Ltd. Address before: Room 1601, floor 16, 278 Xinyi Road, Zhengdong New District, Zhengzhou City, Henan Province Applicant before: ZHENGZHOU YUNHAI INFORMATION TECHNOLOGY Co.,Ltd. |
|
GR01 | Patent grant | ||
GR01 | Patent grant |