CN107273212A - A kind of method and system of dynamic assigning memory - Google Patents
A kind of method and system of dynamic assigning memory Download PDFInfo
- Publication number
- CN107273212A CN107273212A CN201710486098.XA CN201710486098A CN107273212A CN 107273212 A CN107273212 A CN 107273212A CN 201710486098 A CN201710486098 A CN 201710486098A CN 107273212 A CN107273212 A CN 107273212A
- Authority
- CN
- China
- Prior art keywords
- virtual machine
- memory
- host
- maximum
- configuration file
- 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.)
- Pending
Links
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
-
- 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
- G06F2009/45583—Memory management, e.g. access or allocation
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)
Abstract
The invention discloses a kind of method and system of dynamic assigning memory, this method on host by running real-time monitor (RTM), the free memory of host and the memory usage of all virtual machines are monitored in real time, it is adjusted according to monitoring come the memory size to virtual machine, when the memory requirements of virtual machine exceedes the maximum memory of configuration, host carries out the dilatation of internal memory according to the performance of itself to virtual machine, make virtual machine obtain bigger internal memory to improve the service feature of virtual machine, realize that the internal memory of virtual machine is super and use;In addition, when running multiple virtual machines on host, due to considering host in the state of the internal memory of increase virtual machine, the free memory service condition of host oneself, to ensure that host business can normally be run.
Description
Technical field
The present invention relates to virtualization Memory Allocation technical field, the method for more particularly to a kind of dynamic assigning memory and it is
System.
Background technology
Virtualization, refers to that by virtualization technology be many logical computers by a computer virtual, i.e.,:In a meter
Multiple logical computers are run simultaneously on calculation machine, each logical computer can run different operating systems, and application program
It can run and be independent of each other in separate space, so as to significantly improve the operating efficiency of computer.
Memory Allocation of the host to virtual machine is realized using internal memory ball technique at present, host is by monitoring all void
The internal memory service condition of plan machine, to internal memory using the dynamic increase internal memory of higher virtual machine, internal memory uses relatively low virtual motor-driven
State releasing memory.When the Out of Memory used time of virtual machine, internal memory balloon is distributed in more by compression, host to virtual machine
Deposit and use.The maximum memory value MAX of internal memory is set when carrying out virtual machine configuration, checks that internal memory uses feelings by free orders
Condition, the memory size just looked at is the internal memory situation that virtual machine is currently able to use, but is allocated to the maximum memory of virtual machine
The maximum memory value MAX of virtual machine is distributed to during no more than virtual machine configuration.As shown in figure 1, free memory value VmTo be virtual
Machine is currently using the maximum set with the memory size sum that can be used, internal memory maximum MAX when being virtual machine configuration
Memory size, as the free memory value V of virtual machinemWhen not enough, host needs to distribute more internal memories to virtual machine, still
Free memory value VmMaximum no more than maximum memory value MAX.In addition, when running multiple virtual machines on virtual platform, it is many
The internal memory of individual virtual machine is allocated by host, if but multiple virtual machines simultaneously be required for increase internal memory when, may cause
The free memory of host is too small, influences the performance of host, the performance of final influence virtual machine.
The content of the invention
It is an object of the invention to propose a kind of method and system of dynamic assigning memory, to solve to work as void in the prior art
When the free memory of plan machine is not enough, host distributes to the maximum memory of virtual machine no more than the most imperial palace set when configuring
Deposit value MAX;If in addition, multiple virtual machines are required for increase internal memory simultaneously when, the free memory of host may be caused too small, shadow
The problem of ringing the performance of host, final influence virtual machine performance.
To reach above-mentioned purpose, the invention provides following technical scheme:
A kind of method of dynamic assigning memory, applied to host, operation has multiple virtual machines in the host, described
Method includes:
The internal memory for building multiple virtual machines uses monitoring table, and is synchronized to the domain configuration file of the virtual machine;
The memory usage of the host and multiple virtual machines is monitored in real time;
Virtual machine is most according to the memory usage dynamically distributes of the host and multiple virtual machines
Big memory size;
When the memory usage of the virtual machine is higher than the first preset value, the memory usage of the host is judged,
If the memory usage of the host is less than the second preset value, the maximum memory capacity of the virtual machine is distributed in increase,
And recorded the internal memory of the virtual machine and use monitoring table, and it is synchronized to the domain configuration file;
When the memory usage of the virtual machine is less than three preset values, the most imperial palace of the virtual machine is distributed in reduction
Capacity is deposited, and recorded the internal memory of the virtual machine and uses monitoring table, and is synchronized to the domain configuration file.
Wherein, the internal memory for building multiple virtual machines is using monitoring table, and is synchronized to the domain of the virtual machine and matches somebody with somebody
File is put, including:
Inquire about the virtual machine that all running statuses on the host are operation;
The initial information for recording the virtual machine uses monitoring table to the internal memory, and the initial information includes:The void
The maximum memory value set when the title of plan machine, ID addresses, configuration;
The internal memory is synchronized to the domain configuration file of the virtual machine using monitoring table.
Wherein, it is described when the memory usage of the virtual machine is higher than the first preset value, judge the interior of the host
Utilization rate is deposited, if the memory usage of the host is less than the second preset value, the maximum of the virtual machine is distributed in increase
Memory size, and recorded the internal memory of the virtual machine and use monitoring table, and the domain configuration file is synchronized to, including:
When the memory usage of the virtual machine is higher than first preset value, the configuration of territory text of the virtual machine is obtained
The maximum memory amount MAX stored in part, it is the maximum memory amount MAX to obtain needing to the increased memory size of the virtual machine
1/2;
Calculate the host to add after internal memory to the virtual machine, judge that the remaining internal memory of the host is used
Rate, if the remaining memory usage of the host is less than second preset value, calls dilatation function to adjust the virtual machine
Maximum memory value be 1.5MAX;
The internal memory that memory size after adjustment is updated into the virtual machine uses monitoring table, and is synchronized to the virtual machine
Domain configuration file.
Wherein, described when the memory usage of the virtual machine is less than three preset values, reduction is distributed to described virtual
The maximum memory capacity of machine, and recorded the internal memory of the virtual machine and use monitoring table, and the domain configuration file is synchronized to, wrapped
Include:
When the memory usage of the virtual machine is less than three preset value, the configuration of territory text of the virtual machine is obtained
The maximum memory amount MAX stored in part, then the memory size of reduction is the 1/2 of the maximum memory amount MAX;
The maximum memory value for calling capacity reducing function to adjust the virtual machine is 0.5MAX;
The internal memory that memory size after adjustment is updated into the virtual machine uses monitoring table, and is synchronized to the virtual machine
Domain configuration file.
Wherein, current memory value of the memory usage of the virtual machine for the virtual machine and the domain from the virtual machine
The ratio of the maximum memory value obtained in configuration file.
A kind of system of dynamic assigning memory, applied to host, operation has multiple virtual machines in the host, described
System includes:
Construction unit, the internal memory for building multiple virtual machines uses monitoring table, and is synchronized to the virtual machine
Domain configuration file;
Monitoring unit, the memory usage for monitoring the host and multiple virtual machines in real time;
Allocation unit, it is empty according to the memory usage dynamically distributes of the host and multiple virtual machines
The maximum memory capacity of plan machine;
Dilatation unit, for when the memory usage of the virtual machine is higher than the first preset value, judging the host
Memory usage, if the memory usage of the host be less than the second preset value, increase distribute to the virtual machine
Maximum memory capacity, and recorded the internal memory of the virtual machine and use monitoring table, and it is synchronized to the domain configuration file;
Capacity reducing unit, for when the memory usage of the virtual machine is less than three preset values, reduction to be distributed to described
The maximum memory capacity of virtual machine, and recorded the internal memory of the virtual machine and use monitoring table, and it is synchronized to configuration of territory text
Part.
Wherein, the construction unit includes:
Query unit, for inquiring about the virtual machine that all running statuses on the host are operation;
Recording unit, monitoring table, the initial letter are used for recording the initial information of the virtual machine to the internal memory
Breath includes:The maximum memory value set when the title of the virtual machine, ID addresses, configuration;
Synchronization unit, the domain configuration file for the internal memory to be synchronized to the virtual machine using monitoring table.
Wherein, the dilatation unit includes:
Increase-volume computing unit, for when the memory usage of the virtual machine is higher than first preset value, obtaining institute
The maximum memory amount MAX stored in the domain configuration file for stating virtual machine, obtains needing to give the virtual machine increased memory size
For the 1/2 of the maximum memory amount MAX;
Computing unit, is added after internal memory for calculating the host to the virtual machine, judges that the host is remained
Remaining memory usage, if the remaining memory usage of the host is less than second preset value, calls dilatation function to adjust
The maximum memory value of the whole virtual machine is 1.5MAX;
First adjustment unit, the internal memory for the memory size after adjustment to be updated to the virtual machine uses monitoring table,
And it is synchronized to the domain configuration file of the virtual machine.
Wherein, the capacity reducing unit includes:
Capacity reducing computing unit, for when the memory usage of the virtual machine is less than three preset value, obtaining institute
The maximum memory amount MAX stored in the domain configuration file for stating virtual machine, then the memory size of reduction is the maximum memory amount MAX
1/2;
Call unit, for calling the maximum memory value that capacity reducing function adjusts the virtual machine to be 0.5MAX;
Second adjustment unit, the internal memory for the memory size after adjustment to be updated to the virtual machine uses monitoring table,
And it is synchronized to the domain configuration file of the virtual machine.
Wherein, current memory value of the memory usage of the virtual machine for the virtual machine and the domain from the virtual machine
The ratio of the maximum memory value obtained in configuration file.
Understand that compared with prior art, the invention discloses a kind of dynamic assigning memory via above-mentioned technical scheme
Method, this method on host by running real-time monitor (RTM), free memory and all virtual machines in real time to host
Memory usage be monitored, according to monitoring be adjusted come the memory size to virtual machine, in the memory requirements of virtual machine
More than configuration maximum memory when, host according to the performance of itself to virtual machine carry out internal memory dilatation, obtain virtual machine
Bigger internal memory improves the service feature of virtual machine, realizes that the internal memory of virtual machine is super and uses;In addition, multiple when being run on host
During virtual machine, due to considering host in the state of the internal memory of increase virtual machine, the free memory of host oneself is used
Situation, to ensure that host business can normally be run.The invention also discloses a kind of system of dynamic assigning memory.
Brief description of the drawings
In order to illustrate more clearly about the embodiment of the present invention or technical scheme of the prior art, below will be to embodiment or existing
There is the accompanying drawing used required in technology description to be briefly described, it should be apparent that, drawings in the following description are only this
The embodiment of invention, for those of ordinary skill in the art, on the premise of not paying creative work, can also basis
The accompanying drawing of offer obtains other accompanying drawings.
Fig. 1 is in the prior art using the internal memory change schematic diagram of internal memory ball technique;
Fig. 2 is a kind of method flow schematic diagram for dynamic assigning memory that the embodiment of the present invention one is provided;
Fig. 3 is a kind of method flow schematic diagram for dynamic assigning memory that the embodiment of the present invention two is provided;
Fig. 4 is a kind of system structure diagram for dynamic assigning memory that the embodiment of the present invention three is provided.
Embodiment
Below in conjunction with the accompanying drawing in the embodiment of the present invention, the technical scheme in the embodiment of the present invention is carried out clear, complete
Site preparation is described, it is clear that described embodiment is only a part of embodiment of the invention, rather than whole embodiments.It is based on
Embodiment in the present invention, it is every other that those of ordinary skill in the art are obtained under the premise of creative work is not made
Embodiment, belongs to the scope of protection of the invention.
The premise that existing scheme and this programme are used:
Linux operating systems are mounted with virt balloon driving, and kernel opens CONFIG_VIRTIO_BALLOON;
The internal memory balloon option of the domain file configuration of virtual machine<Memballoon model='virtio'><address
Type='pci'domain='0x0000'bus='0x00'slot='0x07'function=' 0x0'/></
memballoon>;
The application is realized by python scripted codes, the life provided by libvirt virtualization management tools component
Order row.With reference to the offer api for virtual platform software libvrit components of increasing income, embedded c codes are called api, whole to complete
Individual scheme.The monitoring programme of the program is run on host, in real time the monitoring free memory of host, all virtual machines it is interior
Deposit utilization rate, according to the api programs for calling libvirt judge whether to carry out some or some virtual machines internal memory increase or
Release.
Embodiment one
Accompanying drawing 2 is referred to, Fig. 2 is a kind of method flow signal for dynamic assigning memory that the embodiment of the present invention one is provided
Figure.As shown in Fig. 2 the embodiments of the invention provide a kind of method of dynamic assigning memory, applied to host, including:It is described
Operation has multiple virtual machines in host, and methods described specific steps include as follows:
S201, the internal memory of the multiple virtual machines of structure are synchronized to the configuration of territory text of the virtual machine using monitoring table
Part.
It should be noted that then calling libvirt's firstly the need of the global chained list for creating virtual machine in the present embodiment
Api, inquires all running statuses on host and is the virtual machine of operation, and record the title of virtual machine, ID addresses, match somebody with somebody
Memory size is put into the global chained list of virtual machine.
Specifically, the internal memory for building multiple virtual machines is using monitoring table, and it is synchronized to the domain of the virtual machine
Configuration file, including:
Inquire about the virtual machine that all running statuses on the host are operation;
The initial information for recording the virtual machine uses monitoring table to the internal memory, and the initial information includes:The void
The maximum memory value set when the title of plan machine, ID addresses, configuration;
The internal memory is synchronized to the domain configuration file of the virtual machine using monitoring table.
S202, the memory usage for monitoring the host and multiple virtual machines in real time.
It should be noted that running the monitoring programme of the program in the present embodiment on host, host is monitored in real time
Free memory, the memory usage of all virtual machines, according to the api programs for calling libvirt judge whether to some or
Some virtual machines carry out internal memory increase or release.
S203, the virtual machine according to the memory usage dynamically distributes of the host and multiple virtual machines
Maximum memory capacity.
S204, when the virtual machine memory usage be higher than the first preset value when, judging the internal memory of the host makes
With rate, if the memory usage of the host is less than the second preset value, the maximum memory of the virtual machine is distributed in increase
Capacity, and recorded the internal memory of the virtual machine and use monitoring table, and it is synchronized to the domain configuration file.
Specifically, the step can be divided into following steps:
When the memory usage of the virtual machine is higher than first preset value, the configuration of territory text of the virtual machine is obtained
The maximum memory amount MAX stored in part, it is the maximum memory amount MAX to obtain needing to the increased memory size of the virtual machine
1/2;
Calculate the host to add after internal memory to the virtual machine, judge that the remaining internal memory of the host is used
Rate, if the remaining memory usage of the host is less than second preset value, calls dilatation function to adjust the virtual machine
Maximum memory value be 1.5MAX;
The internal memory that memory size after adjustment is updated into the virtual machine uses monitoring table, and is synchronized to the virtual machine
Domain configuration file.
S205, when the virtual machine memory usage be less than three preset values when, reduction distribute to the virtual machine
Maximum memory capacity, and recorded the internal memory of the virtual machine and use monitoring table, and it is synchronized to the domain configuration file.
Specifically, the step can be divided into following steps:
When the memory usage of the virtual machine is less than three preset value, the configuration of territory text of the virtual machine is obtained
The maximum memory amount MAX stored in part, then the memory size of reduction is the 1/2 of the maximum memory amount MAX;
The maximum memory value for calling capacity reducing function to adjust the virtual machine is 0.5MAX;
The internal memory that memory size after adjustment is updated into the virtual machine uses monitoring table, and is synchronized to the virtual machine
Domain configuration file.
It is preferred that, the memory usage of virtual machine described above for the virtual machine current memory value with from described virtual
The ratio of the maximum memory value obtained in the domain configuration file of machine.
A kind of method of dynamic assigning memory is present embodiments provided, this method on host by running monitoring in real time
Program, in real time the memory usage of the free memory to host and all virtual machines be monitored, according to monitoring come to virtual
The memory size of machine is adjusted, virtual machine memory requirements exceed configuration maximum memory when, host according to itself
Performance carries out the dilatation of internal memory to virtual machine, makes virtual machine obtain bigger internal memory to improve the service feature of virtual machine, realizes
The internal memory of virtual machine is super to be used;In addition, when running multiple virtual machines on host, due to considering host in increase virtual machine
Internal memory in the state of, the free memory service condition of host oneself, to ensure that host business can normally be run.
By the present embodiment in some scenarios, what is set when the internal memory that virtual machine can be used is more than configuration virtual machine is interior
Maximum is deposited, when virtual machine carries the service of outward service, a large amount of expenses of the internal memory brought of portfolio increase can be tackled,
Ensureing the performance of virtual machine will not drastically decline because of the increase of the amount of business;In addition, when the internal memory of virtual machine uses peak,
Increase internal memory to virtual machine, when the internal memory of virtual machine is in using low ebb, internal memory is reduced to virtual machine;All virtual machines are met to exist
The internal memory allocation optimum of current business, makes full use of total internal memory of virtual platform.
Embodiment two
Accompanying drawing 3 is referred to, Fig. 3 is a kind of method flow signal for dynamic assigning memory that the embodiment of the present invention two is provided
Figure.As shown in figure 3, the embodiments of the invention provide a kind of method of dynamic assigning memory, applied to host, including:It is described
Operation has multiple virtual machines in host, and methods described specific steps include as follows:
S301, the global listings for creating virtual machine, and record the initial information of each virtual machine.
, it is necessary to call libvirt api in the present embodiment, inquiring all running statuses run on host is
Running virtual machine, and the maximum memory value set when recording the title of virtual machine, ID addresses, configuring arrives virtual machine
In global listings.
Current virtual machine in S302, inquiry global listings.
It should be noted that be first virtual machine when program is run first, and in the case of not power down, program operation
When be not necessarily first virtual machine.
S303, judge whether virtual machine is last virtual machine in global listings, if so, step S304 is then performed,
If it is not, then performing step S305.
S304, program dormancy are continued executing with after 1 minute, obtain first virtual machine in virtual machine global listings.
S305, the api orders by encapsulating libvirt inquire about virtual machine current memory size, and are recorded as current memory
Value.
S306, opening current virtual machine domain configuration file, obtain the maximum memory size of the virtual machine of configuration, are recorded as void
The configuration maximum memory value of plan machine.
S307, the configuration maximum memory value according to current memory value and virtual machine, calculate virutal machine memory utilization rate.
S308, whether the memory usage of virtual machine is judged more than 80%, if so, step S309 is then performed, if it is not, then holding
Row step 314.
S309, calculating need to give virtual machine increased amount of ram madd, and reading virtual machine by domain configuration file first sets
The maximum memory capacity max put, then increased capacity is the 1/2 of configuration maximum memory capacity.
S310, calculating host are after internal memory is added to virtual machine, remaining memory usage.
Calculation is:Free memory total amount on (amount of ram+madd that current host is used)/host.
S311, judge whether the remaining memory usage of host has exceeded 80%, if so, then passing through the overall situation of virtual machine
List gets next virtual machine, then skips to return to step S305;If it is not, then skipping to step 8 continues next step operation;
S312, acquisition maximum memory capacity max, the program that determines need the maximum memory capacity parameter set to be 1.5*max.
S313, call on-line rapid estimation module, the greatest content amount for setting virtual machine is 1.5*max, then by adjustment
Deposit capacity to update into the global listings of virtual machine, then perform step S316, skip to step 303 and continue executing with.
314th, judge whether the memory usage of virtual machine is less than 20%, continued executing with if so, then skipping to step S315.
S315, calculating need the amount of ram to virtual machine reduction.The amount of ram is by reading the domain configuration file of virtual machine
To obtain the maximum memory amount max of virtual machine configuration, the amount of ram of reduction is worth 1/2 for max, calls online capacity reducing module, if
The maximum memory for putting virtual machine is 0.5max, and the memory size of adjustment is updated into the global listings of virtual machine, run succeeded
Afterwards, step S316 is then performed, step 303 is skipped to and continues executing with.
S316, the domain configuration file that virtual machine global listings are synchronized to virtual machine, are obtained by virtual machine global listings
Next virtual machine.
Specifically, when the memory requirements of virtual machine exceedes the maximum memory value set during configuration virtual machine, automatic increase is most
Big memory value, makes virtual machine obtain bigger internal memory to improve the service feature of virtual machine.
The internal memories of whole virtual machines is set up using monitoring table, less virtual machine is used for internal memory, timely releasing memory,
Turn maximum memory value down automatically simultaneously, it is ensured that available total interior state that there is a relative maximum of host.Real-time mode is repaiied
Change the maximum memory of virtual machine configuration, the internal memory of virtual machine can be made to exceed the maximum memory of configuration, the internal memory of virtual machine is realized
It is super to use.
The memory usage of all virtual machines is traveled through, when the internal memory of virtual machine is used below 20%, the void is reduced online
The maximum memory of plan machine distribution, when the memory usage of virtual machine is more than 80%, judges the internal memory residual capacity of host, counts
The increased amount of ram of maximum memory needs that the virtual machine is distributed in increase is calculated, increased amount of ram as needed judges increase
Afterwards, the memory usage of host, if the memory usage of host has exceeded 80%, refusal is this time operated, to ensure
Host business can normally be run.
A kind of method of dynamic assigning memory is present embodiments provided, this method on host by running monitoring in real time
Program, in real time the memory usage of the free memory to host and all virtual machines be monitored, according to monitoring come to virtual
The memory size of machine is adjusted, virtual machine memory requirements exceed configuration maximum memory when, host according to itself
Performance carries out the dilatation of internal memory to virtual machine, makes virtual machine obtain bigger internal memory to improve the service feature of virtual machine, realizes
The internal memory of virtual machine is super to be used;In addition, when running multiple virtual machines on host, due to considering host in increase virtual machine
Internal memory in the state of, the free memory service condition of host oneself, to ensure that host business can normally be run.
The present invention also discloses corresponding system on the basis of method disclosed above.
A kind of system of dynamic assigning memory provided in an embodiment of the present invention is introduced below, it is necessary to illustrate,
The method that explanation about the system can refer to dynamic assigning memory provided above, is not repeated below.
Embodiment three
Accompanying drawing 4 is referred to, Fig. 4 is a kind of system architecture signal for dynamic assigning memory that the embodiment of the present invention three is provided
Figure.As shown in figure 4, the embodiments of the invention provide a kind of system of dynamic assigning memory, applied to host, including:It is described
Operation has multiple virtual machines in host, and the system concrete structure includes as follows:
Construction unit 401, the internal memory for building multiple virtual machines uses monitoring table, and is synchronized to the virtual machine
Domain configuration file;
Monitoring unit 402, the memory usage for monitoring the host and multiple virtual machines in real time;
Allocation unit 403, according to the memory usage dynamically distributes institute of the host and multiple virtual machines
State the maximum memory capacity of virtual machine;
Dilatation unit 404, for when the memory usage of the virtual machine is higher than the first preset value, judging the host
The memory usage of machine, if the memory usage of the host is less than the second preset value, the virtual machine is distributed in increase
Maximum memory capacity, and recorded the internal memory of the virtual machine and use monitoring table, and be synchronized to the domain configuration file;
Capacity reducing unit 405, for when the memory usage of the virtual machine is less than three preset values, institute to be distributed in reduction
The maximum memory capacity of virtual machine is stated, and recorded the internal memory of the virtual machine and uses monitoring table, and is synchronized to the configuration of territory
File.
Specifically, the construction unit 401 can include:
Query unit, for inquiring about the virtual machine that all running statuses on the host are operation;
Recording unit, monitoring table, the initial letter are used for recording the initial information of the virtual machine to the internal memory
Breath includes:The maximum memory value set when the title of the virtual machine, ID addresses, configuration;
Synchronization unit, the domain configuration file for the internal memory to be synchronized to the virtual machine using monitoring table.
Specifically, the dilatation unit 404 can include:
Increase-volume computing unit, for when the memory usage of the virtual machine is higher than first preset value, obtaining institute
The maximum memory amount MAX stored in the domain configuration file for stating virtual machine, obtains needing to give the virtual machine increased memory size
For the 1/2 of the maximum memory amount MAX;
Computing unit, is added after internal memory for calculating the host to the virtual machine, judges that the host is remained
Remaining memory usage, if the remaining memory usage of the host is less than second preset value, calls dilatation function to adjust
The maximum memory value of the whole virtual machine is 1.5MAX;
First adjustment unit, the internal memory for the memory size after adjustment to be updated to the virtual machine uses monitoring table,
And it is synchronized to the domain configuration file of the virtual machine.
Specifically, the capacity reducing unit 405 can include:
Capacity reducing computing unit, for when the memory usage of the virtual machine is less than three preset value, obtaining institute
The maximum memory amount MAX stored in the domain configuration file for stating virtual machine, then the memory size of reduction is the maximum memory amount MAX
1/2;
Call unit, for calling the maximum memory value that capacity reducing function adjusts the virtual machine to be 0.5MAX;
Second adjustment unit, the internal memory for the memory size after adjustment to be updated to the virtual machine uses monitoring table,
And it is synchronized to the domain configuration file of the virtual machine.
A kind of system of dynamic assigning memory is present embodiments provided, the system on host by running monitoring in real time
Program, in real time the memory usage of the free memory to host and all virtual machines be monitored, according to monitoring come to virtual
The memory size of machine is adjusted, virtual machine memory requirements exceed configuration maximum memory when, host according to itself
Performance carries out the dilatation of internal memory to virtual machine, makes virtual machine obtain bigger internal memory to improve the service feature of virtual machine, realizes
The internal memory of virtual machine is super to be used;In addition, when running multiple virtual machines on host, due to considering host in increase virtual machine
Internal memory in the state of, the free memory service condition of host oneself, to ensure that host business can normally be run.
It should be noted that herein, such as first and second or the like relational terms are used merely to a reality
Body or operation make a distinction with another entity or operation, and not necessarily require or imply these entities or deposited between operating
In any this actual relation or order.Moreover, term " comprising ", "comprising" or its any other variant are intended to
Including for nonexcludability, so that article or equipment including a series of key elements not only include those key elements, but also is wrapped
Other key elements being not expressly set out are included, or are also included for this article or the intrinsic key element of equipment.Do not having more
In the case of many limitations, the key element limited by sentence "including a ...", it is not excluded that in the article including above-mentioned key element or
Also there is other identical element in person's equipment.
It should be noted that each embodiment in this specification is described by the way of progressive, each embodiment weight
Point explanation be all between difference with other embodiment, each embodiment identical similar part mutually referring to.
The foregoing description of the disclosed embodiments, enables professional and technical personnel in the field to realize or using the present invention.
A variety of modifications to these embodiments will be apparent for those skilled in the art, as defined herein
General Principle can be realized in other embodiments without departing from the spirit or scope of the present invention.Therefore, it is of the invention
The embodiments shown herein is not intended to be limited to, and is to fit to and principles disclosed herein and features of novelty phase one
The most wide scope caused.
Claims (10)
1. a kind of method of dynamic assigning memory, applied to host, it is characterised in that operation has multiple void in the host
Plan machine, methods described includes:
The internal memory for building multiple virtual machines uses monitoring table, and is synchronized to the domain configuration file of the virtual machine;
The memory usage of the host and multiple virtual machines is monitored in real time;
The most imperial palace of virtual machine according to the memory usage dynamically distributes of the host and multiple virtual machines
Deposit capacity;
When the memory usage of the virtual machine is higher than the first preset value, the memory usage of the host is judged, if institute
When the memory usage for stating host is less than the second preset value, the maximum memory capacity of the virtual machine is distributed in increase, and is remembered
The internal memory for recording the virtual machine uses monitoring table, and is synchronized to the domain configuration file;
When the memory usage of the virtual machine is less than three preset values, the maximum memory that the virtual machine is distributed in reduction holds
Measure, and recorded the internal memory of the virtual machine and use monitoring table, and be synchronized to the domain configuration file.
2. according to the method described in claim 1, it is characterised in that the internal memory for building multiple virtual machines uses monitoring
Table, and the domain configuration file of the virtual machine is synchronized to, including:
Inquire about the virtual machine that all running statuses on the host are operation;
The initial information for recording the virtual machine uses monitoring table to the internal memory, and the initial information includes:The virtual machine
Title, ID addresses, configuration when the maximum memory value that sets;
The internal memory is synchronized to the domain configuration file of the virtual machine using monitoring table.
3. according to the method described in claim 1, it is characterised in that described when the memory usage of the virtual machine is higher than first
During preset value, the memory usage of the host is judged, if the memory usage of the host is less than the second preset value,
Increase the maximum memory capacity for distributing to the virtual machine, and recorded the internal memory of the virtual machine and use monitoring table, and it is synchronous
To the domain configuration file, including:
When the memory usage of the virtual machine is higher than first preset value, in the domain configuration file for obtaining the virtual machine
The maximum memory amount MAX of storage, obtains needing to 1/ that the increased memory size of the virtual machine is the maximum memory amount MAX
2;
Calculate the host to add after internal memory to the virtual machine, judge the remaining memory usage of the host, if
The remaining memory usage of host is less than second preset value, calls dilatation function to adjust the maximum of the virtual machine
Memory value is 1.5MAX;
The internal memory that memory size after adjustment is updated into the virtual machine uses monitoring table, and is synchronized to the domain of the virtual machine
Configuration file.
4. according to the method described in claim 1, it is characterised in that described when the memory usage of the virtual machine is less than the 3rd
During preset value, the maximum memory capacity for distributing to the virtual machine is reduced, and recorded the internal memory of the virtual machine using monitoring
Table, and the domain configuration file is synchronized to, including:
When the memory usage of the virtual machine is less than three preset value, in the domain configuration file for obtaining the virtual machine
The maximum memory amount MAX of storage, then the memory size of reduction is the 1/2 of the maximum memory amount MAX;
The maximum memory value for calling capacity reducing function to adjust the virtual machine is 0.5MAX;
The internal memory that memory size after adjustment is updated into the virtual machine uses monitoring table, and is synchronized to the domain of the virtual machine
Configuration file.
5. the method according to claim 3 or 4, it is characterised in that the memory usage of the virtual machine is described virtual
The ratio of the current memory value of machine and the maximum memory value obtained from the domain configuration file of the virtual machine.
6. a kind of system of dynamic assigning memory, applied to host, it is characterised in that operation has multiple void in the host
Plan machine, the system includes:
Construction unit, the internal memory for building multiple virtual machines uses monitoring table, and is synchronized to the domain of the virtual machine and matches somebody with somebody
Put file;
Monitoring unit, the memory usage for monitoring the host and multiple virtual machines in real time;
Allocation unit, the virtual machine according to the memory usage dynamically distributes of the host and multiple virtual machines
Maximum memory capacity;
Dilatation unit, for when the memory usage of the virtual machine is higher than the first preset value, judging the interior of the host
Utilization rate is deposited, if the memory usage of the host is less than the second preset value, the maximum of the virtual machine is distributed in increase
Memory size, and recorded the internal memory of the virtual machine and use monitoring table, and it is synchronized to the domain configuration file;
Capacity reducing unit, for when the memory usage of the virtual machine is less than three preset values, reduction to be distributed to described virtual
The maximum memory capacity of machine, and recorded the internal memory of the virtual machine and use monitoring table, and it is synchronized to the domain configuration file.
7. system according to claim 6, it is characterised in that the construction unit includes:
Query unit, for inquiring about the virtual machine that all running statuses on the host are operation;
Recording unit, monitoring table, the initial information bag are used for recording the initial information of the virtual machine to the internal memory
Include:The maximum memory value set when the title of the virtual machine, ID addresses, configuration;
Synchronization unit, the domain configuration file for the internal memory to be synchronized to the virtual machine using monitoring table.
8. system according to claim 6, it is characterised in that the dilatation unit includes:
Increase-volume computing unit, for when the memory usage of the virtual machine is higher than first preset value, obtaining the void
The maximum memory amount MAX stored in the domain configuration file of plan machine, it is institute to obtain needing to the increased memory size of the virtual machine
State the 1/2 of maximum memory amount MAX;
Computing unit, adds after internal memory to the virtual machine for calculating the host, judges that the host is remaining
Memory usage, if the remaining memory usage of the host is less than second preset value, calls dilatation function to adjust institute
The maximum memory value for stating virtual machine is 1.5MAX;
First adjustment unit, the internal memory for the memory size after adjustment to be updated to the virtual machine uses monitoring table, and together
Walk to the domain configuration file of the virtual machine.
9. system according to claim 6, it is characterised in that the capacity reducing unit includes:
Capacity reducing computing unit, for when the memory usage of the virtual machine is less than three preset value, obtaining the void
The maximum memory amount MAX stored in the domain configuration file of plan machine, then the memory size of reduction is the 1/ of the maximum memory amount MAX
2;
Call unit, for calling the maximum memory value that capacity reducing function adjusts the virtual machine to be 0.5MAX;
Second adjustment unit, the internal memory for the memory size after adjustment to be updated to the virtual machine uses monitoring table, and together
Walk to the domain configuration file of the virtual machine.
10. system according to claim 8 or claim 9, it is characterised in that the memory usage of the virtual machine is described virtual
The ratio of the current memory value of machine and the maximum memory value obtained from the domain configuration file of the virtual machine.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710486098.XA CN107273212A (en) | 2017-06-23 | 2017-06-23 | A kind of method and system of dynamic assigning memory |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710486098.XA CN107273212A (en) | 2017-06-23 | 2017-06-23 | A kind of method and system of dynamic assigning memory |
Publications (1)
Publication Number | Publication Date |
---|---|
CN107273212A true CN107273212A (en) | 2017-10-20 |
Family
ID=60068198
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201710486098.XA Pending CN107273212A (en) | 2017-06-23 | 2017-06-23 | A kind of method and system of dynamic assigning memory |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN107273212A (en) |
Cited By (12)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108108227A (en) * | 2018-01-04 | 2018-06-01 | 郑州云海信息技术有限公司 | A kind of cloud computing management system and its method for managing virtual machine |
CN108196942A (en) * | 2018-02-01 | 2018-06-22 | 成都禾苗云科技有限公司 | A kind of quick start method of memory excessive distribution virtual machine |
CN108958891A (en) * | 2018-07-26 | 2018-12-07 | 郑州云海信息技术有限公司 | A kind of virutal machine memory distribution method, device and terminal |
CN109918265A (en) * | 2019-02-28 | 2019-06-21 | 沈阳天眼智云信息科技有限公司 | The monitoring method of embedded microprocessor running memory |
CN110784341A (en) * | 2019-10-14 | 2020-02-11 | 国云科技股份有限公司 | Method for tracking virtual machine by service link |
CN111752674A (en) * | 2020-05-20 | 2020-10-09 | 上海仪电(集团)有限公司中央研究院 | Technical architecture, memory allocation method, device and medium in Linux system environment |
CN112199121A (en) * | 2020-09-28 | 2021-01-08 | 西南电子技术研究所(中国电子科技集团公司第十研究所) | DSP capacity-expanding and program-loading method according to needs |
CN112395045A (en) * | 2020-11-13 | 2021-02-23 | 深圳力维智联技术有限公司 | Virtual machine recovery and resource adjustment method thereof |
WO2021057489A1 (en) * | 2019-09-29 | 2021-04-01 | 华为技术有限公司 | Method and device for virtual machine memory management |
CN112732449A (en) * | 2021-01-20 | 2021-04-30 | 湖南大学 | Video memory resource allocation method, device and equipment based on GPU virtualization technology |
CN112882791A (en) * | 2021-02-04 | 2021-06-01 | 深信服科技股份有限公司 | Method, device and storage medium for optimizing performance of virtual machine |
CN113434371A (en) * | 2021-08-26 | 2021-09-24 | 阿里云计算有限公司 | Acquisition method of memory access information, computing equipment and storage medium |
Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20100169536A1 (en) * | 2008-12-29 | 2010-07-01 | Microsoft Corporation | Dynamic virtual machine memory management |
CN102193814A (en) * | 2010-03-09 | 2011-09-21 | 上海拜翰网络科技有限公司 | Method and system for dynamically distributing embedded virtual memory |
CN103365700A (en) * | 2013-06-28 | 2013-10-23 | 福建师范大学 | Cloud computing virtualization environment-oriented resource monitoring and adjustment system |
CN103605613A (en) * | 2013-11-21 | 2014-02-26 | 中标软件有限公司 | Method and system for dynamically adjusting virtual-machine memory in cloud computing environment |
CN105094980A (en) * | 2014-05-23 | 2015-11-25 | 北京云巢动脉科技有限公司 | System for dynamically adjusting memories of virtual machines |
CN105677485A (en) * | 2016-01-08 | 2016-06-15 | 中电科华云信息技术有限公司 | Memory dynamic adjusting method for cloud desktop host and virtual machine |
CN106776048A (en) * | 2017-01-24 | 2017-05-31 | 郑州云海信息技术有限公司 | A kind of real time virtual machine scheduling memory method and device |
-
2017
- 2017-06-23 CN CN201710486098.XA patent/CN107273212A/en active Pending
Patent Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20100169536A1 (en) * | 2008-12-29 | 2010-07-01 | Microsoft Corporation | Dynamic virtual machine memory management |
CN102193814A (en) * | 2010-03-09 | 2011-09-21 | 上海拜翰网络科技有限公司 | Method and system for dynamically distributing embedded virtual memory |
CN103365700A (en) * | 2013-06-28 | 2013-10-23 | 福建师范大学 | Cloud computing virtualization environment-oriented resource monitoring and adjustment system |
CN103605613A (en) * | 2013-11-21 | 2014-02-26 | 中标软件有限公司 | Method and system for dynamically adjusting virtual-machine memory in cloud computing environment |
CN105094980A (en) * | 2014-05-23 | 2015-11-25 | 北京云巢动脉科技有限公司 | System for dynamically adjusting memories of virtual machines |
CN105677485A (en) * | 2016-01-08 | 2016-06-15 | 中电科华云信息技术有限公司 | Memory dynamic adjusting method for cloud desktop host and virtual machine |
CN106776048A (en) * | 2017-01-24 | 2017-05-31 | 郑州云海信息技术有限公司 | A kind of real time virtual machine scheduling memory method and device |
Cited By (18)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108108227A (en) * | 2018-01-04 | 2018-06-01 | 郑州云海信息技术有限公司 | A kind of cloud computing management system and its method for managing virtual machine |
CN108196942A (en) * | 2018-02-01 | 2018-06-22 | 成都禾苗云科技有限公司 | A kind of quick start method of memory excessive distribution virtual machine |
CN108196942B (en) * | 2018-02-01 | 2021-09-03 | 成都禾苗云科技有限公司 | Quick starting method of memory over-allocation virtual machine |
CN108958891A (en) * | 2018-07-26 | 2018-12-07 | 郑州云海信息技术有限公司 | A kind of virutal machine memory distribution method, device and terminal |
CN108958891B (en) * | 2018-07-26 | 2022-02-18 | 郑州云海信息技术有限公司 | Virtual machine memory allocation method, device and terminal |
CN109918265A (en) * | 2019-02-28 | 2019-06-21 | 沈阳天眼智云信息科技有限公司 | The monitoring method of embedded microprocessor running memory |
WO2021057489A1 (en) * | 2019-09-29 | 2021-04-01 | 华为技术有限公司 | Method and device for virtual machine memory management |
CN110784341A (en) * | 2019-10-14 | 2020-02-11 | 国云科技股份有限公司 | Method for tracking virtual machine by service link |
CN111752674A (en) * | 2020-05-20 | 2020-10-09 | 上海仪电(集团)有限公司中央研究院 | Technical architecture, memory allocation method, device and medium in Linux system environment |
CN111752674B (en) * | 2020-05-20 | 2023-08-01 | 上海仪电(集团)有限公司中央研究院 | Technical architecture, memory allocation method, equipment and medium in Linux system environment |
CN112199121A (en) * | 2020-09-28 | 2021-01-08 | 西南电子技术研究所(中国电子科技集团公司第十研究所) | DSP capacity-expanding and program-loading method according to needs |
CN112199121B (en) * | 2020-09-28 | 2023-06-06 | 西南电子技术研究所(中国电子科技集团公司第十研究所) | DSP capacity-expanding loading program method according to need |
CN112395045A (en) * | 2020-11-13 | 2021-02-23 | 深圳力维智联技术有限公司 | Virtual machine recovery and resource adjustment method thereof |
CN112732449A (en) * | 2021-01-20 | 2021-04-30 | 湖南大学 | Video memory resource allocation method, device and equipment based on GPU virtualization technology |
CN112732449B (en) * | 2021-01-20 | 2024-04-09 | 湖南大学 | Video memory resource allocation method, device and equipment based on GPU virtualization technology |
CN112882791A (en) * | 2021-02-04 | 2021-06-01 | 深信服科技股份有限公司 | Method, device and storage medium for optimizing performance of virtual machine |
CN112882791B (en) * | 2021-02-04 | 2024-04-09 | 深信服科技股份有限公司 | Method, equipment and storage medium for optimizing performance of virtual machine |
CN113434371A (en) * | 2021-08-26 | 2021-09-24 | 阿里云计算有限公司 | Acquisition method of memory access information, computing equipment and storage medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN107273212A (en) | A kind of method and system of dynamic assigning memory | |
CN104407926B (en) | A kind of dispatching method of cloud computing resources | |
CN103605613B (en) | Cloud computing environment dynamically adjusts the method and system of virutal machine memory | |
CN102938790B (en) | Resource allocation methods in cloud computing system | |
CN102567106B (en) | Task scheduling method, system and device | |
CN103179048B (en) | Main frame qos policy transform method and the system of cloud data center | |
CN113725864B (en) | A method and system for orderly charging of charging piles by intelligent fusion terminal control in a substation | |
CN104679594B (en) | A kind of middleware distributed computing method | |
CN102711139B (en) | A kind of data flow statistic method and terminal | |
CN105007337A (en) | Cluster system load balancing method and system thereof | |
CN103548324B (en) | Virtual machine distribution method and virtual machine distributor | |
CN102917025A (en) | Method for business migration based on cloud computing platform | |
CN102426544A (en) | Task allocation method and system | |
CN107483981B (en) | Resource Calculation monitoring distribution method, storage medium, electronic equipment and system is broadcast live | |
CN102521662A (en) | Consumption charging method in cloud computing environment | |
CN108243239A (en) | A kind of method, apparatus, electronic equipment and system that web application service is provided | |
CN108519919A (en) | A method of realizing server resource dynamic dispatching under virtual cluster environment | |
CN101187884A (en) | Resource management method and management system | |
WO2003060657A3 (en) | Methods and systems for managing business representative distributions | |
CN105224289A (en) | A kind of action message matching process and equipment | |
CN102685219B (en) | The method improving utilization ratio of storage resources by dynamic capacity-expanding in SAN storage system | |
CN113342827A (en) | Power grid data storage method, storage medium and system based on multi-tenant technology | |
CN103336670B (en) | A kind of method and apparatus data block being distributed automatically based on data temperature | |
CN102067644B (en) | Global operator permits prioritization and distribution | |
CN109960569A (en) | A kind of virtualization processing method and device |
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 | ||
RJ01 | Rejection of invention patent application after publication | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20171020 |