Resource configuration method, device, electronic device and storage medium
By obtaining the shutdown duration and resource utilization data of the cloud host, determining the target cloud host and adjusting its resource configuration, the problem of uneven resource utilization in the virtualized private cloud is solved, and efficient resource utilization and waste reduction are achieved.
Patent Information
- Application Number
- CN202211007272.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-08-22
- Publication Date
- 2024-09-03
- Estimated Expiration
- 2042-08-22
AI Technical Summary
In a virtualized private cloud environment, the utilization of cloud resources is uneven, resulting in insufficient resources or excess resources, resulting in resource waste.
By obtaining the sampling data of cloud host shutdown duration and resource utilization, the target cloud host that meets the preset conditions is determined, and the resource configuration is flexibly adjusted according to its usage to achieve resource recycling or expansion.
It improves the utilization of cloud resources, reduces resource waste, and improves overall resource efficiency.
Smart Images

Figure CN115529241B
Abstract
Description
Technical Field
[0001] The present application belongs to the field of Internet technology, and in particular, relates to a resource configuration method, device, electronic device and storage medium. Background Art
[0002] With the development of information technology, cloud computing technology is becoming more and more mature, and more and more enterprises and individuals are deploying their businesses to virtualized private clouds. The cloud resources of virtualized private clouds undertake a large number of business computing tasks.
[0003] At present, due to the rapid development of business types and quantities, in actual use, the resource utilization of cloud resources of various cloud hosts is different, and there are situations of insufficient resources or excessive resources, resulting in low resource utilization or resource waste. Summary of the invention
[0004] The embodiments of the present application provide a resource configuration method, apparatus, device and storage medium, which can solve the current problems of low resource utilization or resource waste.
[0005] In a first aspect, an embodiment of the present application provides a resource configuration method, the method comprising:
[0006] Acquire sampling data of the cloud host in a preset time period, the sampling data at least including: shutdown duration of the cloud host and resource utilization rate of the cloud host;
[0007] According to the sampled data, a target cloud host that meets the preset conditions is determined from the cloud hosts;
[0008] The resource configuration information of the target cloud host is determined based on the sampled data, and the resource configuration information is used to configure the cloud resources of the target cloud host.
[0009] In a second aspect, an embodiment of the present application provides a resource configuration device, the resource configuration device comprising:
[0010] An acquisition module is used to acquire sampling data of the cloud host in a preset time period, and the sampling data at least includes: shutdown time of the cloud host and resource utilization rate of the cloud host;
[0011] A first determination module is used to determine a target cloud host that meets a preset condition from the cloud hosts according to the sampled data;
[0012] The second determination module is used to determine resource configuration information of the target cloud host according to the sampling data, and the resource configuration information is used to configure the cloud resources of the target cloud host.
[0013] In a third aspect, an embodiment of the present application provides an electronic device, comprising: a processor and a memory storing computer program instructions; when the processor executes the computer program instructions, it implements the method in the first aspect or any possible implementation of the first aspect.
[0014] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium having computer program instructions stored thereon. When the computer program instructions are executed by a processor, the method in the first aspect or any possible implementation of the first aspect is implemented.
[0015] In the embodiment of the present application, by obtaining the sampling data of the cloud host in a preset time period, the sampling data at least includes: the shutdown time of the cloud host and the resource utilization rate of the cloud host. Here, the sampling data can characterize the usage of the cloud host in the preset time period, so the target cloud host that meets the preset conditions can be determined from the cloud hosts according to the sampling data. The target cloud host is the cloud host whose resource configuration needs to be adjusted. Finally, the resource configuration information of the target cloud host is determined according to the sampling data. The resource configuration information can be flexibly specified for the target cloud host according to the usage of different target cloud hosts, so as to configure the cloud resources of the target cloud host according to the resource configuration information, that is, the resources of a part of the target cloud hosts can be recycled, and the resources of another part of the cloud hosts can be expanded, thereby improving the resource efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] In order to more clearly illustrate the technical solution of the embodiments of the present application, the following is a brief introduction to the drawings required for use in the embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0017] Figure 1 is a flow chart of a resource configuration method provided in an embodiment of the present application;
[0018] Figure 2 is a flow chart of a method for implementing resource configuration provided by an embodiment of the present application;
[0019] Figure 3 It is a structural diagram of a resource configuration device provided in an embodiment of the present application;
[0020] Figure 4 It is a schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0021] The features and exemplary embodiments of various aspects of the present application will be described in detail below. In order to make the purpose, technical solutions and advantages of the present application clearer, the present application will be further described in detail below in conjunction with the accompanying drawings and specific embodiments. It should be understood that the specific embodiments described herein are only configured to explain the present application and are not configured to limit the present application. For those skilled in the art, the present application can be implemented without the need for some of these specific details. The following description of the embodiments is only to provide a better understanding of the present application by illustrating the examples of the present application.
[0022] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the statement "include..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0023] The following is a brief introduction to the technical terms involved in this application.
[0024] Virtual Private Cloud (VPC) builds an isolated, user-configured and managed virtual network environment for elastic cloud servers, improves the security of user cloud resources, and simplifies user network deployment. A virtual private cloud is a dynamically configured pool of public cloud computing resources that requires the use of encryption protocols, tunneling protocols, and other security procedures to transmit data between private enterprises and cloud service providers. A VPC basically turns the provider's multi-tenant architecture into a single-tenant architecture.
[0025] Cloud resources, or cloud computing resources, refer to the integration of cloud computing-related resource websites, mainly including cloud computing portals, forums, and blog-related websites. Cloud hosts are an important part of cloud computing in infrastructure applications, located at the bottom of the cloud computing industry chain pyramid, and products are derived from cloud computing platforms. The platform integrates the three core elements of Internet applications: computing, storage, and network, and provides public Internet infrastructure services to users.
[0026] Cloud hosting is a virtualization technology similar to Virtual Private Server (VPS) hosting. VPS hosting uses virtual software to create multiple parts similar to independent hosts on a single host, which can realize multiple users on a single machine. Each part can have a separate operating system and the management method is the same as the host.
[0027] The central processing unit (CPU), as the computing and control core of the computer system, is the final execution unit for information processing and program running.
[0028] CPU utilization is the CPU resources occupied by running programs, indicating the running of programs in a certain period of time. The higher the CPU utilization, the more programs are running in this period of time, and vice versa.
[0029] Memory utilization refers to the utilization of the memory bank. Memory utilization can be the ratio of the amount of memory used to the total amount of memory.
[0030] Disk refers to a storage device that uses magnetic recording technology to store data. Disk is the main storage medium of computers. It can store a large amount of binary data and keep the data intact even after a power outage. Disk utilization can refer to the ratio of the amount of space already used to the total space on the disk.
[0031] A cluster is a service form that is connected by a set of loosely integrated computer software and / or hardware to complete computing work in a highly collaborative manner. In layman's terms, it is to bring several servers together to implement the same business. When a machine fails, it will not affect the execution of other servers. The characteristic of a cluster is that it can perform functions together. It can refer to a database cluster or a cache cluster. The services provided by the cluster are consistent. The cluster is more complex than a single machine deployment, and the cluster shares the same address.
[0032] A cluster node is equivalent to a server in the cluster. A stand-alone machine is equivalent to an interface machine.
[0033] The resource configuration method provided in the embodiment of the present application can be applied to at least the following application scenarios, which are described below.
[0034] From the perspective of the overall cloud resource utilization of virtualized private clouds, the overall cloud resource utilization is uneven, with problems of insufficient or excessive resources. Some clusters have too high memory and disk utilization, while others have too low memory and disk utilization.
[0035] From the perspective of resource utilization at the cloud host level. With the increase in cloud platforms, there are problems with the utilization of cloud hosts for some cloud services. Among them, the source of resource allocation demand for virtualized private cloud cloud resource pools is mainly the needs of business departments, especially for new platforms, some of which have too many resources applied for in the early stage. The main resources of some cloud hosts have been at a low utilization rate for a long time. As the business grows, resource consumption increases, and the original allocated resources are insufficient. In addition, there is a high concurrency during holidays and marketing activities, which makes it impossible to effectively ensure the normal and stable operation of the business.
[0036] Figure 1 It is a flowchart of a resource configuration method provided in an embodiment of the present application.
[0037] like Figure 1 As shown, the resource configuration method may include steps 110 to 130, and the method is applied to a resource configuration device, as shown below:
[0038] Step 110, obtaining sampling data of the cloud host in a preset time period, the sampling data at least including: shutdown duration of the cloud host and resource utilization of the cloud host.
[0039] Step 120: Determine a target cloud host that meets preset conditions from the cloud hosts based on the sampled data.
[0040] Step 130, determining resource configuration information of the target cloud host based on the sampled data, where the resource configuration information is used to perform resource configuration on the target cloud host.
[0041] In the embodiment of the present application, by obtaining the sampling data of the cloud host in a preset time period, the sampling data at least includes: the shutdown time of the cloud host and the resource utilization rate of the cloud host. Here, the sampling data can characterize the usage of the cloud host in the preset time period, so the target cloud host that meets the preset conditions can be determined from the cloud hosts according to the sampling data. The target cloud host is the cloud host whose resource configuration needs to be adjusted. Finally, the resource configuration information of the target cloud host is determined according to the sampling data. The resource configuration information can be flexibly specified for the target cloud host according to the usage of different target cloud hosts, so as to configure the cloud resources of the target cloud host according to the resource configuration information, that is, the resources of a part of the target cloud hosts can be recycled, and the resources of another part of the cloud hosts can be expanded, thereby improving the resource efficiency.
[0042] The contents of step 110 to step 130 are described below respectively:
[0043] This involves step 110 .
[0044] The sampling data of the cloud host in a preset time period is obtained, and the sampling data at least includes: the shutdown time of the cloud host and the resource utilization rate of the cloud host.
[0045] The resource utilizations mentioned above may include: central processing unit (CPU) utilization, memory utilization and disk utilization.
[0046] The shutdown duration of the cloud host, which refers to the length of time the cloud host is in the shutdown state.
[0047] The CPU utilization is used to indicate the ratio of CPU usage to the total CPU volume (CPU unit: MHz, CPU utilization unit: %).
[0048] Memory utilization, which is used to indicate the ratio of memory usage to total memory. (Memory unit: GB, memory utilization unit: %).
[0049] Disk utilization is used to indicate the ratio of disk usage to total disk capacity. (Disk unit: GB, disk utilization unit: %).
[0050] This involves step 120 .
[0051] According to the sampled data, a target cloud host that meets the preset conditions is determined from the cloud hosts.
[0052] The preset conditions include recycling conditions and expansion conditions, and the target cloud hosts include: a first cloud host that meets the recycling conditions, and a second cloud host that meets the expansion conditions. The following are respectively described:
[0053] In a possible embodiment, the preset time period includes a first time period and a second time period. Step 120 may specifically include the following steps:
[0054] Determine, based on the sampled data, a first average value of the resource utilization rate in a first time period and a second average value of the resource utilization rate in a second time period;
[0055] Determining a first cloud host that meets a recycling condition from the cloud hosts according to the first average value and the second average value;
[0056] Determining a second cloud host that meets the capacity expansion condition from the cloud hosts according to the first average value and the second average value;
[0057] The start time of the first time period is later than the start time of the second time period.
[0058] The first time period corresponds to a first duration, the second time period corresponds to a second duration, and the second duration may be a preset multiple of the first duration.
[0059] The first average value includes: an average value of CPU utilization, an average value of memory utilization, and an average value of disk utilization in the first time period. The second average value includes: an average value of CPU utilization, an average value of memory utilization, and an average value of disk utilization in the second time period.
[0060] The first time period may be the third month, and the second time period may be from the first month to the second month. The first time period corresponding to the first time period is one month, and the second time period corresponding to the second time period is two months, which is twice the first time period, that is, the preset multiple is twice.
[0061] The recycling condition is used to select the first cloud host with excess resources, that is, the resources of the first cloud host need to be recycled, and the expansion condition is used to select the second cloud host with insufficient resources, that is, the resources of the second cloud host need to be expanded.
[0062] In a possible embodiment, before the above-mentioned step of determining a first cloud host that meets the recycling condition from the cloud hosts according to the first average value and the second average value, the following steps may also be included:
[0063] Get the node type and preset recycling conditions of the cloud host;
[0064] Determine the recycling condition according to the node type of the cloud host and the preset recycling condition; wherein the preset recycling condition includes any one of the following:
[0065] The shutdown duration is greater than the first threshold;
[0066] The first average value is less than a second threshold value;
[0067] The second average value is in the first interval, the lower limit value of the first interval is the second threshold value, and the upper limit value of the first interval is the third threshold value.
[0068] Among them, the node types include: stand-alone and cluster nodes.
[0069] A single machine is a common cloud host. Cluster nodes can include database cluster nodes and cache cluster nodes.
[0070] Among them, the preset recycling conditions include multiple condition parameters, such as a first threshold, a second threshold and a third threshold, etc. The recycling conditions are determined according to the node type of the cloud host and the preset recycling conditions. Specifically, the condition parameters in the preset recycling conditions are assigned values according to the node type of the cloud host to obtain the recycling conditions.
[0071] Here, by determining the recycling conditions according to the node type of the cloud host and the preset recycling conditions, the node type of the cloud host is fully considered, and the recycling conditions corresponding to different types of cloud hosts are flexibly determined.
[0072] By recording the shutdown duration, when the shutdown duration of the cloud host is greater than a first threshold, the cloud host is determined as the first cloud host.
[0073] In addition, if the preset time period only includes the first time period, the preset recycling condition includes any one of the following: the shutdown time is greater than the first threshold; the first average value is less than the second threshold. That is, when the sampling data is collected for the first time, only the sampling data of the first time period is collected, and only the current sampling data of the first time period is judged whether it meets the condition that the shutdown time is greater than the first threshold, or whether the sampling data of the first time period meets the condition that the first average value is less than the second threshold.
[0074] Wherein, when the node type is a single machine, the first threshold is A, the second threshold is M%, the third threshold is N%, the first preset multiple is C;
[0075] For example, A is three months, M is 10, N is 15, and C is 2.
[0076] That is, when the node type is a single machine, the recycling conditions include any of the following:
[0077] The shutdown time is longer than three months;
[0078] A first average value in a first time period is less than 10;
[0079] The second average value in the second time period is located in the first interval, the lower limit value of the first interval is 10, and the upper limit value of the first interval is 15.
[0080] When the node type is a cluster node, the first threshold is B, the second threshold is P%, the third threshold is Q%, and the first preset multiple is D;
[0081] For example, B is six months, M is 20, N is 25, and C is 3.
[0082] That is, when the node type is a single machine, the recycling conditions include any of the following:
[0083] The shutdown time is longer than six months;
[0084] A first average value in a first time period is less than 20;
[0085] The second average value in the second time period is located in the first interval, the lower limit value of the first interval is 20, and the upper limit value of the first interval is 25.
[0086] Among them, A, B, M, N, P, Q, C and D are all non-negative numbers, P is greater than M, Q is greater than N, and D is greater than C.
[0087] In a possible embodiment, before the above-mentioned step of determining a second cloud host that meets the capacity expansion condition from the cloud hosts according to the first average value and the second average value, the following steps may also be included:
[0088] Get the node type and preset expansion conditions of the cloud host;
[0089] Determine the expansion condition according to the node type of the cloud host and the preset expansion condition; wherein the preset expansion condition includes any one of the following:
[0090] The first average value is greater than a fourth threshold;
[0091] The second average value is in the second interval, the lower limit value of the second interval is the fifth threshold value, and the upper limit value of the first interval is the fourth threshold value.
[0092] Among them, the preset expansion conditions include multiple condition parameters, such as the fourth threshold and the fifth threshold. The expansion conditions are determined according to the node type of the cloud host and the preset expansion conditions. Specifically, the condition parameters in the preset expansion conditions are assigned values according to the node type of the cloud host to obtain the expansion conditions.
[0093] Here, by determining the expansion conditions according to the node type of the cloud host and the preset expansion conditions, the node type of the cloud host is fully considered, and the expansion conditions corresponding to different types of cloud hosts are flexibly determined.
[0094] In addition, if the preset time period only includes the first time period, the preset expansion condition includes: the first average value is less than the second threshold value. That is, when the sampling data is collected for the first time, only the sampling data of the first time period is collected, and only the sampling data of the current first time period is judged whether it meets the condition that the first average value is less than the second threshold value.
[0095] Wherein, when the node type is a single machine, the fourth threshold is T%, the fifth threshold is U%, and the first preset multiple is C;
[0096] For example, U is 30, T is 70, and C is 2.
[0097] That is, when the node type is a single machine, the recycling conditions include any of the following:
[0098] The shutdown time is longer than three months;
[0099] A first average value in a first time period is greater than 70;
[0100] The second average value in the second time period is located in the first interval, the lower limit value of the first interval is 30, and the upper limit value of the first interval is 70.
[0101] When the node type is a cluster node, the fourth threshold is S%, the fifth threshold is R%, and the first preset multiple is D;
[0102] Among them, T, R, S, and U are non-negative numbers, R is greater than U, S is greater than T, and D is greater than C.
[0103] Among them, S can be greater than 50.
[0104] For example, R is 40, S is 80, and D is 3.
[0105] That is, when the node type is a cluster node, the recycling condition includes any of the following:
[0106] The shutdown time is longer than six months;
[0107] A first average value in a first time period is greater than 80;
[0108] The second average value in the second time period is located in the second interval, the lower limit value of the first interval is 40, and the upper limit value of the first interval is 80.
[0109] Here, the cluster node has a higher requirement for stability, so the fourth and fifth thresholds of the cluster node are set higher than those of a single machine. Thus, the premise of stable operation of the business is fully considered while avoiding excessive expansion. This involves step 130.
[0110] Step 130, determining resource configuration information of the target cloud host based on the sampled data, where the resource configuration information is used to perform resource configuration on the target cloud host.
[0111] In a possible embodiment, step 130 may specifically include the following steps:
[0112] Determine the initial resource configuration information of the target cloud host based on the sampled data; obtain the preset configuration information; and determine the resource configuration information from the initial resource configuration information based on the preset configuration information.
[0113] Among them, the preset configuration information involved above may be an implementation strategy given by industry experts. By determining the resource configuration information from the initial resource configuration information according to the preset configuration information, the resources of the cloud host can be adjusted more carefully to ensure the operational stability of the cloud host.
[0114] In a possible embodiment, the preset time period includes multiple preset time periods, and step 130 may specifically include the following steps:
[0115] Acquire sampling data in a first time period from the sampling data, where the first time period is one of a plurality of preset time periods, and the end time of the first time period is the latest of a plurality of end times corresponding to the plurality of preset time periods;
[0116] Determine the maximum value of resource utilization according to the sampling data in the first time period;
[0117] Determine the reclaimed resources of the first cloud host according to the sampling data and the maximum value of the resource utilization rate;
[0118] Determine the expansion resources for the second cloud host based on the sampled data.
[0119] The maximum resource utilization includes: a maximum CPU utilization, a maximum memory utilization, and a maximum disk utilization in the first time period.
[0120] The preset time period may include a first month, a second month and a third month. The first time period may be the third month, that is, the end time of the first time period is the latest of the end times corresponding to the multiple preset time periods.
[0121] Here, the recycling resources of the first cloud host are determined based on the sampling data and the maximum value of the resource utilization rate, which can fully consider the shutdown duration in the sampling data and the maximum value of the resource utilization rate corresponding to the business peak, avoiding excessive recycling of resources and affecting the normal operation of the business.
[0122] Therefore, by determining the reclaimed resources of the first cloud host according to the sampling data and the maximum value of the resource utilization rate, resource reclaim can be performed under the premise of ensuring stable operation of the business.
[0123] The cloud resource is a CPU resource or a memory resource. The above step of determining the reclaimed resource of the first cloud host according to the sampling data and the maximum value of the resource utilization rate may specifically include the following steps:
[0124] When the maximum value of the resource utilization rate is less than X%, Y% of the cloud resources of the first cloud host are determined as recycled resources;
[0125] When the maximum value of resource utilization is greater than or equal to X%, the resource to be recycled is determined according to the maximum value of resource utilization and the reserved value; wherein Y% is the sum of X% and the reserved value; X and Y are non-negative numbers;
[0126] When the recycled resources meet the first preset condition, the recycled resources are reset to 0.
[0127] When the cloud resources are CPU resources or memory resources, by judging the maximum value of resource utilization, different resource recovery determination methods are adopted for resource utilizations of different sizes, as follows:
[0128] Assume that X is 40%, the reserved value is 10%, and Y is the sum of X% and the reserved value, that is, Y is 50%.
[0129] For example, the maximum resource utilization is 38%, that is, when the maximum resource utilization is less than X%, Y% of the cloud resources of the first cloud host are determined as recycled resources, that is, Y% of the cloud resources are prepared to be recycled.
[0130] For example, the maximum value of resource utilization is 45%. According to the maximum value of resource utilization and the reserved value, the recovered resources are determined, which may specifically include: recovered resources = 1-(maximum value of resource utilization + reserved value), that is, recovered resources = 1-(45+10%) = 45%;
[0131] Here, by judging the maximum value of resource utilization, different methods of determining resource recovery are adopted. This is because resource guarantee during business peak is taken into consideration. The business peak corresponds to the maximum value of resource utilization, so that resource recovery will not affect business peak operation.
[0132] When the recycled resources meet the first preset condition, the recycled resources are reset to 0. Specifically, it may include:
[0133] When the recycled resources are less than the sixth threshold, the recycled resources are reset to 0;
[0134] When the CPU configuration value is 1CPU, the recycled resources are reset to 0;
[0135] When the memory configuration value is 2G, the recycled resources are reset to 0.
[0136] For example, the maximum value of resource utilization is 85%, and the recovered resources = 1-(85+10%) = 5%; the sixth threshold is 15%, that is, 5% is less than 15%, and the recovered resources are reset to 0.
[0137] In the recycling strategy, multiple factors that affect stable operation are comprehensively considered to avoid, such as: considering the appropriate recycling shutdown time, avoiding the shutdown time being too short so that the cloud host needs to be generated and enabled after recycling, and avoiding the shutdown time being too long and occupying resources.
[0138] Here, when the recovered resources meet the first preset condition, the recovered resources are reset to 0, so as to avoid the instability of business operation caused by the operation of recovering less resources.
[0139] The cloud resources include: CPU resources, memory resources and disk resources, and the sampled data also includes a disk space value. The above-mentioned step of determining the reclaimed resources of the first cloud host according to the maximum value of the sampled data and resource utilization rate may specifically include the following steps:
[0140] When the shutdown duration is greater than a first threshold, all cloud resources of the first cloud host are determined as recycled resources;
[0141] When the disk space value is greater than a preset value, Y% of the disk resources of the first cloud host are determined as reclaimed resources.
[0142] When the shutdown time is longer than the first threshold, all cloud resources of the first cloud host are determined as recycled resources. If the node type is a single machine, the first threshold is three months, and if the node type is a cluster node, the first threshold is six months.
[0143] If the disk space value is greater than a preset value (such as 100G), Y% of the disk resources of the first cloud host are determined as reclaimed resources.
[0144] Correspondingly, if the disk space value is less than or equal to 100G, the reclaimed resources will be reset to 0.
[0145] When the cloud resources are disk resources, since the disk is relatively stable, the reclaimed resources can be directly determined based on the disk space value, that is, when the disk space value is greater than a preset value, Y% of the disk resources of the first cloud host are determined as reclaimed resources.
[0146] In a possible embodiment, the above-mentioned step of determining the expansion resources of the second cloud host according to the sampled data may specifically include the following steps:
[0147] Determine Y% of the cloud resources of the second cloud host as the first expansion resources;
[0148] According to the node type and resource utilization type of the cloud host, the first expansion resource is adjusted to obtain the expansion resource.
[0149] When the node type is a single machine, determine the expansion parameters based on the type of resource utilization, including:
[0150] When the resource utilization type is CPU utilization, Y% of the cloud resources of the first cloud host are determined as the first expansion resources, the minimum expansion unit is 1 VCPU, and the total single expansion amount does not exceed 2 VCPU;
[0151] When the resource utilization type is memory utilization, Y% of the cloud resources of the first cloud host are determined as the first expansion resources, the minimum expansion unit is 1G, and the total single expansion amount does not exceed 2G
[0152] When the type of resource utilization is disk utilization, Y% of the cloud resources of the first cloud host are determined as first capacity expansion resources, and a single capacity expansion does not exceed 200G.
[0153] When the node type is a cluster node, determine the expansion parameters based on the type of resource utilization, including:
[0154] When the resource utilization type is CPU utilization, the minimum expansion unit is 2VCPU, and the total single expansion amount does not exceed 4VCPU;
[0155] When the resource utilization type is memory utilization, Y% of the cloud resources of the first cloud host are determined as the first expansion resources, the minimum expansion unit is 2G, and the total single expansion amount does not exceed 4G
[0156] When the type of resource utilization is disk utilization, Y% of the cloud resources of the first cloud host are determined as first capacity expansion resources, and a single capacity expansion does not exceed 300G.
[0157] Here, in the expansion strategy, avoid excessive expansion that requires short-term recovery, set the minimum expansion unit and the total amount of single expansion. By adjusting the first expansion resource according to the node type and resource utilization type of the cloud host, the steps of expanding the resource are obtained, which has a good performance in terms of continuous improvement of CPU, memory, and storage utilization, business operation guarantee, etc., especially in the case of virtualized private clouds with a large number of cloud hosts and diverse cloud host business types.
[0158] In a possible embodiment, after step 130, the following steps may also be included:
[0159] Perform resource configuration on the target cloud host according to the resource configuration information to obtain updated cloud resources; calculate the difference between the cloud resources and the updated cloud resources; and generate an evaluation report of the resource configuration according to the difference.
[0160] Here, after resource recovery and expansion, the recovered resources are summarized and the utilization improvement is evaluated to achieve the goal of improving the efficiency of virtualized private cloud resources.
[0161] like Figure 2 As shown, based on Figure 1 The flowchart of the resource configuration method shown in the figure, the embodiment of the present application also provides a flowchart of implementing the resource configuration method, specifically including:
[0162] First, data collection, that is, obtaining the sampled data of the cloud host in a preset time period, the sampled data at least includes: the shutdown time of the cloud host and the resource utilization rate of the cloud host. Then, data processing, that is, pre-processing the sampled data;
[0163] Next, determine whether the sampled data is the sampled data of the first time period. If so, perform the first data analysis, that is, execute the above steps 120-130, and determine the resource configuration information from the initial resource configuration information according to the preset configuration information given by the expert or the person in charge of the platform; simulate the resource configuration of the target cloud host according to the resource configuration information, and predict the updated cloud resources; calculate the difference between the cloud resources and the updated cloud resources, that is, the tuning data, generate the first resource configuration evaluation report according to the tuning data, implement resource configuration for the target cloud host according to the resource configuration information, and finally return to the data collection step. If not, perform the Nth data analysis, compare the Nth sampling data with the sampling data of the first time period, and generate the Nth resource configuration evaluation report.
[0164] Based on the virtualized private cloud cloud resource cloud platform basic library as the index, execute each cloud platform data one by one, summarize all cloud host tuning evaluation data under each cloud platform, and generate a cloud platform tuning evaluation report. It takes a long time to collect data, organize data, compare data, and post-evaluation. Through the cloud resource utilization improvement model and algorithm, one-click generation and one-click comparison, that is, the list of systems to be recycled and optimized, the list of systems to be expanded and optimized, one-click generation, optimal strategy matching, summary of recycled resources, and timely update of utilization improvement evaluation can be achieved.
[0165] In the resource configuration method provided by the present application, by obtaining the sampling data of the cloud host in a preset time period, the sampling data at least includes: the shutdown time of the cloud host and the resource utilization rate of the cloud host. Here, the sampling data can characterize the usage of the cloud host in the preset time period, so the target cloud host that meets the preset conditions can be determined from the cloud host according to the sampling data. The target cloud host is the cloud host whose resource configuration needs to be adjusted. Finally, the resource configuration information of the target cloud host is determined according to the sampling data. The resource configuration information can be flexibly specified for the target cloud host according to the usage of different target cloud hosts, so as to configure the cloud resources of the target cloud host according to the resource configuration information, that is, the resources of a part of the target cloud hosts can be recycled, and the resources of another part of the cloud hosts can be expanded, thereby improving the resource efficiency.
[0166] Based on the above Figure 1 The resource configuration method shown in the embodiment of the present application also provides a resource configuration device, such as Figure 3 As shown, the resource configuration device 300 may include:
[0167] The acquisition module 310 is used to acquire sampling data of the cloud host in a preset time period, and the sampling data at least includes: the shutdown duration of the cloud host and the resource utilization rate of the cloud host.
[0168] The first determination module 320 is used to determine a target cloud host that meets a preset condition from the cloud hosts according to the sampled data.
[0169] The second determination module 330 is used to determine resource configuration information of the target cloud host according to the sampled data, and the resource configuration information is used to configure the cloud resources of the target cloud host.
[0170] In a possible embodiment, the preset time period includes a first time period and a second time period, the preset condition includes a recycling condition and a capacity expansion condition, and the first determining module 320 is specifically configured to:
[0171] Determine, based on the sampled data, a first average value of the resource utilization rate in a first time period and a second average value of the resource utilization rate in a second time period;
[0172] Determining a first cloud host that meets a recycling condition from the cloud hosts according to the first average value and the second average value;
[0173] Determining a second cloud host that meets the capacity expansion condition from the cloud hosts according to the first average value and the second average value;
[0174] The start time of the first time period is later than the start time of the second time period.
[0175] In a possible embodiment, the resource configuration device 300 may further include:
[0176] The first acquisition module is used to acquire the node type and preset recycling conditions of the cloud host.
[0177] The third determination module is used to determine the recycling condition according to the node type of the cloud host and the preset recycling condition; wherein the preset recycling condition includes any one of the following:
[0178] The shutdown duration is greater than the first threshold;
[0179] The first average value is less than a second threshold value;
[0180] The second average value is in the first interval, the lower limit value of the first interval is the second threshold value, and the upper limit value of the first interval is the third threshold value.
[0181] In a possible embodiment, the resource configuration device 300 may further include:
[0182] The second acquisition module is used to obtain the node type and preset expansion conditions of the cloud host.
[0183] The fourth determination module is used to determine the expansion condition according to the node type of the cloud host and the preset expansion condition; wherein the preset expansion condition includes any one of the following:
[0184] The first average value is greater than a fourth threshold;
[0185] The second average value is in the second interval, the lower limit value of the second interval is the fifth threshold value, and the upper limit value of the first interval is the fourth threshold value.
[0186] In a possible embodiment, resource utilization includes: central processing unit CPU utilization, memory utilization, and disk utilization.
[0187] In a possible embodiment, the preset time period includes a plurality of preset time periods, and the second determining module 330 is specifically configured to:
[0188] Acquire sampling data in a first time period from the sampling data, where the first time period is one of a plurality of preset time periods, and the end time of the first time period is the latest of a plurality of end times corresponding to the plurality of preset time periods;
[0189] Determine the maximum value of resource utilization according to the sampling data in the first time period;
[0190] Determine the reclaimed resources of the first cloud host according to the sampling data and the maximum value of the resource utilization rate;
[0191] Determine the expansion resources for the second cloud host based on the sampled data.
[0192] In a possible embodiment, the cloud resource is a CPU resource or a memory resource, and the second determination module 330 is specifically configured to:
[0193] When the maximum value of the resource utilization rate is less than X%, Y% of the cloud resources of the first cloud host are determined as recycled resources;
[0194] When the maximum value of resource utilization is greater than or equal to X%, the resource to be recycled is determined according to the maximum value of resource utilization and the reserved value; wherein Y% is the sum of X% and the reserved value; X and Y are non-negative numbers;
[0195] When the recycled resources meet the first preset condition, the recycled resources are reset to 0.
[0196] In a possible embodiment, the cloud resources include: CPU resources, memory resources and disk resources, the sampled data also includes a disk space value, and the second determination module 330 is specifically used to:
[0197] When the shutdown duration is greater than a first threshold, all cloud resources of the first cloud host are determined as recycled resources;
[0198] When the disk space value is greater than a preset value, Y% of the disk resources of the first cloud host are determined as reclaimed resources.
[0199] In a possible embodiment, the second determining module 330 is specifically configured to:
[0200] Determine Y% of the cloud resources of the first cloud host as first expansion resources;
[0201] According to the node type and resource utilization type of the cloud host, the first expansion resource is adjusted to obtain the expansion resource.
[0202] In the embodiment of the present application, by acquiring the sampling data of the cloud host in a preset time period, the sampling data at least includes: the shutdown time of the cloud host and the resource utilization rate of the cloud host. Here, the sampling data can characterize the usage of the cloud host in the preset time period, so the target cloud host that meets the preset conditions can be determined from the cloud hosts according to the sampling data. The target cloud host is the cloud host whose resource configuration needs to be adjusted. Finally, the resource configuration information of the target cloud host is determined according to the sampling data. The resource configuration information can be flexibly specified for the target cloud host according to the usage of different target cloud hosts, so as to configure the cloud resources of the target cloud host according to the resource configuration information, that is, the resources of a part of the target cloud hosts can be recycled, and the resources of another part of the cloud hosts can be expanded, thereby improving the resource efficiency.
[0203] Figure 4 A schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present application is shown.
[0204] The electronic device may include a processor 401 and a memory 402 storing computer program instructions.
[0205] Specifically, the processor 401 may include a central processing unit (CPU), or an application specific integrated circuit (ASIC), or may be configured to implement one or more integrated circuits of the embodiments of the present application.
[0206] The memory 402 may include a large capacity memory for data or instructions. By way of example and not limitation, the memory 402 may include a hard disk drive (HDD), a floppy disk drive, a flash memory, an optical disk, a magneto-optical disk, a magnetic tape, or a universal serial bus (USB) drive or a combination of two or more of these. In appropriate cases, the memory 402 may include a removable or non-removable (or fixed) medium. In appropriate cases, the memory 402 may be inside or outside the integrated gateway disaster recovery device. In a specific embodiment, the memory 402 is a non-volatile solid-state memory. In a specific embodiment, the memory 402 includes a read-only memory (ROM). In appropriate cases, the ROM may be a mask-programmed ROM, a programmable ROM (PROM), an erasable PROM (EPROM), an electrically erasable PROM (EEPROM), an electrically rewritable ROM (EAROM) or a flash memory or a combination of two or more of these.
[0207] The processor 401 implements any one of the resource configuration methods in the embodiments shown in the figure by reading and executing the computer program instructions stored in the memory 402.
[0208] In one example, the electronic device may further include a communication interface 404 and a bus 410. Figure 4 As shown, the processor 401, the memory 402, and the communication interface 404 are connected via a bus 410 and communicate with each other.
[0209] The communication interface 404 is mainly used to implement communication between various modules, devices, units and / or equipment in the embodiments of the present application.
[0210] Bus 410 includes hardware, software or both, and the parts of electronic equipment are coupled to each other. For example, but not limitation, bus may include accelerated graphics port (AGP) or other graphics bus, enhanced industrial standard architecture (EISA) bus, front side bus (FSB), hypertransport (HT) interconnection, industrial standard architecture (ISA) bus, infinite bandwidth interconnection, low pin count (LPC) bus, memory bus, micro channel architecture (MCA) bus, peripheral component interconnection (PCI) bus, PCI-Express (PCI-X) bus, serial advanced technology attachment (SATA) bus, video electronics standard association local (VLB) bus or other suitable bus or two or more of these combinations. In appropriate cases, bus 410 may include one or more buses. Although the present application embodiment describes and shows a specific bus, the application considers any suitable bus or interconnection.
[0211] The electronic device can execute the resource configuration method in the embodiment of the present application, thereby realizing the combination Figure 2 Describes the resource configuration method.
[0212] In addition, in combination with the resource configuration method in the above embodiment, the embodiment of the present application can provide a computer-readable storage medium for implementation. The computer-readable storage medium stores computer program instructions; when the computer program instructions are executed by the processor, the Figure 1 resource allocation method.
[0213] It should be clear that the present application is not limited to the specific configuration and processing described above and shown in the figures. For the sake of simplicity, a detailed description of the known method is omitted here. In the above embodiments, several specific steps are described and shown as examples. However, the method process of the present application is not limited to the specific steps described and shown, and those skilled in the art can make various changes, modifications and additions, or change the order between the steps after understanding the spirit of the present application.
[0214] The functional blocks shown in the above-described block diagram can be implemented as hardware, software, firmware or a combination thereof. When implemented in hardware, it can be, for example, an electronic circuit, an application-specific integrated circuit (ASIC), appropriate firmware, a plug-in, a function card, etc. When implemented in software, the elements of the present application are programs or code segments that are used to perform the required tasks. The program or code segment can be stored in a machine-readable medium, or transmitted on a transmission medium or a communication link by a data signal carried in a carrier wave. "Machine-readable medium" can include any medium capable of storing or transmitting information. Examples of machine-readable media include electronic circuits, semiconductor memory devices, ROM, flash memory, erasable ROM (EROM), floppy disks, CD-ROMs, optical disks, hard disks, optical fiber media, radio frequency (RF) links, etc. The code segment can be downloaded via a computer network such as the Internet, an intranet, etc.
[0215] It should also be noted that the exemplary embodiments mentioned in this application describe some methods or systems based on a series of steps or devices. However, this application is not limited to the order of the above steps, that is, the steps can be performed in the order mentioned in the embodiment, or in a different order from the embodiment, or several steps can be performed simultaneously.
[0216] The above is only a specific implementation of the present application. Those skilled in the art can clearly understand that for the convenience and simplicity of description, the specific working processes of the systems, modules and units described above can refer to the corresponding processes in the aforementioned method embodiments, and will not be repeated here. It should be understood that the protection scope of the present application is not limited to this. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed in this application, and these modifications or replacements should be included in the protection scope of this application.
Claims
1. A resource configuration method, characterized in that: The method comprises: Acquire sampling data of the cloud host in a preset time period, the sampling data at least including: shutdown duration of the cloud host and resource utilization rate of the cloud host; Determining a target cloud host that meets a preset condition from among the cloud hosts according to the sampled data; Determine resource configuration information of the target cloud host according to the sampled data, wherein the resource configuration information is used to configure cloud resources of the target cloud host; The preset time period includes a plurality of preset time periods, and determining the resource configuration information of the target cloud host according to the sampled data includes: Acquire sampling data within a first time period from the sampling data, where the first time period is one of the plurality of preset time periods, and the end time of the first time period is the latest of the plurality of end times corresponding to the plurality of preset time periods; Determining the maximum value of the resource utilization rate according to the sampling data in the first time period; Determining the reclaimed resources of the first cloud host according to the sampling data and the maximum value of the resource utilization rate; Determine the expansion resources of the second cloud host according to the sampled data.
2. The method according to claim 1, characterized in that The preset time period includes a first time period and a second time period, the preset conditions include a recycling condition and a capacity expansion condition, and determining a target cloud host that meets the preset conditions from the cloud hosts according to the sampled data includes: Determine, according to the sampling data, a first average value of the resource utilization rate in the first time period and a second average value of the resource utilization rate in the second time period; Determining a first cloud host that meets the recycling condition from among the cloud hosts according to the first average value and the second average value; Determining, from the cloud hosts, a second cloud host that meets the capacity expansion condition according to the first average value and the second average value; The start time of the first time period is later than the start time of the second time period.
3. The method according to claim 2, characterized in that Before determining the first cloud host that meets the recycling condition from the cloud hosts according to the first average value and the second average value, the method further includes: Obtaining the node type and preset recycling conditions of the cloud host; Determine the recycling condition according to the node type of the cloud host and the preset recycling condition; wherein the preset recycling condition includes any one of the following: The shutdown duration is greater than a first threshold; The first average value is less than a second threshold; The second average value is in a first interval, a lower limit value of the first interval is the second threshold value, and an upper limit value of the first interval is a third threshold value.
4. The method according to claim 2, characterized in that: Before determining, from the cloud hosts, a second cloud host that meets the capacity expansion condition according to the first average value and the second average value, the method further includes: Obtaining the node type and preset expansion conditions of the cloud host; Determine the expansion condition according to the node type of the cloud host and the preset expansion condition; wherein the preset expansion condition includes any one of the following: The first average value is greater than a fourth threshold; The second average value is in a second interval, a lower limit value of the second interval is a fifth threshold value, and an upper limit value of the first interval is the fourth threshold value.
5. The method according to any one of claims 1 to 4, characterized in that: The resource utilization includes: central processing unit CPU utilization, memory utilization and disk utilization.
6. The method according to claim 1, characterized in that The cloud resource is a CPU resource or a memory resource, and determining the recycling resource of the first cloud host according to the sampling data and the maximum value of the resource utilization rate includes: When the maximum value of the resource utilization rate is less than X%, determining Y% of the cloud resources of the first cloud host as the recycled resources; In the case where the maximum value of the resource utilization is greater than or equal to X%, the recycled resources are determined according to the maximum value of the resource utilization and the reserved value; wherein the Y% is the sum of the X% and the reserved value; and the X and Y are non-negative numbers; When the recycled resources meet a first preset condition, the recycled resources are reset to 0.
7. The method according to claim 1, characterized in that The cloud resources include: CPU resources, memory resources and disk resources, the sampled data also includes a disk space value, and determining the reclaimed resources of the first cloud host according to the sampled data and the maximum value of the resource utilization rate includes: When the shutdown duration is greater than a first threshold, determining all cloud resources of the first cloud host as the recycled resources; When the disk space value is greater than a preset value, Y% of the disk resources of the first cloud host are determined as the reclaimed resources.
8. The method according to claim 1, characterized in that The step of determining the expansion resources of the second cloud host according to the sampled data includes: Determine Y% of the cloud resources of the second cloud host as first expansion resources; According to the node type of the cloud host and the type of the resource utilization, the first capacity expansion resource is adjusted to obtain the capacity expansion resource.
9. A resource allocation device, characterized in that: The resource configuration device comprises: An acquisition module, used to acquire sampling data of the cloud host in a preset time period, wherein the sampling data at least includes: shutdown duration of the cloud host and resource utilization rate of the cloud host; A first determining module, configured to determine a target cloud host that meets a preset condition from among the cloud hosts according to the sampled data; A second determination module is used to determine resource configuration information of the target cloud host according to the sampled data, wherein the resource configuration information is used to configure cloud resources of the target cloud host; The preset time period includes a plurality of preset time periods, and the second determining module is specifically configured to: Acquire sampling data in a first time period from the sampling data, where the first time period is one of a plurality of preset time periods, and the end time of the first time period is the latest of a plurality of end times corresponding to the plurality of preset time periods; Determine the maximum value of resource utilization according to the sampling data in the first time period; Determine the reclaimed resources of the first cloud host according to the sampling data and the maximum value of the resource utilization rate; Based on the sampled data, determine the expansion resources for the second cloud host.
10. An electronic device, characterized in that: The electronic device comprises: a processor and a memory storing computer program instructions; when the processor executes the computer program instructions, the resource configuration method according to any one of claims 1 to 8 is implemented.
11. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer program instructions, and when the computer program instructions are executed by a processor, the resource configuration method according to any one of claims 1 to 8 is implemented.
Citation Information
Patent Citations
A method for recommending cloud host configuration
CN109901912A
Configuration management system and method for cloud host
CN110297713A
Method and device for automatically adjusting cloud host configuration in cloud environment
CN113590337A
Data transmission method and system, electronic equipment and readable medium
CN114422599A
Resource allocation method and device, storage medium and computer equipment
CN114860451A
