Method and apparatus for determining tenant health of a container cloud platform
Patent Information
- Application Number
- CN202211085957.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-06
- Publication Date
- 2026-10-27
- Estimated Expiration
- 2042-09-06
AI Technical Summary
[0003]本申请实施例提供一种容器云平台的租户健康度确定方法和装置,用以解决确定租户的健康度的问题
[0032]本申请实施例提供的容器云平台的租户健康度确定方法和装置,通过确定租户的各个指标的总使用率;根据各个指标的总使用率确定各个指标的健康度;确定各个指标的健康度权重值,以根据各个指标的健康度以及健康度权重值确定租户的健康度。本申请通过计算租户的健康度有助于减少运维人员管理集群的工作量,基于租户的健康度可以预先对集群节点进行资源调度,维持节点均衡,对处于健康状态的租户,可减少巡检次数和工作量,而针对状态不正常的租户,进行重点关注与问题排查,精准定位问题,为租户提供了直观的资源健康状态,租户可根据实际情况,提前对特殊应用进行迁移调度,以应对特殊场景出现的高负载情形。
Smart Images

Figure CN116962417B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer cloud platform technology, and specifically to a method and apparatus for determining the tenant health of a container cloud platform. Background Technology
[0002] In CaaS platform tenant management, platform operations personnel need to check each container group or container individually to identify node imbalance issues. After identifying the problem, operations personnel often use the "simple" method of deleting containers to adjust the node load. This can potentially impact critical services. For example, in an ongoing flash sale, increased load can cause temporary performance degradation or even service interruption if containers are deleted or rescheduled, affecting the flash sale. For tenants, since they cannot directly see their resource usage status, it is difficult to perform pre-processing. Therefore, determining tenant health is a pressing issue that needs to be addressed. Summary of the Invention
[0003] This application provides a method and apparatus for determining the health of tenants on a container cloud platform, in order to solve the problem of determining the health of tenants.
[0004] In a first aspect, embodiments of this application provide a method for determining the tenant health of a container cloud platform, including:
[0005] Determine the overall utilization rate of each tenant's metrics;
[0006] The health of each of the aforementioned indicators is determined based on the total usage rate of each indicator.
[0007] Determine the health weight value for each of the aforementioned indicators, and determine the health of the tenant based on the health of each of the aforementioned indicators and the health weight value.
[0008] In one embodiment, determining the health weight value of each of the indicators includes:
[0009] If the indicator is distributed storage, then the health weight value of the distributed storage is determined based on the historical health of the distributed storage;
[0010] If the metrics are CPU and memory, then the information carrying capacity of the CPU and the memory is determined, and the health weight value of the CPU and the health weight value of the memory are determined based on the information carrying capacity and the health weight value of the distributed storage, respectively.
[0011] In one embodiment, determining the information carrying capacity of the CPU and the memory includes:
[0012] A first standard deviation is determined based on the historical health status of the CPU, and a second standard deviation is determined based on the historical health status of the memory.
[0013] The correlation coefficient between the CPU and the memory is determined based on the average values corresponding to the historical health of the CPU and the historical health of the memory, respectively.
[0014] The conflict coefficients of the CPU and the memory are determined based on the correlation coefficients, and the information carrying capacity of the CPU and the memory is determined based on the conflict coefficients, the first standard deviation, and the second standard deviation.
[0015] In one embodiment, determining the tenant's health based on the health of each of the aforementioned indicators and the health weight value includes:
[0016] If all of the health scores are greater than the set health score threshold, then the weighted sum of the health scores of each of the indicators and the health score weights of each of the indicators is taken as the health score of the tenant.
[0017] If at least one of the health scores is less than a set health score threshold, then a minimum health score is determined based on the health scores of each of the indicators, and the tenant's health score is determined based on the minimum health score and the health scores of each of the indicators.
[0018] In one embodiment, determining the utilization rate of each metric for a tenant includes:
[0019] Determine the usage rate of each of the aforementioned metrics in each namespace of the tenant over different time periods;
[0020] Based on the usage rate of each indicator in different time periods and the quota information of each indicator, the total usage rate of each indicator in different time periods is determined.
[0021] In one embodiment, determining the health of each of the indicators based on the total usage rate of each indicator includes:
[0022] Determine the usage rate range in which the total usage rate of each of the aforementioned indicators falls, and determine the health status of each of the aforementioned indicators based on the usage rate range;
[0023] The health of each indicator is determined based on its total usage rate and the method for determining its health.
[0024] In one embodiment, after determining the tenant's health based on the health of each of the aforementioned indicators and the health weight value, the process includes:
[0025] Determine the warning range in which the tenant's health status falls, and send a health warning notification based on the warning range.
[0026] Secondly, embodiments of this application provide a tenant health determination device for a container cloud platform, comprising:
[0027] The total utilization rate determination module is used to determine the total utilization rate of various metrics for tenants;
[0028] The indicator health determination module is used to determine the health of each indicator based on the total usage rate of each indicator.
[0029] The tenant health determination module is used to determine the health weight value of each of the indicators, so as to determine the health of the tenant based on the health of each indicator and the health weight value.
[0030] Thirdly, embodiments of this application provide an electronic device, including a processor and a memory storing a computer program, wherein the processor executes the program to implement the steps of the tenant health determination method for the container cloud platform described in the first aspect.
[0031] Fourthly, embodiments of this application provide a computer program product, including a computer program that, when executed by a processor, implements the steps of the tenant health determination method for the container cloud platform described in the first aspect.
[0032] The tenant health determination method and apparatus for a container cloud platform provided in this application determine the tenant's overall utilization rate of various indicators; determine the health of each indicator based on the overall utilization rate; and determine the health weight value of each indicator, thereby determining the tenant's health based on the health of each indicator and the health weight value. This application helps reduce the workload of operations and maintenance personnel in managing the cluster by calculating the tenant's health. Based on the tenant's health, resources can be pre-scheduled for cluster nodes to maintain node balance. For tenants in a healthy state, the number of inspections and workload can be reduced, while tenants in an abnormal state can be given special attention and problem investigation, accurately locating problems. This provides tenants with an intuitive resource health status, allowing them to migrate and schedule specific applications in advance to cope with high-load situations in special scenarios. Attached Figure Description
[0033] To more clearly illustrate the technical solutions in this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0034] Figure 1 This is a flowchart illustrating the method for determining the tenant health of a container cloud platform provided in this application embodiment;
[0035] Figure 2 This is a schematic diagram of the tenant health determination device for a container cloud platform provided in this application embodiment;
[0036] Figure 3 This is a schematic diagram of the structure of the electronic device provided in the embodiments of this application. Detailed Implementation
[0037] To make the objectives, technical solutions, and advantages of this application clearer, the technical solutions of this application will be clearly and completely described below with reference to the accompanying drawings of the embodiments. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0038] Figure 1 This is a flowchart illustrating the tenant health determination method for a container cloud platform provided in this application embodiment. (Refer to...) Figure 1 This application provides a method for determining the tenant health of a container cloud platform, which may include:
[0039] Step 100: Determine the total utilization rate of each metric for the tenant;
[0040] It should be noted that a tenant includes at least one namespace. Each namespace can see the resource usage of all pods within it, but it cannot reflect the resource usage of the entire tenant, thus making a comprehensive assessment of the tenant's resource usage impossible. Therefore, this embodiment calculates the total utilization rate of various metrics within each namespace, i.e., the utilization rate of each metric within each namespace. These metrics include at least one of CPU, memory, and distributed storage (i.e., Ceph storage). For example, it obtains resource usage information and quotas for CPU, memory, and Ceph storage for each namespace on the platform. Then, it calculates the CPU and memory resource metrics for each namespace at four time granularities: 15 minutes, 1 hour, 6 hours, and 12 hours. Finally, it determines the total utilization rate of each metric using the average of the metrics over the four different periods and the quota information, providing a more comprehensive reflection of the current service status of the tenant's containers.
[0041] Step 200: Determine the health status of each indicator based on the total usage rate of each indicator;
[0042] After determining the total utilization rate of each metric, the health of each metric is determined based on the total utilization rate. For example, the current Ceph storage usage metric is calculated, and the overall CPU, memory, and Ceph storage metrics are evaluated according to three intervals: 0%-40%, 40%-80%, and 80%-100%. Different calculation formulas are designed for different intervals to calculate the health of the tenant's CPU, memory, and Ceph storage.
[0043] Step 300: Determine the health weight value of each of the indicators, so as to determine the health of the tenant based on the health of each of the indicators and the health weight value.
[0044] After determining the health level of each indicator, the health level weight value of each indicator is further determined to determine the tenant's health level based on the health level of each indicator and its weight value. For example, when the health levels of all resources are high, a weighted average method is used to calculate the tenant's health level; if the health level of a certain resource exceeds the set threshold, a penalty weighted algorithm is used to calculate the tenant's health level.
[0045] The tenant health determination method for a container cloud platform provided in this application determines the total utilization rate of various indicators for each tenant, then determines the health of each indicator based on the total utilization rate, and determines the health weight value of each indicator. Based on the health of each indicator and its weight value, the tenant's health is determined. This helps reduce the workload of operations and maintenance personnel in managing the cluster. Based on the tenant's health, resources can be pre-scheduled for cluster nodes to maintain node balance. For tenants in a healthy state, the number of inspections and workload can be reduced, while tenants in an abnormal state can be given focused attention and problem investigation, accurately locating issues. This provides tenants with an intuitive resource health status, allowing them to migrate and schedule specific applications in advance to cope with high-load situations in special scenarios.
[0046] Based on the above embodiments, determining the health weight value of each of the indicators includes: if the indicator is distributed storage, then determining the health weight value of distributed storage based on the historical health of distributed storage; if the indicator is CPU and memory, then determining the information carrying capacity of CPU and memory, and determining the health weight value of CPU and the health weight value of memory based on the information carrying capacity and the health weight value of distributed storage, respectively.
[0047] For example, based on historical health assessment records of tenant CPU, memory, and Ceph storage, machine learning algorithms dynamically adjust the health weights of these metrics. CPU and memory performance metrics are highly volatile and unstable, easily affected by internal and external factors. For instance, a surge in business traffic or overly complex processing events (image decompression, image analysis, or PDF generation) can lead to increased resource consumption and a decrease in health scores. Since CPU and memory are often the cause of uneven cluster load, their health weights need to be relatively high. Ceph storage metrics, on the other hand, exhibit a stable upward trend and are highly predictable, allowing for relatively lower health weights. Therefore, the health weights for CPU and memory can be set at 20%-70% of the tenant's overall health score, while the health weight for Ceph storage can be set at 10%-20%.
[0048] Calculate the health score weight for the tenant's Ceph storage by averaging the three most recent historical health scores, setting a health score range of 40-80 points, corresponding to a weight range of 10%-20%. The calculation formula is as follows:
[0049] c=0.0025x+0.1(10%≤c≤20%)
[0050] Where x represents the average of the three most recent health values stored in Ceph.
[0051] The weight range for CPU health is set to 20-70%, and the weight range for memory health is also set to 20-70%. Since the two health data are volatile and there is a correlation between them, in order to calculate the optimal weight ratio, this embodiment of the application selects the most recent historical health of each and calculates the weight ratio of the two health values through an objective weighting method based on data volatility: the CRITIC weighting method.
[0052] The CRITIC weighting method analyzes the correlation between health indicators using volatility (contrast strength) and conflict (correlation) indicators. It then normalizes the results by multiplying the contrast strength and conflict indicators to obtain the final weight ratio. For example, the CRITIC weighting method can be used to calculate the information carrying capacity of CPU and memory. The health weight values for CPU and memory are then determined based on the information carrying capacity and the health weight value of distributed storage, respectively. Assuming the information carrying capacity is C... i Calculate the weight ratio of CPU and memory:
[0053]
[0054] Among them, the CPU weight ratio is W1 and the memory weight ratio is W2.
[0055] Calculate the CPU's health weight value:
[0056]
[0057] Calculate the health weight value of memory:
[0058]
[0059] This application embodiment selects the most recent historical health data of CPU, memory, and Ceph storage based on the historical health data of resources such as CPU, memory, and Ceph storage. Then, according to the CRITIC weighting method and the mean algorithm, it dynamically adjusts the weight values of CPU, memory, and Ceph storage health in the overall tenant health, optimizes the tenant health algorithm, and makes the tenant health more closely resemble the resource status of the actual production environment, thereby improving the accuracy of determining the tenant health.
[0060] Based on the above embodiments, determining the information carrying capacity of the CPU and the memory includes: determining a first standard deviation based on the historical health of the CPU, and determining a second standard deviation based on the historical health of the memory; determining the correlation coefficient between the CPU and the memory based on the mean values corresponding to the historical health of the CPU and the historical health of the memory, respectively; determining the conflict coefficient between the CPU and the memory based on the correlation coefficient, so as to determine the information carrying capacity of the CPU and the memory based on the conflict coefficient, the first standard deviation, and the second standard deviation.
[0061] For example, the steps for calculating the information carrying capacity of CPU and memory based on the CRITIC weighting method are as follows:
[0062] Step 1: Obtain the historical health status of the CPU and memory for the most recent 7 times to obtain the data matrix.
[0063]
[0064] Among them, group x represents the historical health status of the CPU, and group y represents the historical health status of the memory.
[0065] Step 2: Calculate the volatility index of health, i.e., the comparative strength. The standard deviation is used to represent the variation in the values of each indicator. The larger the standard deviation, the greater the numerical variation of the indicator, the more information it reflects, and the stronger its evaluation strength. Therefore, this indicator should be assigned more weight.
[0066] Step 3: Calculate the standard deviation of health scores for each group:
[0067]
[0068]
[0069] S1 represents the standard deviation of the health status of the first group x. Sx represents the average health score of group x, and S2 represents the standard deviation of the health score of the first group y. y represents the average health score of group y, and n represents the number of health score indicators in a group.
[0070] Step 4: Calculate the correlation coefficient r of health status:
[0071]
[0072] Step 5: Calculate the conflict coefficient R of health status:
[0073]
[0074] Where m represents the number of correlation coefficients.
[0075] Step Six: Calculate Information Capacity
[0076] C i =S i ×R
[0077] Among them, S i Including S1 and S2.
[0078] This application embodiment selects the most recent historical health data of CPU, memory, and Ceph storage based on the historical health data of resources such as CPU, memory, and Ceph storage. Then, according to the CRITIC weighting method and the mean algorithm, it dynamically adjusts the weight values of CPU, memory, and Ceph storage health in the overall tenant health, optimizes the tenant health algorithm, and makes the tenant health more closely resemble the resource status of the actual production environment, thereby improving the accuracy of determining the tenant health.
[0079] Based on the above embodiments, determining the tenant's health status according to the health status of each indicator and the health status weight value includes: if each health status is greater than a set health status threshold, then the weighted sum of the health status of each indicator and the health status weight value of each indicator is taken as the tenant's health status; if at least one health status is less than the set health status threshold, then a minimum health status is determined according to the health status of each indicator, so as to determine the tenant's health status based on the minimum health status and the health status of each indicator.
[0080] For example, setting a health threshold of 20, and using this threshold as a boundary, we determine whether the health of CPU, memory, and Ceph storage are all greater than 20. Let CPU health be y1, memory health be y2, and Ceph storage health be y3. If the health of CPU, memory, and Ceph storage are all greater than 20, then the tenant's health is:
[0081] z = y1×a + y2×b + y3×c
[0082] If the health of any of the CPU, memory, and Ceph storage is below 20, a penalty algorithm is used to calculate the tenant's health. The minimum health among the three—CPU, memory, and Ceph storage—is determined as min(y1, y2, y3). The tenant's health is then calculated as follows:
[0083]
[0084] This application's embodiments calculate tenant health using a weighted algorithm based on whether the health of resources such as CPU, memory, and Ceph storage exceeds health thresholds. This helps reduce the workload of operations and maintenance personnel in managing the cluster. Based on the tenant's health, cluster nodes can be pre-scheduled to maintain node balance. For tenants in a healthy state, the number of inspections and workload can be reduced, while tenants in an abnormal state can be given special attention and troubleshooting, accurately locating problems. This provides tenants with an intuitive resource health status, and tenants can migrate and schedule special applications in advance according to actual conditions to cope with high load situations in special scenarios.
[0085] Based on the above embodiments, determining the utilization rate of each metric of a tenant includes: determining the utilization rate of each metric in each namespace of the tenant in different time periods, and then determining the total utilization rate of each metric in different time periods based on the utilization rate of each metric in different time periods and the quota information of each metric.
[0086] For example, the resource utilization information of a tenant’s CPU, memory, and Ceph storage can be obtained through the Prometheus monitoring service, which collects data every minute by scanning the CPU, memory, and Ceph storage usage of the platform’s namespaces for each tenant.
[0087] It should be noted that CPU and memory usage are container performance metrics, which are prone to fluctuations, including occasional large swings, and therefore exhibit significant instability. Thus, the average value calculated over different periods is used as the valid data. Ceph storage usage, on the other hand, is a hardware metric and exhibits relatively stable, continuously increasing data over the long term; therefore, the most recent data can be selected.
[0088] Calculate the sum of resources of all pods of the tenant in different time periods, and the sum of current Ceph storage usage.
[0089] Define time periods as 15min, 1h, 6h, and 12h, and calculate the average resource usage per minute within different time periods. That is, calculate the average CPU usage, memory usage, and Ceph storage usage of n namespaces within m minutes.
[0090] Get the CPU usage of n namespaces over m minutes. Assume there are n namespaces:
[0091] The CPU usage table can be obtained in 15 rows and n columns.
[0092]
[0093] The formula for the mean can be obtained as follows:
[0094]
[0095] Among them, a 11 This indicates the number of CPUs used by the first namespace within the first minute. This represents the total CPU usage of n namespaces within m minutes.
[0096] Therefore, the average CPU usage for time periods of 15 min, 1 h, 6 h, and 12 h is:
[0097]
[0098]
[0099]
[0100]
[0101] Similarly, the average memory usage over different periods can be obtained as follows:
[0102]
[0103]
[0104]
[0105]
[0106] Retrieve the Ceph inventory of all namespaces for the current tenant:
[0107] Tenantceph =∑namespace i request_ceph
[0108] Among them, namespace i request_ceph This indicates the current Ceph storage size used by the namespace, Tenant ceph This represents the sum of Ceph storage usage across all namespaces under the tenant.
[0109] Obtain the tenant's resource quotas, including Limit CPU, Limit memory, and Ceph storage quotas, for each tenant. Then, calculate the sum of the resource quotas for all pods on that tenant and the sum of the Ceph storage quotas.
[0110] Array cpu =∑namespace j volume_cpu
[0111] Among them, namespace i volume_cpu This represents the maximum number of CPUs configured in the i-th namespace. cpu This represents the sum of the maximum number of CPUs configured across all namespaces under the tenant.
[0112] Array memory =∑namespace i volume_memory
[0113] Among them, namespace i volume_memory This represents the maximum memory capacity configured for the i-th namespace, Array. memory This represents the sum of the maximum memory capacity configured across all namespaces under the tenant.
[0114] Array ceph =∑namespace i volume_ceph
[0115] Among them, namespace i volume_ceph This represents the maximum memory capacity configured in the i-th namespace, Array ceph This represents the sum of the maximum memory capacity configured across all namespaces under the tenant.
[0116] Calculate the total utilization of the tenant's CPU, memory, and Ceph storage.
[0117] Calculate the total CPU utilization and total memory utilization within different cycles of 15min, 1h, 6h, and 12h.
[0118] Ratio cpu This indicates the total CPU utilization of the tenant:
[0119]
[0120]
[0121]
[0122]
[0123] Ratio memory This indicates the total memory utilization of the tenant:
[0124]
[0125]
[0126]
[0127]
[0128] Ratio ceph This indicates the total utilization of the tenant's Ceph storage:
[0129] Ratio ceph =∑namespace i request_ceph / Array ceph *100%
[0130] This application embodiment obtains resource usage information and quotas such as CPU, memory, and Ceph storage for each namespace, and then calculates the resource indicators of CPU and memory for each namespace in different time periods. By using the average of the indicators in different time periods and the quota information, the total utilization rate of each indicator is determined. Based on this, the service status of the current tenant's container can be more comprehensively reflected, and the accuracy of determining the health of the tenant can be improved.
[0131] Based on the above embodiments, the step of determining the health of each indicator according to the total usage rate of each indicator includes: determining the usage rate interval in which the total usage rate of each indicator falls, determining the determination method of the health of each indicator based on the usage rate interval, and then determining the health of each indicator according to the total usage rate of each indicator and the determination method of the health of each indicator.
[0132] For example, determine the usage range of a tenant's total CPU, memory, and Ceph storage, such as setting the first range as [0%-40%], the second range as (40%-80%), and the third range as (80%-100%).
[0133] When the total utilization x of CPU, memory, and Ceph storage is in the first interval, i.e. 0% ≤ x ≤ 40%, set the health status of CPU, memory, and Ceph storage as follows:
[0134] y=100-0.005*(x*100)^2-0.05*x*100
[0135] The calculated health score ranges from 100 to 90.
[0136] When the total utilization x of CPU, memory, and Ceph storage is in the second range, i.e., 40% < x ≤ 80%, set the health of CPU, memory, and Ceph storage as follows:
[0137] y=90-0.0125*(x*100)^2+0.5*x*100
[0138] The calculated health score is between 90 and 50.
[0139] When the total utilization (x) of CPU, memory, and Ceph storage is in the third interval (i.e., 80% < x ≤ 100%), set the health status of CPU, memory, and Ceph storage as follows:
[0140] y=6.5*x*100-0.05*(x*100)^2-150
[0141] The calculated health score ranges from 50 to 0.
[0142] The health of a tenant's CPU and memory depends on performance evaluations over different periods. The longer the period, the closer the actual performance evaluation of CPU and memory approaches a certain stable value. Therefore, health evaluation values over longer periods should have a larger weight in the final metric calculation for the tenant. The weighted algorithm for CPU and memory health is set as follows:
[0143] Y==0.1*y1+0.2*y2+0.3*y3+0.4*y4
[0144] Where y1 represents the health of the indicator in the first time period, such as 15min; y2 represents the health of the indicator in the second time period, such as 1h; y3 represents the health of the indicator in the third time period, such as 6h; and y4 represents the health of the indicator in the fourth time period, such as 12h.
[0145] This application's embodiments design different health status trend algorithms based on the range of tenant resource metrics such as CPU, memory, and Ceph storage, to calculate the corresponding health status. When tenant performance metrics are low, the tenant application health status is high, and a gentle trend formula is designed; when tenant performance metrics are high, more attention should be paid, and a more aggressive formula is designed. By setting different levels of health status calculation formulas, the accuracy of determining the health status of metrics is improved.
[0146] Based on the above embodiments, after determining the tenant's health level according to the health level of each indicator and the health level weight value, the process includes: determining the warning interval of the tenant's health level, so as to send a health level warning message based on the warning interval. For example, the tenant's health level score is divided into different warning intervals, such as (80, 100] for healthy, (60, 80] for good, (30, 60] for warning, and [0, 30] for severe. A health level warning message is sent based on the warning interval. For example, if the tenant's health level is 50, an alarm message is sent through the alarm module.
[0147] This application embodiment sets an early warning interval and sends corresponding health warning information based on the early warning interval in which the tenant's health level falls. Based on this, the tenant can know their own health status in a timely manner, and achieve accurate investigation and location of problems.
[0148] To more clearly illustrate the tenant health determination method of the container cloud platform of this application, the following specific embodiments are explained.
[0149] Suppose that a tenant on a certain node has 3 namespaces, and the quota information for each namespace is shown in Table 1:
[0150] Table 1
[0151] A 8 10Gi 1G B 8 10Gi 1G C 8 10Gi 1G
[0152] The resource usage of each namespace during different time periods is shown in Tables 2 to 4:
[0153] Table 2
[0154]
[0155]
[0156] Table 3
[0157] 15min 6 6.1Gi 0.83G 1h 5 9.1Gi 0.83G 6h 4 7.7Gi 0.82G 12h 4 5.3Gi 0.81G
[0158] Table 4
[0159] 15min 5 8.1Gi 0.83G 1h 5 7.7Gi 0.83G 6h 7 6.7Gi 0.82G 12h 4 5.1Gi 0.81G
[0160] Historical health records are shown in Table 5:
[0161] Table 5
[0162] 1 45 47 44 2 56 54 44 3 87 71 45 4 34 55 46 5 44 66 46 6 42 43 47 7 67 64 47
[0163] Step 1: Calculate the total utilization of CPU, memory, and Ceph storage for each tenant. For example, calculate the CPU usage of all namespaces within a 15-minute period:
[0164] 15min: Tenant 15_cpu =3+6+5=14;
[0165] 1h: Tenant 60_cpu =6+5+5=16;
[0166] 6h: Tenant 360_cpu =3+4+7=14;
[0167] 12h: Tenant 720_cpu =5+4+4=13;
[0168] Calculate the memory usage of all namespaces within a 15-minute period:
[0169] Tenant 15_memory =7.2 + 6.1 + 8.1 = 21.4;
[0170] Tenant 60_memory =6.1 + 9.1 + 7.7 = 22.9;
[0171] Tenant 360_memory =4.1 + 7.7 + 6.7 = 18.5;
[0172] Tenant 720_memory =8.3 + 5.3 + 5.1 = 18.7;
[0173] Ceph storage current usage:
[0174] Tenant ceph =0.83 + 0.83 + 0.83 = 2.49;
[0175] CPU quota:
[0176] Array cpu =8+8+8=24;
[0177] Memory quota:
[0178] Arraymemory =10+10+10=30;
[0179] Ceph storage quota:
[0180] Array ceph 1+1+1=3;
[0181] Calculate the tenant's CPU utilization:
[0182]
[0183]
[0184]
[0185]
[0186] Calculate the tenant's memory usage:
[0187]
[0188]
[0189]
[0190]
[0191] Ceph storage utilization:
[0192]
[0193] Step 2: Calculate the health status of the CPU, memory, and Ceph storage.
[0194] Due to Ratio 15_cpu =58.33%, which is in the second interval (40% < x ≤ 80%). At this time, the CPU health is calculated using the formula y = 90 - 0.0125 * (x * 100)^2 + 0.5 * x * 100.
[0195] CPU health status:
[0196] y 15_cpu =90-0.0125*(58.33%*100)^2+0.5*58.33%*100=76.64;
[0197] y 60_cpu =90-0.0125*(66.78%*100)^2+0.5*66.78%*100=67.65;
[0198] y 360_cpu=90-0.0125*(58.33%*100)^2+0.5*58.33%*100=76.64;
[0199] y 720_cpu =90-0.0125*(54.17%*100)^2+0.5*54.17%*100=81.26;
[0200] Y1 = 0.1 * y 15_cpu +0.2*y 60_cpu +0.3*y 360_cpu +0.4*y 720_cpu =76.69;
[0201] Similarly, the health status of memory can be determined as follows:
[0202] y 15_memory =62.07
[0203] y 60_memory =55.34
[0204] y 360_memory =73.3
[0205] y 720_memory =72.6
[0206] Y2 = 68.31
[0207] The health status of the Ceph storage is: Y3 = 45.05
[0208] Step 3: Analyze the tenant's historical health data for CPU, memory, and Ceph storage, and calculate the health weight value.
[0209] The health weighting value for Ceph storage is:
[0210] c=0.0025*(44+44+45) / 3+0.1=0.21>20%
[0211] Therefore, the health weight value c of Ceph storage is 20%.
[0212] Based on the CPU health and memory health records above, a health matrix can be obtained:
[0213]
[0214] The left side represents the historical health status of the CPU, and the right side represents the historical health status of the memory.
[0215] Calculate the standard deviation between CPU health and memory health:
[0216]
[0217]
[0218] Where n represents the number of health levels in each group, n = 7; This represents the average historical health of each CPU group; x i This represents the i-th health level of a given group of CPUs based on their historical health status. y represents the average historical health of each memory group; i This represents the i-th health level of a certain memory group's historical health status.
[0219] Calculate the correlation coefficient between CPU health and memory health:
[0220]
[0221] Calculate the conflict coefficient between CPU health and memory health:
[0222]
[0223] Where m represents the number of correlation coefficients, m = 1; r i Let represent the i-th correlation coefficient.
[0224] The amount of information carried by calculating CPU health and memory health:
[0225] C cpu =S cpu ×R=18.1921*0.3272=5.95214293
[0226] C memory =S memory ×R=10.28638*0.3272=3.36552621
[0227] Calculate the weight ratio of CPU and memory:
[0228]
[0229]
[0230] The health weight value of the CPU is:
[0231] a=(1-c)×w cpu =0.8 × 0.6388017 = 0.511041364
[0232] The health weight value of memory is:
[0233] b = (1-c) × w memory=0.8 × 0.361198295 = 0.288958636
[0234] Step 4: Determine the health of the CPU, memory, and Ceph storage to be greater than 20. Y1 = 76.69 > 20, Y2 = 68.31 > 20, and Y3 = 45.05 > 20.
[0235] Therefore, the tenant's health level is:
[0236] Y = Y1*a + Y2*b + Y3*c
[0237] =76.35*0.511041364+68.305*0.288958636+45.05*0.2=67.77
[0238] This application embodiment obtains the CPU, memory, and Ceph storage quotas and usage of a tenant's namespace, calculates the health of the tenant's CPU, memory, and Ceph storage, and determines the tenant's health based on a weighted algorithm according to the health threshold. This helps reduce the workload of operations and maintenance personnel in managing the cluster. Based on the tenant's health, resources can be pre-scheduled for cluster nodes to maintain node balance. For tenants in a healthy state, the number of inspections and workload can be reduced, while for tenants in an abnormal state, key attention and problem investigation can be carried out to accurately locate problems. This provides tenants with an intuitive resource health status, and tenants can migrate and schedule special applications in advance according to actual conditions to cope with high load situations in special scenarios.
[0239] The tenant health determination device for a container cloud platform provided in the embodiments of this application will be described below. The tenant health determination device for a container cloud platform described below can be referred to in correspondence with the tenant health determination method for a container cloud platform described above.
[0240] refer to Figure 2 , Figure 2 This is a schematic diagram of the tenant health determination device for a container cloud platform provided in this application embodiment. The tenant health determination device for a container cloud platform provided in this application embodiment includes a total utilization determination module 201, an indicator health determination module 202, and a tenant health determination module 203.
[0241] The total utilization rate determination module 201 is used to determine the total utilization rate of various indicators of the tenant;
[0242] The health determination module 202 of the indicator is used to determine the health of each indicator based on the total usage rate of each indicator;
[0243] The tenant health determination module 203 is used to determine the health weight value of each indicator, so as to determine the tenant's health based on the health of each indicator and the health weight value.
[0244] The tenant health determination device for the container cloud platform provided in this application determines the total utilization rate of various indicators of a tenant, then determines the health of each indicator based on the total utilization rate, and determines the health weight value of each indicator. Based on the health of each indicator and its weight value, the tenant's health is determined. This helps reduce the workload of operations and maintenance personnel in managing the cluster. Based on the tenant's health, resources can be pre-scheduled for cluster nodes to maintain node balance. For tenants in a healthy state, the number of inspections and workload can be reduced, while tenants in abnormal states can be given special attention and problem investigation, accurately locating issues. This provides tenants with an intuitive resource health status, allowing them to migrate and schedule specific applications in advance to cope with high-load situations in special scenarios.
[0245] In one embodiment, the tenant health determination module 203 is specifically used for:
[0246] If the indicator is distributed storage, then the health weight value of the distributed storage is determined based on the historical health of the distributed storage;
[0247] If the metrics are CPU and memory, then the information carrying capacity of the CPU and the memory is determined, and the health weight value of the CPU and the health weight value of the memory are determined based on the information carrying capacity and the health weight value of the distributed storage, respectively.
[0248] In one embodiment, the tenant health determination module 203 is specifically used for:
[0249] A first standard deviation is determined based on the historical health status of the CPU, and a second standard deviation is determined based on the historical health status of the memory.
[0250] The correlation coefficient between the CPU and the memory is determined based on the average values corresponding to the historical health of the CPU and the historical health of the memory, respectively.
[0251] The conflict coefficients of the CPU and the memory are determined based on the correlation coefficients, and the information carrying capacity of the CPU and the memory is determined based on the conflict coefficients, the first standard deviation, and the second standard deviation.
[0252] In one embodiment, the tenant health determination module 203 is specifically used for:
[0253] If all of the health scores are greater than the set health score threshold, then the weighted sum of the health scores of each of the indicators and the health score weights of each of the indicators is taken as the health score of the tenant.
[0254] If at least one of the health scores is less than a set health score threshold, then a minimum health score is determined based on the health scores of each of the indicators, and the tenant's health score is determined based on the minimum health score and the health scores of each of the indicators.
[0255] In one embodiment, the total utilization determination module 201 is specifically used for:
[0256] Determine the usage rate of each of the aforementioned metrics in each namespace of the tenant over different time periods;
[0257] Based on the usage rate of each indicator in different time periods and the quota information of each indicator, the total usage rate of each indicator in different time periods is determined.
[0258] In one embodiment, the health determination module 202 of the indicator is specifically used for:
[0259] Determine the usage rate range in which the total usage rate of each of the aforementioned indicators falls, and determine the health status of each of the aforementioned indicators based on the usage rate range;
[0260] The health of each indicator is determined based on its total usage rate and the method for determining its health.
[0261] In one embodiment, the tenant health determination module 203 is specifically used for:
[0262] Determine the warning range in which the tenant's health status falls, and send a health warning notification based on the warning range.
[0263] Figure 3 An example is a schematic diagram of the physical structure of an electronic device, such as... Figure 3 As shown, the electronic device may include: a processor 310, a communication interface 320, a memory 330, and a communication bus 340, wherein the processor 310, the communication interface 320, and the memory 330 communicate with each other via the communication bus 340. The processor 310 may call a computer program in the memory 330 to execute the steps of the tenant health determination method of the container cloud platform, such as including:
[0264] Determine the overall utilization rate of each tenant's metrics;
[0265] The health of each of the aforementioned indicators is determined based on the total usage rate of each indicator.
[0266] Determine the health weight value for each of the aforementioned indicators, and determine the health of the tenant based on the health of each of the aforementioned indicators and the health weight value.
[0267] Furthermore, the logical instructions in the aforementioned memory 330 can be implemented as software functional units and, when sold or used as independent products, 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 a 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 USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0268] On the other hand, this application also provides a computer program product, which includes a computer program that can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can perform the steps of the tenant health determination method for the container cloud platform provided in the above embodiments, such as including:
[0269] Determine the overall utilization rate of each tenant's metrics;
[0270] The health of each of the aforementioned indicators is determined based on the total usage rate of each indicator.
[0271] Determine the health weight value for each of the aforementioned indicators, and determine the health of the tenant based on the health of each of the aforementioned indicators and the health weight value.
[0272] The device embodiments described above are merely illustrative. 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 modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.
[0273] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.
[0274] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application.
Claims
1. A method for determining tenant health in a container cloud platform, characterized in that, include: Determine the utilization rate of various metrics in each namespace of a tenant over different time periods; the tenant includes at least one namespace, and each namespace has an independent resource quota. Based on the usage rate of each indicator in different time periods and the quota information of each indicator, the total usage rate of each indicator in different time periods is determined. The health of each of the aforementioned indicators is determined based on the total usage rate of each indicator. If the indicator is distributed storage, then the health weight value of the distributed storage is determined based on the historical health of the distributed storage; If the indicators are CPU and memory, then the information carrying capacity of the CPU and the memory is determined, and the health weight value of the CPU and the health weight value of the memory are determined based on the information carrying capacity and the health weight value of the distributed storage, respectively. The tenant's health is determined based on the health of each of the aforementioned indicators and the weight value of that health.
2. The method for determining tenant health in a container cloud platform according to claim 1, characterized in that, Determining the information carrying capacity of the CPU and the memory includes: A first standard deviation is determined based on the historical health status of the CPU, and a second standard deviation is determined based on the historical health status of the memory. The correlation coefficient between the CPU and the memory is determined based on the average values corresponding to the historical health of the CPU and the historical health of the memory, respectively. The conflict coefficients of the CPU and the memory are determined based on the correlation coefficients, and the information carrying capacity of the CPU and the memory is determined based on the conflict coefficients, the first standard deviation, and the second standard deviation.
3. The method for determining tenant health in a container cloud platform according to claim 1, characterized in that, Determining the tenant's health status based on the health status of each indicator and the health status weight value includes: If all of the health scores are greater than the set health score threshold, then the weighted sum of the health scores of each of the indicators and the health score weights of each of the indicators is taken as the health score of the tenant. If at least one of the health scores is less than a set health score threshold, then a minimum health score is determined based on the health scores of each of the indicators, and the tenant's health score is determined based on the minimum health score and the health scores of each of the indicators.
4. The method for determining tenant health in a container cloud platform according to claim 1, characterized in that, The process of determining the health of each indicator based on its total usage rate includes: Determine the usage rate range in which the total usage rate of each of the aforementioned indicators falls, and determine the health status of each of the aforementioned indicators based on the usage rate range; The health of each indicator is determined based on its total usage rate and the method for determining its health.
5. The method for determining tenant health in a container cloud platform according to claim 1, characterized in that, After determining the tenant's health status based on the health status of each indicator and the health status weight value, the process includes: Determine the warning range in which the tenant's health status falls, and send a health warning notification based on the warning range.
6. A device for determining the tenant health of a container cloud platform, characterized in that, include: The total utilization rate determination module is used to determine the utilization rate of each indicator in each namespace of a tenant in different time periods; the tenant includes at least one namespace, and each namespace has an independent resource quota; based on the utilization rate of each indicator in different time periods and the quota information of each indicator, the total utilization rate of each indicator in different time periods is determined. The indicator health determination module is used to determine the health of each indicator based on the total usage rate of each indicator. The tenant health determination module is used to determine the health weight value of the distributed storage based on the historical health of the distributed storage if the indicator is distributed storage; If the metrics are CPU and memory, then the information carrying capacity of the CPU and the memory is determined, and the health weight value of the CPU and the health weight value of the memory are determined based on the information carrying capacity and the health weight value of the distributed storage, respectively, so as to determine the health of the tenant according to the health of each metric and the health weight value.
7. An electronic device comprising a processor and a memory storing a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the tenant health determination method for the container cloud platform according to any one of claims 1 to 5.
8. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by the processor, it implements the steps of the tenant health determination method for the container cloud platform according to any one of claims 1 to 5.
Citation Information
Patent Citations
Data processing method and device of intelligent customer service system, and electronic equipment
CN110533343A
Server host health degree calculation and alarm method and system
CN111008104A