CN111124660A - Method and device for allocating idle resources in virtual machine - Google Patents
Method and device for allocating idle resources in virtual machine Download PDFInfo
- Publication number
- CN111124660A CN111124660A CN201811296680.0A CN201811296680A CN111124660A CN 111124660 A CN111124660 A CN 111124660A CN 201811296680 A CN201811296680 A CN 201811296680A CN 111124660 A CN111124660 A CN 111124660A
- Authority
- CN
- China
- Prior art keywords
- development environment
- environment container
- virtual machine
- resources
- container
- 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.)
- Granted
Links
- 238000000034 method Methods 0.000 title claims abstract description 51
- 238000011161 development Methods 0.000 claims abstract description 196
- 238000004590 computer program Methods 0.000 claims description 10
- 238000001514 detection method Methods 0.000 claims description 5
- 238000005516 engineering process Methods 0.000 description 11
- 238000010801 machine learning Methods 0.000 description 8
- 238000012545 processing Methods 0.000 description 7
- 238000010586 diagram Methods 0.000 description 5
- 230000000694 effects Effects 0.000 description 5
- 230000006870 function Effects 0.000 description 5
- 238000012544 monitoring process Methods 0.000 description 5
- 230000008569 process Effects 0.000 description 3
- 238000012549 training Methods 0.000 description 3
- 230000005540 biological transmission Effects 0.000 description 2
- 238000007418 data mining Methods 0.000 description 2
- 239000000463 material Substances 0.000 description 2
- 230000003287 optical effect Effects 0.000 description 2
- 230000002618 waking effect Effects 0.000 description 2
- 230000004075 alteration Effects 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 230000008602 contraction Effects 0.000 description 1
- 230000003247 decreasing effect Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 239000013307 optical fiber Substances 0.000 description 1
- 238000005192 partition Methods 0.000 description 1
- 238000011084 recovery Methods 0.000 description 1
- 230000009467 reduction Effects 0.000 description 1
- 238000006467 substitution reaction Methods 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/5022—Mechanisms to release resources
-
- 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/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
- 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)
- Debugging And Monitoring (AREA)
- Stored Programmes (AREA)
Abstract
The application provides a method and a device for allocating idle resources in a virtual machine, wherein at least one development environment container runs on the virtual machine, and the method comprises the following steps: detecting the use state of the development environment container; judging whether the development environment container is in an idle state or not according to the use state of the development environment container; and if the development environment container is judged to be in an idle state, releasing the resources corresponding to the development environment container to the virtual machine to which the development environment container belongs. Therefore, when the development environment container is in an idle state, resources corresponding to the development environment container are released to the virtual machine to which the development environment container belongs, and the problem of idle memory occupation is reduced.
Description
Technical Field
The present application relates to the field of computer technologies, and in particular, to a method and an apparatus for allocating idle resources in a virtual machine.
Background
At present, more and more machine learning platforms provide a one-stop development environment for data processing, modeling development and model training for users. How to allocate resources for data processing, model training operation and the like and efficiently manage the resources is an important technical problem. For example, although a user uses a development environment to develop, the development environment is a long-standing operation but not a permanent operation, and the user rest at night, holiday rest and the like belong to invalid occupation time. Therefore, the development environment can exist when the user uses the development environment, and the resources can be released when the user does not use the development environment.
In the related art, a resource monitoring module is arranged in a machine learning platform and used for monitoring the use condition of each development environment container and finding out that the resource release is realized without using a service process which finishes the development environment container.
Disclosure of Invention
The present application is directed to solving, at least to some extent, one of the technical problems in the related art.
To this end, a first objective of the present application is to provide a method for allocating idle resources in a virtual machine, on which at least one development environment container runs, including the following steps:
detecting a use state of the development environment container;
judging whether the development environment container is in an idle state or not according to the use state of the development environment container; and
and if the development environment container is in an idle state, releasing the resources corresponding to the development environment container to the virtual machine to which the development environment container belongs.
In order to achieve the above object, a second aspect of the present application provides an apparatus for allocating idle resources in a virtual machine, on which at least one development environment container runs, including:
the detection module is used for detecting the use state of the development environment container;
the judging module is used for judging whether the development environment container is in an idle state according to the use state of the development environment container; and
and the release module is used for releasing the resources corresponding to the development environment container to the virtual machine to which the development environment container belongs when the development environment container is judged to be in an idle state.
To achieve the above object, a third aspect of the present application provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, where the processor executes the computer program to perform the method for allocating idle resources in a virtual machine as described in the above embodiments.
To achieve the above object, a fourth aspect of the present application provides a computer program product, which when executed by an instruction processor in the computer program product, performs the method for allocating idle resources in a virtual machine as described in the foregoing embodiment.
In order to achieve the above object, a fifth aspect of the present application provides a non-transitory computer readable storage medium, where the program is executed by a processor to implement the method for allocating idle resources in a virtual machine as described in the above embodiments.
The technical scheme provided by the application at least has the following beneficial technical effects:
detecting the use state of the development environment container, judging whether the development environment container is in an idle state according to the use state of the development environment container, and releasing resources corresponding to the development environment container to a virtual machine to which the development environment container belongs if the development environment container is judged to be in the idle state. Therefore, when the development environment container is in an idle state, resources corresponding to the development environment container are released to the virtual machine to which the development environment container belongs, and the problem of idle memory occupation is reduced.
Additional aspects and advantages of the present application will be set forth in part in the description which follows and, in part, will be obvious from the description, or may be learned by practice of the present application.
Drawings
The foregoing and/or additional aspects and advantages of the present application will become apparent and readily appreciated from the following description of the embodiments, taken in conjunction with the accompanying drawings of which:
FIG. 1 is a flow chart of a method for allocating idle resources in a virtual machine according to one embodiment of the present application;
FIG. 2 is a flowchart of a method for allocating idle resources in a virtual machine according to another embodiment of the present application;
FIG. 3 is a flow chart of a method for allocating idle resources in a virtual machine according to another embodiment of the present application;
FIG. 4 is an exemplary diagram of a method for allocating idle resources in a virtual machine according to one embodiment of the present application;
FIG. 5 is a block diagram of an apparatus for allocating idle resources in a virtual machine according to an embodiment of the present application;
FIG. 6 is a schematic structural diagram of an apparatus for allocating idle resources in a virtual machine according to another embodiment of the present application; and
fig. 7 is a schematic structural diagram of an apparatus for allocating idle resources in a virtual machine according to another embodiment of the present application.
Detailed Description
Reference will now be made in detail to embodiments of the present application, examples of which are illustrated in the accompanying drawings, wherein like or similar reference numerals refer to the same or similar elements or elements having the same or similar function throughout. The embodiments described below with reference to the drawings are exemplary and intended to be used for explaining the present application and should not be construed as limiting the present application.
In the embodiment of the application, when a development environment container is in an idle state, resources corresponding to the development environment container are released into a virtual machine to which the development environment container belongs, and the problem of idle memory occupation is reduced.
The following describes a method and an apparatus for allocating idle resources in a virtual machine according to an embodiment of the present application with reference to the drawings.
Fig. 1 is a flowchart of a method for allocating idle resources in a mobile control virtual machine of a shooting point during switching of a panoramic page, according to an embodiment of the present application, as shown in fig. 1, the method includes the following steps:
Specifically, the machine learning platform can provide a one-stop development environment for data processing, modeling development and model training for users. In the embodiment of the present application, a plurality of KVM virtual machines (Kernel-based virtual machines, an open-source system virtualization module) may be created on a physical Machine, and one or more development environment containers may be deployed on the KVM virtual machines as Machine learning development environments.
It can be understood that, when the method for allocating idle resources in a virtual machine according to the embodiment of the present application is executed, at least one development environment container is run on the virtual machine.
The use state of the development environment container can be detected in many ways, for example, as follows:
in a first example, an occupancy rate of a Central Processing Unit (CPU) of the development environment container is obtained, and the CPU occupancy rate is compared with a preset first threshold value, thereby determining a usage state of the development environment container according to a comparison result for a period of time.
In a second example, the preset monitoring policy module monitors the activity state of the development environment container and determines the use state of the development environment container according to the monitoring result.
It is to be understood that the usage state of the development environment container in the embodiment of the present application may be an idle state, an occupied state, or the like.
And 102, judging whether the development environment container is in an idle state according to the use state of the development environment container.
And 103, if the development environment container is judged to be in an idle state, releasing the resources corresponding to the development environment container to the virtual machine to which the development environment container belongs.
Specifically, when the development environment container is determined to be in an idle state, the resources corresponding to the development environment container may be released to the virtual machine to which the development environment container belongs.
That is to say, the user does not operate the page, the resource corresponding to the development environment container belongs to the invalid occupation time, and at this time, the resource can be released to the virtual machine to which the development environment container belongs. As a possible implementation manner, the resources in the development environment container are released into the virtual machine to which the development environment container belongs using a Docker swap technology.
The Docker swap technology is a technology of Docker based on a Linux kernel Cgroup. A swap partition can be configured on a disk in a host system to store inactive anonymous pages. Therefore, the Cgroup is used as a Driver for managing the Docker resources, the swap space of the host machine available to the Docker container can be dynamically adjusted by modifying parameters in the Cgroup development environment container, and the resources available to the host machine can be dynamically adjusted by modifying corresponding parameters. When the swap parameter is increased and the resource parameter is decreased, the effect of releasing the resource in the development environment container can be achieved.
To sum up, the method for allocating idle resources in a virtual machine according to the embodiment of the present application detects the use state of the development environment container, determines whether the development environment container is in an idle state according to the use state of the development environment container, and releases resources corresponding to the development environment container to the virtual machine to which the development environment container belongs if the development environment container is determined to be in the idle state. Therefore, when the development environment container is in an idle state, resources corresponding to the development environment container are released to the virtual machine to which the development environment container belongs, and the problem of idle memory occupation is reduced.
Fig. 2 is a flowchart of a method for allocating idle resources in a virtual machine according to another embodiment of the present application, as shown in fig. 2, the method includes the following steps:
In step 203, the virtual machine allocates resources to other development environment containers.
And step 204, releasing the resources of the virtual machine to the physical machine to which the virtual machine belongs.
It can be understood that, in the related art, the released resources can only be used to establish a new container development environment for other users to develop, so that the released resources are difficult to be flexibly applied. The method for allocating the idle resources in the virtual machine can improve the flexibility of allocation of the idle resources in the virtual machine and further improve the flexible application of the released resources.
Specifically, when the CPU occupancy rate of the development environment container, such as 0.1, is lower than the first threshold value 0.2 and the duration of the CPU occupancy rate of the development environment container of 0.1 is greater than the second threshold value for ten minutes, it is determined that the development environment container is in the idle state. The first threshold and the second threshold can be set according to actual application requirements.
It will be appreciated that the CPU occupancy of the development environment container below the first threshold but for a short duration may be due to some emergency, temporary non-use, and not the development environment container actually being idle.
Further, the memory available to the virtual machine will increase, step 203 may be executed to allocate the memory to other development environment containers of the same KVM virtual machine to use the resources of the development environment containers, and step 204 may be executed to release the resources of the virtual machine to the physical machine to which the virtual machine belongs, so as to be used by other services of the physical machine, thereby implementing flexible application of the released resources.
It should be noted that, the situation of the resources may also be specifically analyzed, and step 203 and step 204 are executed at the same time by reasonable allocation, that is, a part of the resources are allocated to other development environment containers of the same KVM virtual machine for use, and another part of the resources are released to the physical machine to which the virtual machine belongs, so as to be used by other services of the physical machine.
As one possible implementation, the KVM Balloon technology is used to release virtual machine idle resources to the physical machine for use by other services of the physical machine, such as other virtual machines or other programs.
Specifically, the released free resources are equivalent to free resources immediately available to the physical machine, and may be allocated to other virtual machines through the Balloon Driver, or run any task that occupies memory resources. As one scenario example, in a machine learning scenario, this portion of the spare resources is used for batch computation tasks scheduled at night-run timing.
The KVM Balloon technology is a technology based on a Linux kernel Virtio-Balloon drive, and the basic principle is as follows: the virtual machine can mark own free resource storage through the Balloon driver, and the host machine distributes and dispatches the marked free resource, which is the memory contraction operation of the virtual machine.
Therefore, when the CPU occupancy rate of the development environment container is lower than a first threshold value and the duration is larger than a second threshold value, the development environment container is judged to be in an idle state, resources corresponding to the development environment container are released into a virtual machine to which the development environment container belongs, the virtual machine distributes the resources to other development environment containers, or the resources of the virtual machine are released into a physical machine to which the virtual machine belongs, the flexibility of distribution of the idle resources in the virtual machine is improved, and the flexible application of the released resources is further improved.
Fig. 3 is a flowchart of a method for allocating idle resources in a virtual machine according to another embodiment of the present application, and as shown in fig. 3, after step 103, the method includes the following steps:
and step 301, continuously detecting the use state of the development environment container.
It is to be understood that the use state of the development environment container continues to be detected after the use state of the development environment container is determined to be an idle state. For example, when the CPU occupancy of the development environment container is lower than a first threshold and the duration is greater than a second threshold, the CPU occupancy of the development environment container is continuously detected after the development environment container is determined to be in an idle state, and when the CPU occupancy of the development environment container is greater than a third threshold, the development environment container is determined to be in an awake state.
The first threshold, the second threshold and the third threshold can be selected according to actual application requirements, and the first threshold is smaller than the third threshold.
For another example, after determining that the use state of the development environment container is the idle state, it is detected that the development environment container receives a user instruction, for example, a user performs a page operation, and it is determined that the development environment container is in the wake-up state.
Further, when judging whether the development environment container is in the wake-up state, the resources released by the development environment container are reloaded to the development environment container. As a possible implementation manner, the resources of the physical machine may be loaded to the KVM virtual machine through the KVM Balloon technology, and at the same time, the resources are loaded back to the development environment container, so as to obtain the effect of waking up the development environment container.
Specifically, the virtual machine may also reapply the memory to the host through the Balloon driver, which is a recovery operation of the memory of the virtual machine, and the Balloon driver may not affect the current running state of the virtual machine when swapping in and swapping out the resource.
Therefore, the released resources can be loaded back, and the flexible application of the released resources is further improved.
In order to make clear to those skilled in the art the method for allocating idle resources in a virtual machine according to the embodiment of the present application, the following is described in detail with reference to fig. 4.
Specifically, as shown in fig. 4, a plurality of KVM virtual machines are created on a physical machine, a plurality of dockers (development environment containers) are deployed on the KVM virtual machines as a machine learning development environment, and a deployment monitoring system monitors the usage state of the machine learning development environment, and if the CPU occupancy of the development environment container is continuously lower than a certain threshold, it is determined that the current development environment container is that development environment resources are idle, and resources in the development environment container are released to the virtual machine to which the development environment container belongs by using a Docker swap technique, at this time, the available memory of the virtual machine will increase, and the memory can be allocated to other development environment containers of the same KVM. Furthermore, the KVM Balloon technology may be used to swap out the virtual machine idle resources to the physical machine for use by other services of the physical machine.
If it is detected that the user starts to use the development environment, for example, the user operates a page of the development environment, or the CPU utilization rate of the development environment container is increased, at this time, the resources of the physical machine may be loaded to the KVM virtual machine through Balloon, and the resources are loaded back to the development environment container, so as to obtain the effect of waking up the development environment container.
Therefore, by combining the Docker swap technology and the KVM Balloon technology of the development environment container, the problem of occupation of idle resources in machine learning data mining is reduced, the idle resources are replaced on the disk of the virtual machine, then the development environment container is subjected to intelligent capacity reduction, and the resources are returned to the KVM virtual machine for other active data mining environments or the resources are returned to the physical machine for other services of the physical machine.
In order to implement the foregoing embodiment, the present application further provides an apparatus for allocating idle resources in a virtual machine.
Fig. 5 is a schematic structural diagram of an apparatus for allocating idle resources in a virtual machine according to an embodiment of the present application, as shown in fig. 5, the apparatus includes a detection module 100, a determination module 200, and a release module 300, wherein at least one development environment container runs on the virtual machine,
the detection module 100 is configured to detect a use state of the development environment container.
The determining module 200 is configured to determine whether the development environment container is in an idle state according to the usage state of the development environment container. And
the releasing module 300 is configured to release the resource corresponding to the development environment container to the virtual machine to which the development environment container belongs when the development environment container is determined to be in an idle state.
In an embodiment of the present application, as shown in fig. 6, on the basis of fig. 5, the method further includes: a first transmission module 400 and a second transmission module 500, wherein,
a first sending module 400 for the virtual machine to allocate resources to other development environment containers.
A second sending module 500, configured to release the resource of the virtual machine to the physical machine to which the virtual machine belongs.
In one embodiment of the present application, as shown in fig. 7, on the basis of fig. 5, the apparatus further comprises: a processing module 600.
The detection module 100 is further configured to continue to detect a use state of the development environment container.
The judging module 200 is further configured to judge whether the development environment container is in an awake state according to the usage state of the development environment container.
And a processing module 600, configured to reload, to the development environment container, the resource released by the development environment container if it is determined that the development environment container is in the wake state.
In one embodiment of the present application, when the CPU occupancy of the development environment container is lower than a first threshold and the duration is greater than a second threshold, it is determined that the development environment container is in an idle state.
In an embodiment of the present application, when it is detected that the development environment container receives a user instruction, or the CPU occupancy of the development environment container is greater than a third threshold, it is determined that the development environment container is in an awake state.
It should be noted that the foregoing explanation of the embodiment of the method for allocating idle resources in a virtual machine is also applicable to the apparatus for allocating idle resources in a virtual machine in the embodiment, and is not repeated herein.
To sum up, the apparatus for allocating idle resources in a virtual machine according to the embodiment of the present application detects a use state of a development environment container, determines whether the development environment container is in an idle state according to the use state of the development environment container, and releases resources corresponding to the development environment container to the virtual machine to which the development environment container belongs if the development environment container is determined to be in the idle state. Therefore, when the development environment container is in an idle state, resources corresponding to the development environment container are released into the virtual machine to which the development environment container belongs, the problem of idle memory occupation is reduced, and the flexibility of application of the released resources is improved.
In order to implement the foregoing embodiments, the present application further provides a computer device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, where the processor executes a program corresponding to an executable program code by reading the executable program code stored in the memory, so as to implement the allocation method of idle resources in a virtual machine described in the foregoing embodiments.
In order to implement the foregoing embodiments, the present application further provides a computer program product, including: and a processor, wherein the processor executes a program corresponding to the executable program code by reading the executable program code stored in the memory, so as to implement the allocation method of the idle resources in the virtual machine described in the above embodiment.
In order to implement the foregoing embodiments, the present application also proposes a non-transitory computer-readable storage medium, where instructions of the storage medium, when executed by a processor, enable execution of the method for allocating idle resources in a virtual machine shown in the foregoing embodiments.
In the description herein, reference to the description of the term "one embodiment," "some embodiments," "an example," "a specific example," or "some examples," etc., means that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the application. In this specification, the schematic representations of the terms used above are not necessarily intended to refer to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples. Furthermore, various embodiments or examples and features of different embodiments or examples described in this specification can be combined and combined by one skilled in the art without contradiction.
Furthermore, the terms "first", "second" and "first" are used for descriptive purposes only and are not to be construed as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one such feature. In the description of the present application, "plurality" means at least two, e.g., two, three, etc., unless specifically limited otherwise.
Any process or method descriptions in flow charts or otherwise described herein may be understood as representing modules, segments, or portions of code which include one or more executable instructions for implementing steps of a custom logic function or process, and alternate implementations are included within the scope of the preferred embodiment of the present application in which functions may be executed out of order from that shown or discussed, including substantially concurrently or in reverse order, depending on the functionality involved, as would be understood by those reasonably skilled in the art of the present application.
The logic and/or steps represented in the flowcharts or otherwise described herein, e.g., an ordered listing of executable instructions that can be considered to implement logical functions, can be embodied in any computer-readable medium for use by or in connection with an instruction execution system, apparatus, or device, such as a computer-based system, processor-containing system, or other system that can fetch the instructions from the instruction execution system, apparatus, or device and execute the instructions. For the purposes of this description, a "computer-readable medium" can be any means that can contain, store, communicate, propagate, or transport the program for use by or in connection with the instruction execution system, apparatus, or device. More specific examples (a non-exhaustive list) of the computer-readable medium would include the following: an electrical connection (electronic device) having one or more wires, a portable computer diskette (magnetic device), a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber device, and a portable compact disc read-only memory (CDROM). Additionally, the computer-readable medium could even be paper or another suitable medium upon which the program is printed, as the program can be electronically captured, via for instance optical scanning of the paper or other medium, then compiled, interpreted or otherwise processed in a suitable manner if necessary, and then stored in a computer memory.
It should be understood that portions of the present application may be implemented in hardware, software, firmware, or a combination thereof. In the above embodiments, the various steps or methods may be implemented in software or firmware stored in memory and executed by a suitable instruction execution system. If implemented in hardware, as in another embodiment, any one or combination of the following techniques, which are known in the art, may be used: a discrete logic circuit having a logic gate circuit for implementing a logic function on a data signal, an application specific integrated circuit having an appropriate combinational logic gate circuit, a Programmable Gate Array (PGA), a Field Programmable Gate Array (FPGA), or the like.
It will be understood by those skilled in the art that all or part of the steps carried by the method for implementing the above embodiments may be implemented by hardware related to instructions of a program, which may be stored in a computer readable storage medium, and when the program is executed, the program includes one or a combination of the steps of the method embodiments.
In addition, functional units in the embodiments of the present application may be integrated into one processing module, or each unit may exist alone physically, or two or more units are integrated into one module. The integrated module can be realized in a hardware mode, and can also be realized in a software functional module mode. The integrated module, if implemented in the form of a software functional module and sold or used as a stand-alone product, may also be stored in a computer readable storage medium.
The storage medium mentioned above may be a read-only memory, a magnetic or optical disk, etc. Although embodiments of the present application have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting the present application, and that variations, modifications, substitutions and alterations may be made to the above embodiments by those of ordinary skill in the art within the scope of the present application.
Claims (10)
1. A method for allocating idle resources in a virtual machine, wherein at least one development environment container is run on top of the virtual machine, the method comprising:
detecting a use state of the development environment container;
judging whether the development environment container is in an idle state or not according to the use state of the development environment container; and
and if the development environment container is in an idle state, releasing the resources corresponding to the development environment container to the virtual machine to which the development environment container belongs.
2. The method according to claim 1, wherein after the releasing the resource corresponding to the development environment container into the virtual machine to which the development environment container belongs, the method further comprises:
the virtual machine allocates the resources to other development environment containers.
3. The method according to claim 1, wherein after the releasing the resource corresponding to the development environment container into the virtual machine to which the development environment container belongs, the method further comprises:
and releasing the resources of the virtual machine to the physical machine to which the virtual machine belongs.
4. The method according to claim 1, wherein after the releasing the resource corresponding to the development environment container into the virtual machine to which the development environment container belongs, the method further comprises:
continuing to detect the use state of the development environment container;
judging whether the development environment container is in an awakening state or not according to the use state of the development environment container;
and if the development environment container is judged to be in the awakening state, reloading the resources released by the development environment container to the development environment container.
5. The method according to claim 1, wherein the step of allocating the idle resources in the virtual machine,
and when the CPU occupancy rate of the development environment container is lower than a first threshold value and the duration time is greater than a second threshold value, judging that the development environment container is in an idle state.
6. The method according to claim 1, wherein the step of allocating the idle resources in the virtual machine,
and when the development environment container is detected to receive a user instruction or the CPU occupancy rate of the development environment container is greater than a third threshold value, judging that the development environment container is in an awakening state.
7. An apparatus for allocating free resources in a virtual machine, wherein at least one development environment container runs on top of the virtual machine, the apparatus comprising:
the detection module is used for detecting the use state of the development environment container;
the judging module is used for judging whether the development environment container is in an idle state according to the use state of the development environment container; and
and the release module is used for releasing the resources corresponding to the development environment container to the virtual machine to which the development environment container belongs when the development environment container is judged to be in an idle state.
8. Computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing a method for allocating free resources in a virtual machine according to any of claims 1 to 6 when executing the program.
9. A non-transitory computer readable storage medium, on which a computer program is stored, wherein the program, when executed by a processor, implements the method for allocating idle resources in a virtual machine according to any one of claims 1 to 6.
10. A computer program product, characterized in that instructions in the computer program product, when executed by a processor, perform a method for allocation of idle resources in a virtual machine according to any of claims 1-6.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811296680.0A CN111124660B (en) | 2018-11-01 | 2018-11-01 | Method and device for allocating idle resources in virtual machine |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811296680.0A CN111124660B (en) | 2018-11-01 | 2018-11-01 | Method and device for allocating idle resources in virtual machine |
Publications (2)
Publication Number | Publication Date |
---|---|
CN111124660A true CN111124660A (en) | 2020-05-08 |
CN111124660B CN111124660B (en) | 2024-01-05 |
Family
ID=70494895
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201811296680.0A Active CN111124660B (en) | 2018-11-01 | 2018-11-01 | Method and device for allocating idle resources in virtual machine |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN111124660B (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113434250A (en) * | 2021-06-24 | 2021-09-24 | 青岛海尔科技有限公司 | Cluster resource management method and device, storage medium and computer equipment |
Citations (14)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105354076A (en) * | 2015-10-23 | 2016-02-24 | 深圳前海达闼云端智能科技有限公司 | Application deployment method and device |
US20160164762A1 (en) * | 2014-12-05 | 2016-06-09 | Amazon Technologies, Inc. | Automatic management of resource sizing |
US20160380909A1 (en) * | 2015-06-26 | 2016-12-29 | Nicira, Inc. | Providing quality of service for containers in a virtualized computing environment |
CN106293945A (en) * | 2016-08-11 | 2017-01-04 | 浪潮(北京)电子信息产业有限公司 | A kind of resource perception method and system across virtual machine |
JP2017037403A (en) * | 2015-08-07 | 2017-02-16 | 株式会社日立製作所 | Computer system and container management method |
CN106874063A (en) * | 2016-08-26 | 2017-06-20 | 阿里巴巴集团控股有限公司 | A kind of its recovery method as resource and device |
CN107220102A (en) * | 2017-04-19 | 2017-09-29 | 深圳中兴网信科技有限公司 | The dormancy of virtual machine and awakening method and system |
CN107832143A (en) * | 2017-10-17 | 2018-03-23 | 北京京东尚科信息技术有限公司 | A kind for the treatment of method and apparatus of physical machine resource |
CN107908461A (en) * | 2017-12-01 | 2018-04-13 | 广东电网有限责任公司佛山供电局 | A kind of resource dynamic retractility device and implementation method based on Docker |
KR20180045347A (en) * | 2016-10-25 | 2018-05-04 | 에스케이텔레콤 주식회사 | Method for resource management of virtual environment |
CN108279967A (en) * | 2017-10-25 | 2018-07-13 | 国云科技股份有限公司 | A kind of virtual machine and container mixed scheduling method |
CN108334396A (en) * | 2017-01-19 | 2018-07-27 | 阿里巴巴集团控股有限公司 | The creation method and device of a kind of data processing method and device, resource group |
US20180285164A1 (en) * | 2017-03-28 | 2018-10-04 | International Business Machines Corporation | Managing system resources in containers and virtual machines in a coexisting environment |
EP3396543A1 (en) * | 2017-04-26 | 2018-10-31 | Nokia Solutions and Networks Oy | Method to allocate/deallocate resources on a platform, platform and computer readable medium |
-
2018
- 2018-11-01 CN CN201811296680.0A patent/CN111124660B/en active Active
Patent Citations (14)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20160164762A1 (en) * | 2014-12-05 | 2016-06-09 | Amazon Technologies, Inc. | Automatic management of resource sizing |
US20160380909A1 (en) * | 2015-06-26 | 2016-12-29 | Nicira, Inc. | Providing quality of service for containers in a virtualized computing environment |
JP2017037403A (en) * | 2015-08-07 | 2017-02-16 | 株式会社日立製作所 | Computer system and container management method |
CN105354076A (en) * | 2015-10-23 | 2016-02-24 | 深圳前海达闼云端智能科技有限公司 | Application deployment method and device |
CN106293945A (en) * | 2016-08-11 | 2017-01-04 | 浪潮(北京)电子信息产业有限公司 | A kind of resource perception method and system across virtual machine |
CN106874063A (en) * | 2016-08-26 | 2017-06-20 | 阿里巴巴集团控股有限公司 | A kind of its recovery method as resource and device |
KR20180045347A (en) * | 2016-10-25 | 2018-05-04 | 에스케이텔레콤 주식회사 | Method for resource management of virtual environment |
CN108334396A (en) * | 2017-01-19 | 2018-07-27 | 阿里巴巴集团控股有限公司 | The creation method and device of a kind of data processing method and device, resource group |
US20180285164A1 (en) * | 2017-03-28 | 2018-10-04 | International Business Machines Corporation | Managing system resources in containers and virtual machines in a coexisting environment |
CN107220102A (en) * | 2017-04-19 | 2017-09-29 | 深圳中兴网信科技有限公司 | The dormancy of virtual machine and awakening method and system |
EP3396543A1 (en) * | 2017-04-26 | 2018-10-31 | Nokia Solutions and Networks Oy | Method to allocate/deallocate resources on a platform, platform and computer readable medium |
CN107832143A (en) * | 2017-10-17 | 2018-03-23 | 北京京东尚科信息技术有限公司 | A kind for the treatment of method and apparatus of physical machine resource |
CN108279967A (en) * | 2017-10-25 | 2018-07-13 | 国云科技股份有限公司 | A kind of virtual machine and container mixed scheduling method |
CN107908461A (en) * | 2017-12-01 | 2018-04-13 | 广东电网有限责任公司佛山供电局 | A kind of resource dynamic retractility device and implementation method based on Docker |
Non-Patent Citations (1)
Title |
---|
邵海军: "基于容器技术的云计算资源合理调度方法研究", 现代电子技术, vol. 40, no. 22, pages 33 - 35 * |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113434250A (en) * | 2021-06-24 | 2021-09-24 | 青岛海尔科技有限公司 | Cluster resource management method and device, storage medium and computer equipment |
Also Published As
Publication number | Publication date |
---|---|
CN111124660B (en) | 2024-01-05 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP6509895B2 (en) | Resource management based on device specific or user specific resource usage profile | |
JP6219512B2 (en) | Virtual hadoop manager | |
CN110888746B (en) | Memory management method and device, storage medium and electronic equipment | |
CN109936604B (en) | Resource scheduling method, device and system | |
CN106874031B (en) | Method and device for starting system program of terminal equipment | |
KR20160132432A (en) | Dynamic resource management for multi-process applications | |
US20060075204A1 (en) | Method and system for managing memory | |
US20170017511A1 (en) | Method for memory management in virtual machines, and corresponding system and computer program product | |
US20120239952A1 (en) | Information processing apparatus, power control method, and recording medium | |
CN111475299B (en) | Memory allocation method and device, storage medium and electronic equipment | |
CN105378668B (en) | The interruption of operating system management in multicomputer system guides | |
JP2014517434A5 (en) | ||
CN107368367B (en) | Resource allocation processing method and device and electronic equipment | |
CN113867959A (en) | Training task resource scheduling method, device, equipment and medium | |
CN111078587B (en) | Memory allocation method and device, storage medium and electronic equipment | |
CN103257898A (en) | Resource allocation method and system in embedded system | |
CN113495787A (en) | Resource allocation method, device, storage medium and electronic equipment | |
CN111124660B (en) | Method and device for allocating idle resources in virtual machine | |
CN112114958A (en) | Resource isolation method, distributed platform, computer device, and storage medium | |
JP2001117786A (en) | Process scheduling device and process scheduling method | |
CN110516121A (en) | Method for reading data and device | |
CN111078405B (en) | Memory allocation method and device, storage medium and electronic equipment | |
CN112650693B (en) | Static memory management method and device | |
CN114780245A (en) | Server resource allocation method and device | |
US20230138145A1 (en) | Information processing device, vehicle, information processing method, and 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 | ||
GR01 | Patent grant | ||
GR01 | Patent grant |