CN107402803A - A kind of method for managing resource and device - Google Patents
A kind of method for managing resource and device Download PDFInfo
- Publication number
- CN107402803A CN107402803A CN201710638451.1A CN201710638451A CN107402803A CN 107402803 A CN107402803 A CN 107402803A CN 201710638451 A CN201710638451 A CN 201710638451A CN 107402803 A CN107402803 A CN 107402803A
- Authority
- CN
- China
- Prior art keywords
- virtual machine
- memory block
- virtual
- nodes
- block number
- 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/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/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/5027—Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals
- G06F9/5044—Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals considering hardware capabilities
-
- 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)
- Multi Processors (AREA)
Abstract
The present invention provides a kind of method for managing resource and device, the above method and comprised the following steps:Memory block number of nodes, the resource data of virtual machine of virtual machine are obtained, wherein, the resource data of the virtual machine includes at least one of:The virtual coprocessor number of virtual machine, the memory size of virtual machine;It is resources of virtual machine corresponding to each memory block node distribution of the virtual machine according to the memory block number of nodes of the virtual machine, the resource data of the virtual machine.In above-mentioned technical proposal, by each rational resources of virtual machine of memory block node distribution for virtual machine, virtual machine process performance is further improved, ensure that the stability of a system.
Description
Technical field
The present invention relates to field of cloud computer technology, more particularly to a kind of method for managing resource and device.
Background technology
VNuma (visit by Virtual Non Uniform Memory Access Architecture, virtual non-unified memory
Ask) it is a kind of virutal machine memory Access Optimization mode, it can be created before virtual machine start according to the Numa topological structures of main frame
Build the VNuma topologys of virtual machine.VNuma is highly useful to the environment for needing high-performance virtual machine, can be according to master using VNuma
The Numa topological structures of machine are allocated to virutal machine memory and disposal ability, and virtual machine user can be in virtual machine internal root
According to the virtual topological structure using third party software (such as:Eclipse) CPU and internal memory are configured accordingly, so that
Obtaining virtual machine internal business operationally can preferentially access near-end internal memory to reduce access delay, reach the mesh of improving performance
's.
KVM (Kernel-based Virtual Machine, the virtual machine based on kernel) by libvirt come pair
VNuma topologys are configured, but if unreasonable allocation, then virtual machine can be caused to break down, and have a strong impact on business just
Often operation.
Therefore, there is an urgent need to a kind of resource management scheme to solve above-mentioned technical problem.
The content of the invention
The present invention provides a kind of method for managing resource and device, to solve the above problems.
The embodiment of the present invention provides a kind of method for managing resource, comprises the following steps:Obtain the memory block node of virtual machine
The resource data of quantity, virtual machine, wherein, the resource data of the virtual machine includes at least one of:Virtual machine it is virtual
The memory size of processor quantity, virtual machine;
It is the every of the virtual machine according to the memory block number of nodes of the virtual machine, the resource data of the virtual machine
Resources of virtual machine corresponding to one memory block node distribution.
The embodiment of the present invention provides a kind of resource management apparatus, including processor, is adapted for carrying out each instruction;Storage device,
Suitable for storing a plurality of instruction, the instruction is suitable to be loaded and performed by the processor;
Memory block number of nodes, the resource data of virtual machine of virtual machine are obtained, wherein, the resource data of the virtual machine
Including at least one of:The virtual coprocessor number of virtual machine, the memory size of virtual machine;
It is the every of the virtual machine according to the memory block number of nodes of the virtual machine, the resource data of the virtual machine
Resources of virtual machine corresponding to one memory block node distribution.
Technical scheme provided in an embodiment of the present invention:Obtain memory block number of nodes, the number of resources of virtual machine of virtual machine
According to, wherein, the resource data of the virtual machine includes at least one of:The virtual coprocessor number of virtual machine, virtual machine
Memory size;It is the every of the virtual machine according to the memory block number of nodes of the virtual machine, the resource data of the virtual machine
Resources of virtual machine corresponding to one memory block node distribution.
In above-mentioned technical proposal, by each rational resources of virtual machine of memory block node distribution for virtual machine, enter
One step improves virtual machine process performance, ensure that the stability of a system.
Brief description of the drawings
Accompanying drawing described herein is used for providing a further understanding of the present invention, forms the part of the application, this hair
Bright schematic description and description is used to explain the present invention, does not form inappropriate limitation of the present invention.In the accompanying drawings:
Fig. 1 show the method for managing resource flow chart of the embodiment of the present invention 1;
Fig. 2 show the resource management apparatus structure chart of the embodiment of the present invention 2.
Embodiment
Describe the present invention in detail below with reference to accompanying drawing and in conjunction with the embodiments.It should be noted that do not conflicting
In the case of, the feature in embodiment and embodiment in the application can be mutually combined.
The embodiment of the present invention is configured using libvirt to the memory block node of KVM virtual machines, preferable in order to reach
Effect, memory block node need to reflect bottom physical server topological structure (including:Memory block number of nodes, processing
Device quantity, memory size etc.), it could so cause virtual machine continually cross-node will not be accessed when using internal memory, be carried with this
High virtual machine performance;In virtual machine internal, because the memory block node topology of virtual machine is opened up with the memory block node of server
Flutter what is be consistent, can be used with the CPU of management configuration third party software and internal memory, so that virtual machine internal business is being transported
Near-end internal memory can also be preferentially accessed during row and accesses delay to reduce;Secondly, configured in the memory block node to virtual machine
When, it is necessary to strictly be limited the CPU distributions of each memory block node of virtual machine and Memory Allocation, so as to ensure
The virtual machine for being configured with memory block node being capable of normal operation.
Specifically:
First, need to configure the memory block of virtual machine according to the memory block node topology of server before virtual machine start
Node topology:
1) the memory block number of nodes of server is obtained;
If 2) virtual coprocessor number of virtual machine be vCPU quantity be server memory block number of nodes n times of (n
For integer), then the memory block number of nodes of virtual machine is equal to the memory block number of nodes of server, each memory block node
VCPU number is n, and vCPU finally is sequentially allocated into each memory block node to virtual machine;
3) if (e is whole more than zero to remaining e after the memory block number of nodes of the vCPU quantity of virtual machine divided by server
Number), then first it is distributed equally according to step 2, remaining e vCPU is sequentially allocated each internal memory to virtual machine again afterwards
Block node, finished until all vCPU are allocated, the vCPU quantity finally included according to each memory block node is sequentially allocated
vCPU。
Secondly, after the vCPU distribution of all memory block nodes of virtual machine is completed, it is also necessary to by the internal memory of virtual machine point
Each memory block node of dispensing virtual machine:
1) memory configurations that inquiry virtual machine is possessed
2) internal memory of virtual machine is averagely allocated to each memory block node of virtual machine;
3) because part operation system kernel limits (such as centos6.5), the internal memory of each memory block node of virtual machine
Size must be 32M integral multiple, otherwise Kernel Panic can be triggered to cause virtual-machine fail;
4) if the memory size of mean allocation is not 32M integral multiple, the memory block node of each virtual machine
Memory size rounds up, until reaching condition;Why round up, be to prevent virutal machine memory heat from inserting because internal memory
The adjustment of block node memory and there is the phenomenon to fail;
Finally, if KVM virtual machines open the slotting function of CPU heat, then virtual machine has two ginsengs about vCPU
Number, one is the current CPU quantity of virtual machine, and one is virtual machine maximum configurable CPU quantity, is carrying out the memory block of virtual machine
When node configures, the vCPU quantity of virtual machine should be carried out according to the latter's (i.e. virtual machine maximum configurable CPU quantity)
Setting, otherwise can cause part operation system cannot be started up.
Fig. 1 show the method for managing resource flow chart of the embodiment of the present invention 1, comprises the following steps:
Step 101:Memory block number of nodes, the resource data of virtual machine of virtual machine are obtained, wherein, the virtual machine
Resource data includes at least one of:The virtual coprocessor number of virtual machine, the memory size of virtual machine;
Further, before obtaining the memory block number of nodes of virtual machine, the resource data of virtual machine, in addition to:
Obtain the memory block number of nodes of server;
It is empty if the virtual coprocessor number of the virtual machine is the integral multiple of the memory block number of nodes of the server
The memory block number of nodes of plan machine is equal to the memory block number of nodes of the server.
Step 102:It is the void according to the memory block number of nodes of the virtual machine, the resource data of the virtual machine
Resources of virtual machine corresponding to each memory block node distribution of plan machine.
Further, if the virtual coprocessor number of the virtual machine is the whole of the memory block number of nodes of the server
Several times n, then the virtual coprocessor number for each memory block node distribution of the virtual machine is n.
Further, if after the memory block number of nodes of the virtual coprocessor number of the virtual machine divided by server,
Remainder is e, wherein, the e is the integer more than zero;
E virtual processor is then sequentially allocated the memory block node to virtual machine, until the virtual processor is divided
With finishing.
Further, according to the memory size of the virtual machine, by the memory block node of internal memory mean allocation to virtual machine.
Further, the memory size that the memory block node of the virtual machine is distributed is 32M integral multiple.
Fig. 2 show the resource management apparatus structure chart of the embodiment of the present invention 2, including processor, is adapted for carrying out each instruction;
Storage device, suitable for storing a plurality of instruction, the instruction is suitable to be loaded and performed by the processor;
Memory block number of nodes, the resource data of virtual machine of virtual machine are obtained, wherein, the resource data of the virtual machine
Including at least one of:The virtual coprocessor number of virtual machine, the memory size of virtual machine;
It is the every of the virtual machine according to the memory block number of nodes of the virtual machine, the resource data of the virtual machine
Resources of virtual machine corresponding to one memory block node distribution.
Further, before obtaining the memory block number of nodes of virtual machine, the resource data of virtual machine, in addition to:
Obtain the memory block number of nodes of server;
It is empty if the virtual coprocessor number of the virtual machine is the integral multiple of the memory block number of nodes of the server
The memory block number of nodes of plan machine is equal to the memory block number of nodes of the server.
Further, if the virtual coprocessor number of the virtual machine is the whole of the memory block number of nodes of the server
Several times n, then the virtual coprocessor number for each memory block node distribution of the virtual machine is n.
Further, if after the memory block number of nodes of the virtual coprocessor number of the virtual machine divided by server,
Remainder is e, wherein, the e is the integer more than zero;
E virtual processor is then sequentially allocated the memory block node to virtual machine, until the virtual processor is divided
With finishing.
Technical scheme provided in an embodiment of the present invention:Obtain memory block number of nodes, the number of resources of virtual machine of virtual machine
According to, wherein, the resource data of the virtual machine includes at least one of:The virtual coprocessor number of virtual machine, virtual machine
Memory size;It is the every of the virtual machine according to the memory block number of nodes of the virtual machine, the resource data of the virtual machine
Resources of virtual machine corresponding to one memory block node distribution.
In above-mentioned technical proposal, by each rational resources of virtual machine of memory block node distribution for virtual machine, enter
One step improves virtual machine process performance, ensure that the stability of a system.
The preferred embodiments of the present invention are the foregoing is only, are not intended to limit the invention, for the skill of this area
For art personnel, the present invention can have various modifications and variations.Within the spirit and principles of the invention, that is made any repaiies
Change, equivalent substitution, improvement etc., should be included in the scope of the protection.
Claims (10)
1. a kind of method for managing resource, it is characterised in that comprise the following steps:
Memory block number of nodes, the resource data of virtual machine of virtual machine are obtained, wherein, the resource data of the virtual machine includes
At least one of:The virtual coprocessor number of virtual machine, the memory size of virtual machine;
According to the memory block number of nodes of the virtual machine, the resource data of the virtual machine, for each of the virtual machine
Resources of virtual machine corresponding to memory block node distribution.
2. according to the method for claim 1, it is characterised in that obtain the memory block number of nodes of virtual machine, virtual machine
Before resource data, in addition to:
Obtain the memory block number of nodes of server;
If the virtual coprocessor number of the virtual machine is the integral multiple of the memory block number of nodes of the server, virtual machine
Memory block number of nodes be equal to the server memory block number of nodes.
3. according to the method for claim 2, it is characterised in that if the virtual coprocessor number of the virtual machine is the clothes
Be engaged in device memory block number of nodes integral multiple n, then for the virtual machine each memory block node distribution virtual processing
Device quantity is n.
4. according to the method for claim 3, it is characterised in that if the virtual coprocessor number of the virtual machine divided by service
After the memory block number of nodes of device, remainder e, wherein, the e is the integer more than zero;
E virtual processor is then sequentially allocated the memory block node to virtual machine, until the virtual processor has been allocated
Finish.
5. according to the method for claim 2, it is characterised in that according to the memory size of the virtual machine, internal memory is averaged
Distribute to the memory block node of virtual machine.
6. according to the method for claim 5, it is characterised in that the internal memory that the memory block node of the virtual machine is distributed is big
The small integral multiple for 32M.
7. a kind of resource management apparatus, it is characterised in that including processor, be adapted for carrying out each instruction;Storage device, suitable for storage
A plurality of instruction, the instruction are suitable to be loaded and performed by the processor;
Memory block number of nodes, the resource data of virtual machine of virtual machine are obtained, wherein, the resource data of the virtual machine includes
At least one of:The virtual coprocessor number of virtual machine, the memory size of virtual machine;
According to the memory block number of nodes of the virtual machine, the resource data of the virtual machine, for each of the virtual machine
Resources of virtual machine corresponding to memory block node distribution.
8. device according to claim 7, it is characterised in that obtain the memory block number of nodes of virtual machine, virtual machine
Before resource data, in addition to:
Obtain the memory block number of nodes of server;
If the virtual coprocessor number of the virtual machine is the integral multiple of the memory block number of nodes of the server, virtual machine
Memory block number of nodes be equal to the server memory block number of nodes.
9. device according to claim 8, it is characterised in that if the virtual coprocessor number of the virtual machine is the clothes
Be engaged in device memory block number of nodes integral multiple n, then for the virtual machine each memory block node distribution virtual processing
Device quantity is n.
10. device according to claim 9, it is characterised in that if the virtual coprocessor number divided by clothes of the virtual machine
It is engaged in after the memory block number of nodes of device, remainder e, wherein, the e is the integer more than zero;
E virtual processor is then sequentially allocated the memory block node to virtual machine, until the virtual processor has been allocated
Finish.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710638451.1A CN107402803A (en) | 2017-07-28 | 2017-07-28 | A kind of method for managing resource and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710638451.1A CN107402803A (en) | 2017-07-28 | 2017-07-28 | A kind of method for managing resource and device |
Publications (1)
Publication Number | Publication Date |
---|---|
CN107402803A true CN107402803A (en) | 2017-11-28 |
Family
ID=60402532
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201710638451.1A Pending CN107402803A (en) | 2017-07-28 | 2017-07-28 | A kind of method for managing resource and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN107402803A (en) |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101477496A (en) * | 2008-12-29 | 2009-07-08 | 北京航空航天大学 | NUMA structure implementing method based on distributed internal memory virtualization |
US20140196033A1 (en) * | 2013-01-10 | 2014-07-10 | International Business Machines Corporation | System and method for improving memory usage in virtual machines |
CN104850461A (en) * | 2015-05-12 | 2015-08-19 | 华中科技大学 | NUMA-oriented virtual cpu (central processing unit) scheduling and optimizing method |
-
2017
- 2017-07-28 CN CN201710638451.1A patent/CN107402803A/en active Pending
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101477496A (en) * | 2008-12-29 | 2009-07-08 | 北京航空航天大学 | NUMA structure implementing method based on distributed internal memory virtualization |
US20140196033A1 (en) * | 2013-01-10 | 2014-07-10 | International Business Machines Corporation | System and method for improving memory usage in virtual machines |
CN104850461A (en) * | 2015-05-12 | 2015-08-19 | 华中科技大学 | NUMA-oriented virtual cpu (central processing unit) scheduling and optimizing method |
Non-Patent Citations (1)
Title |
---|
施继成等: "面向多处理器虚拟机的动态NUMA方法", 《小型微型计算机***》 * |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US20230400990A1 (en) | System and method for performing live partitioning in a data store | |
US11789925B2 (en) | System and method for conditionally updating an item with attribute granularity | |
US20210103604A1 (en) | System and method for implementing a scalable data storage service | |
US10505796B2 (en) | Network function virtualization | |
US11609697B2 (en) | System and method for providing a committed throughput level in a data store | |
JP5510556B2 (en) | Method and system for managing virtual machine storage space and physical hosts | |
CN108139935B (en) | The extension of the resource constraint of service definition container | |
US9372911B2 (en) | System and method for performing replica copying using a physical copy mechanism | |
US8819027B1 (en) | System and method for partitioning and indexing table data using a composite primary key | |
US20220043675A1 (en) | Graph computing method and apparatus | |
CN110633130B (en) | Virtual memory management method and device based on memory hot plug technology | |
CN106777085A (en) | A kind of data processing method, device and data query system | |
CN106911741A (en) | A kind of method and NM server for virtualizing webmaster file download load balancing | |
CN115964176B (en) | Cloud computing cluster scheduling method, electronic equipment and storage medium | |
CN107402803A (en) | A kind of method for managing resource and device | |
CN110109758A (en) | A kind of cloud computing resources distribution method | |
CN110287004B (en) | Basic environment mirror image preheating method and device based on docker container technology | |
KR102156656B1 (en) | System and method for creating stack of virtual machine | |
CN107967165A (en) | The offline moving method of virtual machine based on LVM | |
CN106027591A (en) | Service optimization computer system and method thereof | |
CN113709241B (en) | Scheduling and distributing combination method and system for physical resources in cloud scene | |
WO2024125052A1 (en) | Device control method and apparatus, and electronic device and computer storage medium | |
CN118051341A (en) | Computing power resource scheduling method, computing power resource scheduling device, terminal equipment 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 | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20171128 |
|
RJ01 | Rejection of invention patent application after publication |