Resource management methods, devices and related equipment
By mixing instances with different oversold ratios in the server configuration and optimizing resource management, the high cost problem caused by the diversity of machine types in cloud computing was solved, achieving cost reduction and improved resource utilization.
Patent Information
- Application Number
- CN202011025397.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-09-25
- Publication Date
- 2025-11-14
- Estimated Expiration
- 2040-09-25
AI Technical Summary
Instances with varying oversold ratios in cloud computing result in a diversity of server models, increasing supply chain and operation and maintenance costs.
Configure instances with different oversold ratios on a single server and optimize resource utilization through scheduling control methods to reduce the number of machine types and reduce resource fragmentation.
By optimizing resource allocation, supply chain and operation and maintenance costs were reduced, while resource utilization and flexibility were improved.
Smart Images

Figure CN114253702B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of cloud computing, and in particular to resource management methods, apparatus, and related equipment. Background Technology
[0002] As an emerging industry in recent years, cloud computing has gained widespread attention from the scientific research and industrial communities. Cloud computing is mainly divided into three types: Infrastructure as a Service, Platform as a Service, and Software as a Service.
[0003] Infrastructure as a Service (IaaS) refers to the service provided to customers that utilizes all facilities, including processing, storage, networking, and other basic computing resources. Users can deploy and run any software, including operating systems and applications. Consumers do not manage or control any cloud computing infrastructure, but they can control the choice of operating system, storage space, deployed applications, and may also have limited control over network components (e.g., firewalls, load balancers, etc.). In IaaS, instances are divided into dedicated instances and shared instances. Each Central Processing Unit (CPU) of a dedicated instance is bound to a single physical CPU with multiple threads, meaning the oversubscription ratio of a dedicated instance is 1. There is no CPU resource contention between dedicated instances, resulting in stable computing performance guaranteed by a strict Service-Level Agreement (SLA). Shared instances have an oversubscription ratio greater than 1, such as 2, 3, or 5. Shared instances share CPUs with other shared instances, therefore the stability of instance computing performance cannot be guaranteed, but the cost is relatively lower. To cater to customers with different needs, cloud service providers typically offer instances with different oversubscription ratios for customers to choose from.
[0004] Instances with different overbooking ratios require a specific server model, resulting in a large number of server models and higher costs for the supply chain and operation and maintenance. Summary of the Invention
[0005] This application provides a resource management method, apparatus, and related equipment that can reduce supply chain and operation and maintenance costs.
[0006] The first aspect of this application provides a method for determining resource management.
[0007] The method includes: a resource management device obtaining remaining resource information of a first server. If the remaining resource information indicates that the remaining resources of the first server are greater than the resources required by the first instance, the resource management device sends a first command to the first server. The first command instructs the first server to create a first instance according to the first command. The first server also creates a second instance, the oversold ratio of which is different from that of the first instance.
[0008] By configuring instances with different oversold ratios on a single server, the number of server models can be reduced, thereby lowering supply chain and operation and maintenance costs.
[0009] Based on the first aspect of this application, in the first embodiment of the first aspect of this application, if the values of various resources of the instances already created in the first server and the total resource value satisfy a first condition, then the resource management device sends a first command to the first server, and the first condition is used to reduce the resource fragmentation of the first server.
[0010] Based on the first embodiment of the first aspect of this application, in the second embodiment of the first aspect of this application, the values of various resources and the total resource value satisfying the first condition means that the first coordinates H,K are in the first region, H is the total number of CPU cores of the created instances, K is the total memory value of the created instances, the first region is composed of a first line, a second line, a third line, and a fourth line, the first line is a line passing through the origin with a slope of a, the second line is a line passing through the origin with a slope of b, the third line is a line passing through the second coordinates Z,M with a slope of a, the fourth line is a line passing through the second coordinates with a slope of b, Z is the total number of CPU cores of the first server, M is the total memory value of the first server, the total resource value includes the total number of CPU cores and the total memory value, a is the reciprocal of the minimum CPU-to-memory ratio of instances that can be created by the first server, and b is the reciprocal of the maximum CPU-to-memory ratio of instances that can be created by the first server. The first coordinates H,K in the first region also include the edges where the first line, the second line, the third line, and the fourth line connect to the first region. If the first coordinates H,K are within the region, it means that resource fragmentation may not occur. If the first coordinates H,K are outside the region, it means that resource fragmentation will definitely occur. Therefore, by restricting the first coordinates H,K to be within the region, the generation of memory or CPU resource fragmentation on the first server can be reduced or avoided, thereby improving resource utilization.
[0011] Based on the first aspect of this application, or any one of the first to second embodiments of the first aspect, in the third embodiment of the first aspect of this application, the first instance is a dedicated instance, and the method further includes: a resource management device obtaining the number of CPU cores of the created dedicated instances on the first server, and the total number of dedicated instance CPU cores; if the number of created dedicated instance CPU cores plus F is less than or equal to the total number of dedicated instance CPU cores, then the resource management device sends a first command to the first server, where F is the number of CPU cores required by the first instance. Wherein, the first instance is a dedicated instance, and the oversubscription ratio of the first instance and the second instance is different, then the second instance is a shared instance. By pre-setting the total number of dedicated instance CPU cores in the first server, the number of CPU cores of the shared instances is also limited.
[0012] Based on the third implementation of the first aspect of this application, in the fourth implementation of the first aspect of this application, the resource management device obtains the number of created instance CPU cores and the total number of instance CPU cores of the first server. If the number of created dedicated instance CPU cores plus F is less than or equal to the total number of dedicated instance CPU cores, and the number of created instance CPU cores plus F is less than or equal to the total number of instance CPU cores, then the resource management device sends the first command to the first server. Wherein, the sum of the total number of dedicated instance CPU cores and the total number of shared instance CPU cores is greater than the total number of instance CPU cores. For example, the total number of dedicated instance CPU cores is 70, the total number of shared instance CPU cores is 50, and the total number of instance CPU cores is 100. Because to satisfy the requirement of a total number of instance cores of 100, in practical applications, the total number of dedicated instance CPU cores will fluctuate between 50 and 70, and the total number of shared instance CPU cores will fluctuate between 30 and 50. Therefore, while reducing resource fragmentation, the flexibility of instance configuration is improved.
[0013] Based on the first aspect of this application, or any one of the first to fourth embodiments of the first aspect, in the fifth embodiment of the first aspect of this application, the first instance is a dedicated instance, the second instance is a shared instance, and the first instance is bound to the first CPU in the first server. When the first instance is deleted or idle, the core binding range of the second instance also includes the first CPU. By allocating the CPU corresponding to the dedicated instance to the shared embodiment, the core binding range of the dedicated instance can be increased without affecting the dedicated instance, thus improving the user experience of the dedicated instance.
[0014] Based on the first aspect of this application, or any one of the first to second embodiments of the first aspect, in the sixth embodiment of the first aspect of this application, the first instance and the second instance are shared instances. When the shared instances in the first server compete for CPU resources in the first server, the ratio of the scheduling priorities of the first shared instance and the second shared instance competing for CPU resources is K / J, where K is the oversubscription ratio of the second shared instance and J is the oversubscription ratio of the first shared instance. The ratio of scheduling priorities is the reciprocal of the oversubscription ratio, indicating that the larger the oversubscription ratio, the lower the priority. Therefore, fairness can be improved.
[0015] The second aspect of this application provides a resource management method.
[0016] The method includes: a first server receiving a first command sent by a first resource management device;
[0017] A first instance is created according to the first command, which is obtained by the resource management device based on the remaining resource information. The remaining resource information indicates that the remaining resources of the first server are greater than or equal to the resources required by the first instance. The first server also creates a second instance, which has a different oversold ratio than the first instance.
[0018] Based on the second aspect of this application, in a first embodiment of the second aspect of this application, the first command is obtained based on the remaining resource information and the first condition, wherein the values of various resources of the instances already created in the first server and the total resource value satisfy the first condition, and the first condition is used to reduce resource fragmentation of the first server.
[0019] Based on the first embodiment of the second aspect of this application, in the second embodiment of the second aspect of this application, the resource ratio is the CPU-to-memory ratio. The values of various resources and the total resource value satisfy the first condition when the first coordinates H, K are in a first region. H is the total number of CPU cores of the created instances, and K is the total memory value of the created instances. The first region is composed of a first straight line, a second straight line, a third straight line, and a fourth straight line. The first straight line is a straight line passing through the origin with a slope of a. The second straight line is a straight line passing through the origin with a slope of b. The third straight line is a straight line passing through the second coordinates Z, M with a slope of a. The fourth straight line is a straight line passing through the second coordinates with a slope of b. Z is the total number of CPU cores of the first server, and M is the total memory value of the first server. The total resource value includes the total number of CPU cores and the total memory value. a is the reciprocal of the minimum CPU-to-memory ratio of the instances that can be created by the first server, and b is the reciprocal of the maximum CPU-to-memory ratio of the instances that can be created by the first server.
[0020] Based on the second aspect of this application, or any one of the first to second embodiments of the second aspect, in the third embodiment of the second aspect of this application, the first instance is a dedicated instance, and the remaining resource information includes the number of dedicated instance CPU cores already created and the total number of dedicated instance CPU cores. The remaining resources being greater than or equal to the resources required by the first instance include the number of dedicated instance CPU cores already created plus F being less than or equal to the total number of dedicated instance CPU cores, where F is the number of CPU cores required by the first instance.
[0021] Based on the third implementation of the second aspect of this application, in the fourth implementation of the second aspect of this application, the remaining resource information further includes the number of created instance CPU cores, the total number of instance CPU cores, and the remaining resources greater than or equal to the resources required by the first instance further include the number of created instance CPU cores plus F less than or equal to the total number of instance CPU cores.
[0022] Based on the second aspect of this application, or any one of the first to fourth embodiments of the second aspect, in the fifth embodiment of the second aspect of this application, the first instance is a dedicated instance, the second instance is a shared instance, the first instance is bound to the first CPU in the first server, and when the first instance is deleted or idle, the core binding range of the second instance also includes the first CPU.
[0023] Based on the second aspect of this application, or any one of the first to second embodiments of the second aspect, in the sixth embodiment of the second aspect of this application, the first instance and the second instance are shared instances. When the shared instances in the first server compete for CPU resources in the first server, the ratio of the scheduling priority of the first shared instance and the second shared instance competing for the CPU resources is K / J, where K is the oversubscription ratio of the second shared instance and J is the oversubscription ratio of the first shared instance.
[0024] A third aspect of this application provides a resource management device.
[0025] The device includes: an acquisition module for acquiring remaining resource information of a first server;
[0026] The sending module is used to send a first command to the first server if the remaining resource information indicates that the remaining resources of the first server are greater than or equal to the resources required by the first instance. The first command is used to instruct the first server to create a first instance according to the first command. The first server also creates a second instance, and the oversold ratio of the second instance is different from that of the first instance.
[0027] Based on the third aspect of this application, in the first embodiment of the third aspect of this application, the sending module is specifically used to send a first command to the first server if, after the first server creates the first instance, the values of various resources of the instance already created in the first server and the total resource value satisfy a first condition, the first condition is used to reduce the resource fragmentation of the first server.
[0028] Based on the first embodiment of the third aspect of this application, in the second embodiment of the third aspect of this application, the resource ratio is the CPU-to-memory ratio. The values of various resources and the total resource value satisfy the first condition, which means that the first coordinates H, K are in the first region, where H is the total number of CPU cores of the created instances, K is the total memory value of the created instances, the first region is composed of a first line, a second line, a third line and a fourth line, the first line is a line passing through the origin with a slope of a, the second line is a line passing through the origin with a slope of b, the third line is a line passing through the second coordinates Z, M with a slope of a, the fourth line is a line passing through the second coordinates with a slope of b, Z is the total number of CPU cores of the first server, M is the total memory value of the first server, the total resource value includes the total number of CPU cores and the total memory value, a is the reciprocal of the minimum CPU-to-memory ratio of the instances that can be created by the first server, and b is the reciprocal of the maximum CPU-to-memory ratio of the instances that can be created by the first server.
[0029] Based on the third aspect of this application, or any one of the first to second embodiments of the third aspect, in the third embodiment of the third aspect of this application, the first instance is a dedicated instance, and the acquisition module is further used to acquire the number of dedicated instance CPU cores created by the first server and the total number of dedicated instance CPU cores.
[0030] The sending module is specifically used to send a first command to the first server if the number of CPU cores of the created dedicated instance plus F is less than or equal to the total number of CPU cores of the dedicated instance.
[0031] Based on the third implementation of the third aspect of this application, in the fourth implementation of the third aspect of this application, the acquisition unit is further configured to acquire the number of created instance CPU cores and the total number of instance CPU cores of the first server; the sending module is specifically configured to send a first command to the first server if the number of created dedicated instance CPU cores plus F is less than or equal to the total number of dedicated instance CPU cores, and the number of created instance CPU cores plus F is less than or equal to the total number of instance CPU cores.
[0032] Based on the third aspect of this application, or any one of the first to fourth embodiments of the third aspect, in the fifth embodiment of the third aspect of this application, the first instance is a dedicated instance, the second instance is a shared instance, the first instance is bound to the first CPU in the first server, and when the first instance is deleted or idle, the binding scope of the second instance also includes the first CPU.
[0033] Based on the third aspect of this application, or any one of the first to second embodiments of the third aspect, in the sixth embodiment of the third aspect of this application, the first instance and the second instance are shared instances. When the shared instances in the first server compete for CPU resources in the first server, the ratio of the scheduling priority of the first shared instance and the second shared instance competing for CPU resources is K / J, where K is the oversubscription ratio of the second shared instance and J is the oversubscription ratio of the first shared instance.
[0034] The fourth aspect of this application provides a resource management device.
[0035] The device includes: a receiving module for receiving a first command sent by a first resource management device;
[0036] A creation module is used to create a first instance according to the first command, which is obtained by the resource management device based on the remaining resource information. The remaining resource information indicates that the remaining resources of the first server are greater than or equal to the resources required by the first instance. The first server also creates a second instance, which has a different oversold ratio than the first instance.
[0037] Based on the fourth aspect of this application, in a first embodiment of the fourth aspect of this application, the first command is obtained based on the remaining resource information and the first condition, wherein the values of various resources of the instances already created in the first server and the total resource value satisfy the first condition, and the first condition is used to reduce resource fragmentation of the first server.
[0038] Based on the fourth aspect of this application, or any one of the first to second embodiments of the fourth aspect, in the third embodiment of the fourth aspect of this application, the resource ratio is the CPU-to-memory ratio. The condition that the values of each type of resource and the total resource value satisfy the first condition means that the first coordinates H, K are in a first region, where H is the total number of CPU cores of the created instances, K is the total memory value of the created instances, the first region is composed of a first straight line, a second straight line, a third straight line, and a fourth straight line. The first straight line passes through the origin and has a slope of a; the second straight line passes through the origin and has a slope of b; the third straight line passes through the second coordinates Z, M and has a slope of a; the fourth straight line passes through the second coordinates and has a slope of b; Z is the total number of CPU cores of the first server; M is the total memory value of the first server; the total resource value includes the total number of CPU cores and the total memory value; a is the reciprocal of the minimum CPU-to-memory ratio of instances that can be created by the first server; and b is the reciprocal of the maximum CPU-to-memory ratio of instances that can be created by the first server.
[0039] Based on the fourth aspect of this application, or any one of the first to second embodiments of the fourth aspect, in the third embodiment of the fourth aspect of this application, the first instance is a dedicated instance, and the remaining resource information includes the number of dedicated instance CPU cores already created and the total number of dedicated instance CPU cores. The remaining resources being greater than or equal to the resources required by the first instance include the number of dedicated instance CPU cores already created plus F being less than or equal to the total number of dedicated instance CPU cores.
[0040] Based on the third embodiment of the fourth aspect of this application, in the fourth embodiment of the fourth aspect of this application, the remaining resource information further includes the number of created instance CPU cores, the total number of instance CPU cores, and the remaining resources greater than or equal to the resources required by the first instance further include the number of created instance CPU cores plus F less than or equal to the total number of instance CPU cores.
[0041] Based on the fourth aspect of this application, or any one of the first to fourth embodiments of the fourth aspect, in the fifth embodiment of the fourth aspect of this application, the first instance is a dedicated instance, the second instance is a shared instance, the first instance is bound to the first CPU in the first server, and when the first instance is deleted or idle, the core binding range of the second instance also includes the first CPU.
[0042] Based on the fourth aspect of this application, or any one of the first to second embodiments of the fourth aspect, in the sixth embodiment of the fourth aspect of this application, the first instance and the second instance are shared instances. When the shared instances in the first server compete for CPU resources in the first server, the ratio of the scheduling priority of the first shared instance and the second shared instance competing for the CPU resources is K / J, where K is the oversubscription ratio of the second shared instance and J is the oversubscription ratio of the first shared instance.
[0043] The fifth aspect of this application provides a resource management device.
[0044] The device includes a processor and a transceiver, the processor being used to obtain information about the remaining resources of the first server;
[0045] The transceiver is configured to send a first command to the first server if the remaining resource information indicates that the remaining resources of the first server are greater than or equal to the resources required by the first instance. The first command is used to instruct the first server to create the first instance according to the first command. The first server also creates a second instance, the oversold ratio of which is different from that of the first instance.
[0046] In an alternative embodiment of the fifth aspect, the processor and the transceiver are further configured to perform all or part of the operations performed by the resource management device in the first aspect.
[0047] The sixth aspect of this application provides a server.
[0048] The server includes a processor and a transceiver, the transceiver being used to receive a first command sent by a first resource management device;
[0049] The processor is used to create a first instance according to the first command, which is obtained by the resource management device based on the remaining resource information. The remaining resource information indicates that the remaining resources of the first server are greater than or equal to the resources required by the first instance. The first server also creates a second instance, which has a different oversold ratio than the first instance.
[0050] In an alternative embodiment of the sixth aspect, the processor and the transceiver are further configured to perform all or part of the operations performed by the first server in the second aspect described above.
[0051] A seventh aspect of this application provides a computer storage medium, characterized in that the computer storage medium stores instructions that, when executed on a computer, cause the computer to perform the method as described in the first aspect or any embodiment of the first aspect; or cause the computer to perform the method as described in the second aspect or any embodiment of the second aspect.
[0052] The eighth aspect of this application provides a computer program product, characterized in that, when executed on a computer, the computer program product causes the computer to perform the method as described in the first aspect or any embodiment of the first aspect; or causes the computer to perform the method as described in the second aspect or any embodiment of the second aspect. Attached Figure Description
[0053] Figure 1 Data center architecture diagram for Infrastructure as a Service;
[0054] Figure 2 This is a schematic diagram illustrating the creation process of an instance in the embodiments of this application;
[0055] Figure 3 This is a schematic diagram of an application scenario in an embodiment of this application;
[0056] Figure 4 This is a flowchart illustrating a resource management method in an embodiment of this application;
[0057] Figure 5 This is a schematic diagram of the structure of the first region in an embodiment of this application;
[0058] Figure 6 This is a schematic diagram of the structure for adding the core binding range of shared instances in the embodiments of this application;
[0059] Figure 7 This is a schematic diagram of the structure in this application embodiment that does not increase the binding range of the shared instance;
[0060] Figure 8 This is a schematic diagram of the configuration interface displayed in the resource management console in this application example;
[0061] Figure 9 This is a schematic diagram of the monitoring interface displayed in the resource management console in this application example;
[0062] Figure 10 This is a schematic diagram of the resource management device in an embodiment of this application;
[0063] Figure 11 This is another structural schematic diagram of the resource management device in the embodiments of this application;
[0064] Figure 12 This is a schematic diagram of the structure of the resource management device or the first server in the embodiments of this application. Detailed Implementation
[0065] This application provides a resource management method, apparatus, and related equipment, which can be applied in the field of cloud computing and can reduce supply chain and operation and maintenance costs.
[0066] Cloud computing, as an emerging industry in recent years, has gained widespread attention from the scientific and industrial communities. "Cloud" is an abstract concept related to resource management via a network, and more precisely, to data center architecture that provides platforms for offering services over a network. For example, the cloud can refer to various services provided via the Internet, such as network-based storage or computing services. Typical cloud architecture deployments include a layered hierarchical structure comprising a physical layer of network hardware and one or more software layers that enable users to access the network hardware. For example, a common type of cloud architecture deployment includes a physical layer of network resources (e.g., servers, storage arrays, network switches, etc.) accompanied by a multi-tiered software framework. This framework includes a first layer implementing Infrastructure as a Service (IaaS), a second layer implementing Platform as a Service (PaaS), and a third layer implementing Software as a Service (SaaS). Generally, although there may be exceptions, resources in the third layer depend on resources in the second layer, resources in the second layer depend on resources in the first layer, and resources in the first layer depend on resources in the physical layer.
[0067] For cloud service providers, resource management is crucial to ensure the efficient and rational allocation and operation of resources on servers. Please refer to [link / reference]. Figure 1 , Figure 1 A data center architecture diagram for Infrastructure as a Service (IaaS). (Example) Figure 1 As shown, to facilitate service delivery to users in different regions, cloud service providers can divide servers serving users in different regions into different availability zones based on geographical areas. These availability zones are centrally managed by asset management equipment. Each availability zone includes multiple server clusters, and each server cluster includes multiple servers. Each server provides basic computing and storage capabilities to users by creating instances. To meet the needs of different users, cloud service providers typically offer instances with different oversubscription ratios for customers to choose from. Instances with different oversubscription ratios correspond to a specific server model. Having a large number of instances with different oversubscription ratios results in a large number of server models, leading to higher costs for the supply chain and operation and maintenance.
[0068] Therefore, this application provides a resource management method. In this method, instances with different oversubscription ratios are created on a single server, and a customized scheduling control method is used to fully utilize the server's multi-dimensional resources (CPU core count, memory size, disk size), reduce resource fragmentation, decrease the number of server types, and lower costs.
[0069] To facilitate understanding of the resource management method provided in the embodiments of this application, the instance creation process will be described first. Please refer to... Figure 2 , Figure 2 This is a schematic diagram of the instance creation process in an embodiment of this application. The process includes receiving an order (instance) 201, instance allocation 202, instance creation 203, and providing cloud services 204. Receiving an order 201 generally refers to receiving a user's specific requirements for an instance and the binding relationship between the instance and the user. For example, the specific requirements might be 2 CPU cores and 4GB of RAM. The binding relationship includes the instance being bound to account X, meaning only users logged into account X can use the cloud services corresponding to that instance. Instance allocation 202 refers to assigning the instance to a specific server, and which server specifically provides computing and storage capabilities for the instance. Instance creation 203 refers to allocating the resources needed for the instance within a server and binding those resources to the user. Providing cloud services 204 refers to providing computing, storage, and other services to users logged into the account using the resources on the server. It should be noted that dividing the instance creation process into receiving an order 201, instance allocation 202, instance creation 203, and providing cloud services 204 is for ease of understanding of this application and should not be considered a limitation of this application, or in other words, the boundaries of the instance creation process do not need to be explicitly defined.
[0070] The instance creation process has been described above, roughly divided into receiving an order (201), instance allocation (202), instance creation (203), and providing cloud services (204). Instance creation (203) and providing cloud services (204) are performed on the same computer device. Instance allocation (202) and instance creation (203) can be performed on the same computer device or on different computer devices; alternatively, please refer to [link to relevant documentation]. Figure 3 , Figure 3 This is a schematic diagram illustrating an application scenario in an embodiment of this application. For example... Figure 3 As shown, the resource management device 301 performs instance allocation 202. After determining that the first server 302 will provide resources for the instance, the resource management device 301 sends a first command to the first server 302 so that the first server 302 can execute instance creation 203 according to the first command, and subsequently execute cloud service provision 204.
[0071] exist Figure 3 In the application scenario shown, resource management device 301 can refer to the aforementioned Figure 1 The resource management device 301 can be a desktop computer, laptop, or server, etc. The first server 302 can be referenced above. Figure 1A server in the process. It should be noted that if the first server 302 can complete all the steps executed by the resource management device 301, then the resource management method provided in this application can be completed by the first server 302 alone. It can also be understood that the first server 302 is the resource management device 301, and the resource management device 301 does not need to send the first command to the first server 302.
[0072] The technical solutions in this application will now be described with reference to the accompanying drawings. For example, features or content marked with dashed lines in the drawings related to the embodiments of this application can be understood as optional operations or optional structures of the embodiments.
[0073] Please see Figure 4 , Figure 4 This is a flowchart illustrating a resource management method in an embodiment of this application.
[0074] In step 401, the resource management device obtains information about the first instance.
[0075] The information for the first instance includes its oversold ratio and the resources required. These resources include the number of CPU cores and the amount of RAM, and may also include the amount of hard disk storage. The number of CPU cores is referred to as the CPU core count, and when the number of CPU cores is a fixed value, it can also be abbreviated as 1 core, 3 cores, etc. RAM is referred to as memory value, which is different from hard disk storage. When the memory value is a fixed value, it can also be abbreviated as 1GB, 2GB, 4GB, etc. Typically, the number of CPU cores and memory value are used in combination, such as 1 core 2GB, 1 core 1GB, etc. The ratio of the number of CPU cores to the amount of memory is called the CPU-to-memory ratio. For example, the CPU-to-memory ratio for 1 core 2GB is 1 / 2, and the CPU-to-memory ratio for 2 cores 8GB is 1 / 4. Storage space size refers to the amount of hard disk storage. Oversubscription ratio refers to the number of instances sharing a single CPU core. For example, if three instances each have one core and 2GB of RAM, and only these three instances share a single CPU core, then the oversubscription ratio for these three instances is 3. Conversely, if an instance has two cores and 2GB of RAM, and this instance does not share a CPU core with other instances, then the oversubscription ratio for this instance is 1. In practical applications, instances with an oversubscription ratio of 1 are called dedicated instances, and instances with an oversubscription ratio greater than 1 are called shared instances.
[0076] In step 402, the resource management device obtains the remaining resource information of the first server.
[0077] The content of the remaining resource information is determined by the subsequent execution. For ease of understanding, the remaining resource information includes two parts, content a and content b. The resource management device can obtain only content a or content b, or it can obtain both content a and content b.
[0078] Content a includes: the number of dedicated instance CPU cores already created on the first server, the total number of dedicated instance CPU cores, the number of created instance CPU cores, and the total number of instance CPU cores. The number of dedicated instance CPU cores already created on the first server refers to the sum of the CPU cores of all dedicated instances created on the first server. The total number of dedicated instance CPU cores is a pre-set value used to limit the number of dedicated instance CPU cores on the first server from exceeding this value. The number of created instance CPU cores refers to the sum of the CPU cores of all instances created on the first server, including both dedicated and shared instances. The total number of instance CPU cores refers to the number of CPU cores on the first server that can provide cloud services.
[0079] For ease of description, assume the first server can provide 100 CPU cores for cloud services, meaning the total number of instance CPU cores is 100. The first server can provide 320GB of RAM and 4000GB of hard disk space. The first server can provide three instance types: Type 1, Type 2, and Type 3. The total number of dedicated instance CPU cores and the total number of shared instance CPU cores are derived from the instance types available on the first server and the ratio between them. For example, Type 1 is dedicated, 1 core, 2GB RAM, 40GB of RAM. Type 2 is dedicated, 1 core, 3GB RAM, 40GB of RAM. Type 3 is shared, 2 cores, 4GB RAM, 40GB of RAM, with an oversubscription ratio of 2. Statistical analysis shows that the ratio of Type 1 to Type 2 instances is approximately 1:2. Let's set the total number of dedicated instance CPU cores to 70 and the total number of shared instance CPU cores to 50. Under this setting, the actual number of dedicated instance CPU cores will fluctuate between 50 and 70, and the actual number of shared instance CPU cores will fluctuate between 30 and 50. When the actual number of dedicated instance CPU cores is 60 and the actual number of shared instance CPU cores is 40, the first server will not experience resource fragmentation. Specifically, the total number of CPU cores consumed by all instances is: 60 × 1 + 40 × 2 ÷ 2 = 100, and the total memory consumed by all instances is: The total disk space consumed by all instances is 40 × 100 = 4000 GB. Therefore, if the total number of dedicated instance CPU cores is set to 60 and the total number of shared instance CPU cores to 40, the sum of the total dedicated instance CPU cores and the total number of shared instance CPU cores equals the total number of instance CPU cores, which reduces resource fragmentation. Furthermore, if the total number of dedicated instance CPU cores is set to 70, the total number of shared instance CPU cores to 50, and the total number of shared instance CPU cores to 40, the sum of the total dedicated instance CPU cores and the total number of shared instance CPU cores is greater than the total number of instance CPU cores. The actual number of dedicated instance CPU cores will fluctuate between 50 and 70, and the actual number of shared instance CPU cores will fluctuate between 30 and 50, providing more flexible configuration suitable for scenarios where future user needs are uncertain. It should be noted that when the sum of the total dedicated instance CPU cores and the total number of shared instance CPU cores equals the total number of instance CPU cores, the resource management device does not need to obtain the number of created instance CPU cores and the total number of instance CPU cores.
[0080] Content b includes: the values of various resources of the created instances after the first server creates the first instance, and the total resource value. It's important to note that "after the first server creates the first instance" does not mean the first instance must be created, but rather that the first server has created the first instance afterward. Assume that the values of various resources of the created instances include the total number of CPU cores and the total memory value of the created instances. The total resource value includes the total number of CPU cores and the total memory value of the instances.
[0081] For content a and / or content b mentioned above, if the corresponding data is stored in the local storage space, the resource management device can retrieve content a and / or content b from the local storage space; if the corresponding data is not stored in the local storage space, the resource management device can send a request to the first server, causing the first server to report content a and / or content b to the resource management device. When the resource management device sends a request to the first server, the first server can report a portion of content a and / or content b to the resource management device. For example, for content a, the first server sends the number of dedicated instance CPU cores and the total number of instance CPU cores created to the resource management device, and the resource management device retrieves the total number of dedicated instance CPU cores and the total number of instance CPU cores from the local storage space.
[0082] In step 403, the resource management device determines whether the remaining resources of the first server are greater than or equal to the resources required by the first instance based on the remaining resource information.
[0083] In step 402 above, the resource management device acquires content a and / or content b. The following describes how to use content a or content b to determine whether the remaining resources in the first server are greater than or equal to the resources required by the first instance.
[0084] For content a, if the number of dedicated instance CPU cores plus F is less than or equal to the total number of dedicated instance CPU cores, and the number of instance CPU cores plus F is less than or equal to the total number of instance CPU cores, then the resource management device determines that the remaining resources of the first server are greater than or equal to the resources required by the first instance.
[0085] For content b, if, after the first instance is created on the first server, the values of various resources of the instances already created on the first server and the total resource value satisfy the first condition, then the resource management device determines that the remaining resources of the first server are greater than or equal to the resources required by the first instance; if, after the first instance is created on the first server, the values of various resources of the instances already created on the first server and the total resource value do not satisfy the first condition, then the resource management device determines that the remaining resources of the first server are less than the resources required by the first instance; the first condition is used to reduce resource fragmentation on the first server. The total resource value can include two or three values. When the total resource value includes two values, the two values can be any two combinations of the total number of CPU cores of the instance, the total memory value of the instance, and the total disk size of the instance. When the total resource value includes three values, the three values include the total number of CPU cores of the instance, the total memory value of the instance, and the total disk size of the instance. The resource values of created instances correspond to the total resource values. That is, when the total resource values include the total memory and disk size of all instances, the resource values of created instances include the total disk size and memory of all created instances. For ease of understanding, let's assume that the resource values of created instances include the total number of CPU cores and memory of all created instances, and the total resource values include the total number of CPU cores and memory of all instances. Other scenarios can be described in the same way as this scenario.
[0086] Specifically, the first condition being that the values of various resources and the total resource value satisfy the first condition means that the first coordinates H, K are within the first region, where H is the total number of CPU cores of the created instances, K is the total memory value of the created instances, the first region is composed of a first line, a second line, a third line, and a fourth line. The first line passes through the origin with a slope of 'a', the second line passes through the origin with a slope of 'b', the third line passes through the second coordinates Z, M with a slope of 'a', and the fourth line passes through the second coordinates with a slope of 'b'. Z is the total number of CPU cores of the first server, M is the total memory value of the first server, the total resource value includes the total number of CPU cores and the total memory value, 'a' is the reciprocal of the minimum CPU-to-memory ratio of instances that can be created on the first server, and 'b' is the reciprocal of the maximum CPU-to-memory ratio of instances that can be created on the first server. Please refer to [link / reference].] Figure 5 , Figure 5 This is a schematic diagram of the structure of the first region in an embodiment of this application. Figure 5 In the diagram, the horizontal axis represents the number of CPU cores, and the vertical axis represents the memory value. The four sides of the first region are line 501, line 502, line 503, and line 504. Assume the total number of CPU cores in the instances is 100, and the total memory value of the instances is 320GB. The second coordinate is (100, 320). Continuing the assumption from step 402 that the first server can provide three types of instances, type 1 has a CPU-to-memory ratio of 1 / 2, type 2 has a CPU-to-memory ratio of 1 / 3, and type 3 has a CPU-to-memory ratio of 1 / 4. Therefore, the slopes of lines 501 and 503 are 4, and the slopes of lines 502 and 504 are 2. Type 3 instances have 2 cores and 4GB of memory, with an oversubscription ratio of 2. Therefore, the CPU-to-memory ratio for type 3 is 2 ÷ 4 ÷ 2 = 1 / 4. After determining the first region, it is determined whether the first coordinate (H, K) is within the first region. If it is, then the values of various resources of the instances already created in the first server satisfy the first condition, for example, coordinate point 505 is within the first region. If not, then the values of various resources of the instances already created in the first server do not satisfy the first condition. It should be noted that when the first coordinate (H, K) is on the edge of the first region, that is, when the first coordinate (H, K) is on the first line 501, the second line 502, the third line 503, and the fourth line 504, it is also considered that the first coordinate (H, K) is within the first region, for example, coordinate point 506 is within the first region. H is the total number of CPU cores of the created instances (including the number of CPU cores required by the first instance), and K is the total memory value of the created instances (including the memory value required by the first instance).
[0087] If the first coordinate (H,K) is within the first region, it means that the first server has not yet generated resource fragmentation. If all subsequent instances created by the first server satisfy the first condition, the first server will not generate resource fragmentation, meaning that the future first coordinate (H,K) and second coordinate (100,320) will coincide. Even if the future first coordinate (H,K) and second coordinate (100,320) do not coincide, they can be kept as close as possible to reduce the number of resource fragments in the first server. If the first coordinates H,K are outside the first region, it means that resource fragmentation will definitely occur. Therefore, by restricting the first coordinates H,K to be within the first region, the generation of resource fragmentation on the first server can be reduced or avoided, improving resource utilization.
[0088] Regarding the judgment methods for content a and content b above, the resource management device can use one or both. When using both, the number of dedicated instance CPU cores plus F must be less than or equal to the total number of dedicated instance CPU cores, the number of instance CPU cores plus F must be less than or equal to the total number of instance CPU cores, and the values of various resources of the instances created in the first server must satisfy the first condition. Only then can the resource management device determine that the remaining resources of the first server are greater than or equal to the resources required by the first instance.
[0089] In step 404, the resource management device sends a first command to the first server.
[0090] In step 403 above, if the resource management device determines that the remaining resources of the first server are greater than or equal to the resources required by the first instance, the resource management device sends a first command to the first server.
[0091] In step 405, the first server creates a first instance according to the first command. The first server also creates a second instance, and the oversold ratio of the second instance is different from that of the first instance.
[0092] The first server allocates the resources required for the first instance and binds these resources to the user, subsequently providing cloud services to that user. For example, the first instance is a dedicated instance with 1 core, 2GB of RAM, and 40GB of storage. The first server needs to allocate one CPU core, 2GB of RAM, and 40GB of hard drive space, and these resources should not be shared with other instances.
[0093] In other embodiments, if the first instance is a dedicated instance and the second instance is a shared instance, and the first instance is bound to the first CPU in the first server, when the first instance is deleted or idle, the bound core range of the second instance still includes the first CPU, provided that the original bound core range of the shared instance remains unchanged. Figure 6 As shown, Figure 6This is a schematic diagram illustrating the structure of the bound core range for shared instances in this embodiment. 6a shows the bound core range before deleting the first instance. The first server includes CPU cores 1 to 5, where CPU cores 1 and 2 are bound to dedicated instances and are referred to as dedicated CPU cores. CPU core 2 is bound to the first instance, making the first instance a dedicated instance with one core. CPU cores 3, 4, and 5 are bound to shared instances, including the second instance. After deleting the first instance, as shown in 6b, the bound core range for the second instance still includes CPU core 2, meaning the second instance can use CPU core 2. With the number of shared instances remaining unchanged, each shared instance can utilize one more CPU core, thus improving the performance of the shared instances and enhancing the user experience. Specifically, by pre-setting the total number of dedicated instance CPU cores and the total number of shared instance CPU cores, the performance improvement of the shared instances can be maximized. For example, if the total number of dedicated instance CPU cores is set to 70 and the total number of shared instance CPU cores to 50, the remaining 50 CPU cores are either idle or used by dedicated instances. Even if the remaining 50 CPU cores are all bound to their corresponding dedicated instances, as long as there are any dedicated instances available, the number of cores bound to shared instances can be increased, thus improving the performance of shared instances. Without setting a total number of dedicated instance CPU cores and a total number of shared instance CPU cores, all 99 cores of the first server might be bound to shared instances, resulting in a negligible performance improvement for shared instances.
[0094] The above describes the scenario of increasing the core binding range of a shared instance. If the core binding range of the shared instance is not increased, then the core binding range of the shared instance can change as the core binding range of the dedicated instance changes. For example... Figure 7 As shown, Figure 7 This is a schematic diagram of the core binding range without increasing the shared instance in this embodiment. 7a is a schematic diagram of the core binding range before deleting the first instance. 7a inherits the description of 6a above; based on this, after deleting the first instance, as shown... Figure 7 As shown in b, the core binding range of the shared instance is CPU core 2, CPU core 3 and CPU core 4, and the core binding range of the shared instance does not include CPU core 5.
[0095] In other embodiments, instances with different oversubscription ratios may be deployed on a single service, meaning that shared instances with different oversubscription ratios may appear on the same server simultaneously. For example, if the first instance and the second instance are shared instances with different oversubscription ratios, and the first instance and the second instance compete for CPU resources on the first server, it would be unfair to the first instance if the first instance and the second instance obtain the same amount of CPU resources. Therefore, shared instances with different oversubscription ratios need to have thread scheduling priorities corresponding to their oversubscription ratios. That is, the scheduling priority ratio of instances with different oversubscription ratios is the reciprocal of the oversubscription ratio. The first server can define the scheduling priority of different shared instances (the share they occupy during competition) by setting a share value. The share value is a dimensionless absolute value (representing the instance's time slice share in CPU thread scheduling). The first server determines the scheduling priority of the virtual machines corresponding to different instances for CPU resources by comparing the share values of different instances. In the case of mixed deployment of instances with different oversubscription ratios, setting different share values for the mixed instances ensures that instances with different oversubscription ratios have competition priorities corresponding to their oversubscription ratios. For example, if the oversubscription ratios of the first instance, the second instance, and the third instance are L, m, and n respectively, then the share value of the first instance is vcpus1×(L×m×n)×1024 / L=vcpus1×m×n×1024; the share value of the second instance is vcpus2×(L×m×n)×1024 / m=vcpus2×L× The share value of the third instance is vcpus3×(L×m×n)×1024 / n=vcpus3×L×m×1024. Here, vcpus is the number of CPU cores used by the virtual machine. Taking the instance type in step 402 above as an example, when the first instance is a type 3 instance, vcpus3 is 2. The share value of each instance can be used to calculate the average CPU share allocated to each virtual machine. The computing power of the average CPU share for different instances is guaranteed by the server. When the server CPU resources are idle, there is no CPU resource competition between shared instances. At this time, each CPU in shared instances with different super-share ratios can occupy up to 100% of the physical CPU on top of its own average share (depending on the commercial design of the instance, the computing power exceeding the baseline share can be charged additionally). However, when there is CPU resource competition between shared instances, the KVM virtual machine monitor can control the CPU scheduling priority of different instances through the share value (the higher the share value, the higher the proportion of physical CPU resources occupied by the instance).
[0096] To facilitate the management of instances on the primary server, the total number of dedicated instance CPU cores and the total number of shared instance CPU cores can be configured in the resource management console. The resource management console can be the resource management device mentioned above, or other computer devices. Figure 8 As shown, Figure 8 This is a schematic diagram of the configuration interface displayed in the resource management console in this application example. Figure 8 The configuration includes options for a mixed deployment pool and a normal pool. A mixed deployment pool refers to using the first server to create both dedicated and shared instances. A normal pool refers to using the first server to create either dedicated or shared instances. When selecting a mixed deployment pool, you can configure the total number of dedicated instance CPU cores and the total number of shared instance CPU cores. For example, you can set the total number of dedicated instance CPU cores to 70 and the total number of shared instance CPU cores to 50. Clicking "OK" will save the configuration for later execution.
[0097] To facilitate monitoring of instances on the primary server, you can display the usage of different similar resources in the resource management console. Please refer to... Figure 9 As shown, Figure 9 This is a schematic diagram of the monitoring interface displayed in the resource management console in this application example. Figure 9 The data includes instance type, CPU-to-memory ratio, oversubscription ratio, CPU core utilization, etc., with different types of instances listed separately. For example, different types of instances include Type 1, Type 2, and Type 3 instances, and the descriptions of Type 1, Type 2, and Type 3 are inherited from the description in step 402 above. A CPU core utilization of 30% means that all Type 1 instances are using 30% of the CPU resources on the first server.
[0098] The resource management method in the embodiments of this application has been described above. The resource management device in the embodiments of this application is described below. Please refer to [link / reference]. Figure 10 , Figure 10 This is a schematic diagram of the resource management device in an embodiment of this application.
[0099] The device includes: an acquisition module 1001, used to acquire the remaining resource information of the first server;
[0100] The sending module 1002 is used to send a first command to the first server if the remaining resource information indicates that the remaining resources of the first server are greater than or equal to the resources required by the first instance. The first command is used to instruct the first server to create a first instance according to the first command. The first server also creates a second instance, and the oversold ratio of the second instance is different from that of the first instance.
[0101] In other embodiments, the modules in the device are specifically used to perform the aforementioned... Figure 4 The resource management device in the corresponding embodiment can perform all or part of the operations.
[0102] Please see Figure 11 , Figure 11 This is another structural schematic diagram of the resource management device in the embodiments of this application.
[0103] The device includes: a receiving module 1101, used to receive a first command sent by a first resource management device;
[0104] The creation module 1102 is used to create a first instance according to a first command. The first command is obtained by the resource management device based on the remaining resource information. The remaining resource information indicates that the remaining resources of the first server are greater than or equal to the resources required by the first instance. The first server also creates a second instance, and the oversold ratio of the second instance is different from that of the first instance.
[0105] In other embodiments, the modules in the device are specifically used to perform the aforementioned... Figure 4 The first server in the corresponding embodiment can perform all or part of the operations.
[0106] The resource management device in the embodiments of this application has been described above. The resource management equipment and the first server in the embodiments of this application are described below.
[0107] Please see Figure 12 , Figure 12 This is a schematic diagram of the structure of the resource management device or the first server in the embodiments of this application.
[0108] like Figure 12 As shown, the resource management device or first server 1200 includes a processor 1210 and a transceiver 1220 coupled to the processor 1210. The processor 1210 may be a central processing unit (CPU), a network processor (NP), or a combination of a CPU and an NP. The processor may also be an application-specific integrated circuit (ASIC), a programmable logic device (PLD), or a combination thereof. The PLD may be a complex programmable logic device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL), or any combination thereof. The processor 1210 may refer to a single processor or may include multiple processors.
[0109] In other embodiments, the resource management device or the first server 1200 further includes memory, which may include volatile memory, such as random-access memory (RAM); the memory may also include non-volatile memory, such as read-only memory (ROM), FRAM memory, flash memory, hard disk drive (HDD), or solid-state drive (SSD); the memory may also include combinations of the above types of memory.
[0110] when Figure 12 When it is a structural diagram of resource management equipment:
[0111] Processor 1210 is used to obtain information about the remaining resources of the first server;
[0112] The transceiver 1220 is used to send a first command to the first server if the remaining resource information indicates that the remaining resources of the first server are greater than or equal to the resources required by the first instance. The first command is used to instruct the first server to create a first instance according to the first command. The first server also creates a second instance, and the oversold ratio of the second instance is different from that of the first instance.
[0113] In other embodiments, the processor 1210 is further configured to execute computer-readable instructions in memory, and then, according to the instructions of the computer-readable instructions, perform all or part of the operations that the resource management device can perform, such as when the resource management device interacts with... Figure 4 The operations performed in the corresponding embodiments.
[0114] when Figure 12 When it is a schematic diagram of the first server structure:
[0115] Transceiver 1220 is used to receive the first command sent by the first resource management device;
[0116] The processor 1210 is used to create a first instance according to a first command, which is obtained by the resource management device based on the remaining resource information. The remaining resource information indicates that the remaining resources of the first server are greater than or equal to the resources required by the first instance. The first server also creates a second instance, which has a different oversold ratio than the first instance.
[0117] In other embodiments, the processor 1210 is further configured to execute computer-readable instructions in memory, and then, according to the instructions of the computer-readable instructions, perform all or part of the operations that the first server can perform, such as when the first server is in contact with... Figure 4 The operations performed in the corresponding embodiments.
[0118] In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection between apparatuses or units through some interfaces, and may be electrical, mechanical, or other forms.
[0119] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0120] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0121] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as flash drives, portable hard drives, ROM, RAM, magnetic disks, or optical disks.
Claims
1. A resource management method, characterized in that, include: The resource management device obtains the remaining resource information of the first server; If the remaining resource information indicates that the remaining resources of the first server are greater than or equal to the resources required by the first instance, then the resource management device sends a first command to the first server. The first command is used to instruct the first server to create the first instance according to the first command. The first server also creates a second instance, and the oversold ratio of the second instance is different from that of the first instance. If the remaining resource information indicates that the remaining resources of the first server are greater than or equal to the resources required by the first instance, then the resource management device sends a first command to the first server, which includes: if after the first server creates the first instance, the values of various resources of the instances already created in the first server and the total resource value satisfy a first condition, then the resource management device sends the first command to the first server, and the first condition is used to reduce resource fragmentation of the first server. Wherein, the values of the various resources and the total resource value satisfy the first condition means that the first coordinates H, K are in the first region, where H is the total number of CPU cores of the created instances, K is the total memory value of the created instances, the first region is composed of a first line, a second line, a third line and a fourth line, the first line is a line passing through the origin with a slope of a, the second line is a line passing through the origin with a slope of b, the third line is a line passing through the second coordinates Z, M with a slope of a, the fourth line is a line passing through the second coordinates with a slope of b, Z is the total number of CPU cores of the first server, M is the total memory value of the first server, the total resource value includes the total number of CPU cores and the total memory value, a is the reciprocal of the minimum CPU-to-memory ratio of the instances that can be created by the first server, and b is the reciprocal of the maximum CPU-to-memory ratio of the instances that can be created by the first server.
2. The method according to claim 1, characterized in that, The first instance is a dedicated instance, and the method further includes: The resource management device obtains the number of dedicated instance CPU cores created by the first server and the total number of dedicated instance CPU cores. If the remaining resource information indicates that the remaining resources of the first server are greater than the resources required by the first instance, then the resource management device sends a first command to the first server, including: If the number of dedicated instance CPU cores plus F is less than or equal to the total number of dedicated instance CPU cores, then the resource management device sends the first command to the first server, where F is the number of CPU cores required by the first instance.
3. The method according to claim 2, characterized in that, The method further includes: The resource management device obtains the number of CPU cores of the created instances of the first server, and the total number of CPU cores of the instances; If the number of dedicated instance CPU cores plus F is less than or equal to the total number of dedicated instance CPU cores, then the resource management device sends the first command to the first server, including: If the number of dedicated instance CPU cores plus F is less than or equal to the total number of dedicated instance CPU cores, and the number of dedicated instance CPU cores plus F is less than or equal to the total number of instance CPU cores, then the resource management device sends the first command to the first server.
4. The method according to any one of claims 1 to 3, characterized in that, The first instance is a dedicated instance, and the second instance is a shared instance. The first instance is bound to the first CPU in the first server. When the first instance is deleted or idle, the bound core range of the second instance also includes the first CPU.
5. The method according to claim 1, characterized in that, The first instance and the second instance are shared instances. When the shared instances in the first server compete for CPU resources in the first server, the ratio of the scheduling priority of the first instance and the second instance competing for the CPU resources is K / J, where K is the oversubscription ratio of the second instance and J is the oversubscription ratio of the first instance.
6. A resource management device, characterized in that, include: The acquisition module is used to obtain the remaining resource information of the first server; The sending module is configured to send a first command to the first server if the remaining resource information indicates that the remaining resources of the first server are greater than or equal to the resources required by the first instance. The first command is used to instruct the first server to create the first instance according to the first command. The first server also creates a second instance, the oversold ratio of which is different from that of the first instance. The sending module is specifically used to send the first command to the first server if, after the first server creates the first instance, the values of various resources of the instances already created in the first server and the total resource value meet a first condition. The first condition is used to reduce resource fragmentation of the first server. Wherein, the values of the various resources and the total resource value satisfy the first condition means that the first coordinates H, K are in the first region, where H is the total number of CPU cores of the created instances, K is the total memory value of the created instances, the first region is composed of a first line, a second line, a third line and a fourth line, the first line is a line passing through the origin with a slope of a, the second line is a line passing through the origin with a slope of b, the third line is a line passing through the second coordinates Z, M with a slope of a, the fourth line is a line passing through the second coordinates with a slope of b, Z is the total number of CPU cores of the first server, M is the total memory value of the first server, the total resource value includes the total number of CPU cores and the total memory value, a is the reciprocal of the minimum CPU-to-memory ratio of the instances that can be created by the first server, and b is the reciprocal of the maximum CPU-to-memory ratio of the instances that can be created by the first server.
7. The apparatus according to claim 6, characterized in that, The first instance is a dedicated instance, and the acquisition module is further used to acquire the number of CPU cores of the dedicated instances created by the first server, and the total number of dedicated instance CPU cores. The sending module is specifically used to send the first command to the first server if the number of CPU cores of the created dedicated instance plus F is less than or equal to the total number of CPU cores of the dedicated instance, where F is the number of CPU cores required by the first instance.
8. The apparatus according to claim 7, characterized in that, The acquisition module is further configured to acquire the number of created instance CPU cores and the total number of instance CPU cores of the first server; the sending module is specifically configured to send the first command to the first server if the number of created dedicated instance CPU cores plus F is less than or equal to the total number of dedicated instance CPU cores, and the number of created instance CPU cores plus F is less than or equal to the total number of instance CPU cores.
9. The apparatus according to any one of claims 6 to 8, characterized in that, The first instance is a dedicated instance, and the second instance is a shared instance. The first instance is bound to the first CPU in the first server. When the first instance is deleted or idle, the bound core range of the second instance also includes the first CPU.
10. The apparatus according to claim 6, characterized in that, The first instance and the second instance are shared instances. When the shared instances in the first server compete for CPU resources in the first server, the ratio of the scheduling priority of the first instance and the second instance competing for the CPU resources is K / J, where K is the oversubscription ratio of the second instance and J is the oversubscription ratio of the first instance.
11. A resource management device, characterized in that, Includes processor and transceiver. The processor is used to obtain the remaining resource information of the first server; The transceiver is configured to send a first command to the first server if the remaining resource information indicates that the remaining resources of the first server are greater than or equal to the resources required by the first instance. The first command is configured to instruct the first server to create the first instance according to the first command. The first server also creates a second instance, the oversold ratio of which is different from that of the first instance. The transceiver is specifically used to send the first command to the first server if, after the first server creates the first instance, the values of various resources of the instances already created in the first server and the total resource value meet a first condition. The first condition is used to reduce resource fragmentation of the first server. Wherein, the values of the various resources and the total resource value satisfy the first condition means that the first coordinates H, K are in the first region, where H is the total number of CPU cores of the created instances, K is the total memory value of the created instances, the first region is composed of a first line, a second line, a third line and a fourth line, the first line is a line passing through the origin with a slope of a, the second line is a line passing through the origin with a slope of b, the third line is a line passing through the second coordinates Z, M with a slope of a, the fourth line is a line passing through the second coordinates with a slope of b, Z is the total number of CPU cores of the first server, M is the total memory value of the first server, the total resource value includes the total number of CPU cores and the total memory value, a is the reciprocal of the minimum CPU-to-memory ratio of the instances that can be created by the first server, and b is the reciprocal of the maximum CPU-to-memory ratio of the instances that can be created by the first server.
12. A computer storage medium, characterized in that, The computer storage medium stores instructions that, when executed on the computer, cause the computer to perform the method as described in any one of claims 1 to 5.
13. A computer program product, characterized in that, When the computer program product is executed on a computer, it causes the computer to perform the method as described in any one of claims 1 to 5.
Citation Information
Patent Citations
Method and device for regulating cloud computing resources
CN107040479A