A method and apparatus for distributing gray levels

By calculating the overall utilization rate of servers in the load balancing cluster, the gray-scale servers are automatically determined, solving the problem of low efficiency of manual configuration in existing technologies and improving server resource utilization and allocation strategy optimization.

CN116107756BActive Publication Date: 2026-06-16INDUSTRIAL AND COMMERCIAL BANK OF CHINA
View PDF 3 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
INDUSTRIAL AND COMMERCIAL BANK OF CHINA
Filing Date
2023-02-16
Publication Date
2026-06-16

AI Technical Summary

Technical Problem

Existing technologies require manual configuration of gray-scale strategies when conducting gray-scale testing in load-balanced clusters, resulting in low efficiency and low server resource utilization, and making it impossible to efficiently and reasonably determine gray-scale servers.

Method used

By acquiring relevant performance metrics data of each server in the load balancing cluster, the overall server utilization rate is calculated, and gray-scale servers are automatically determined based on the number of servers and the pre-configured gray-scale ratio, reducing manual configuration and optimizing server resource allocation.

Benefits of technology

It improves the utilization rate of server resources in the load balancing cluster, reduces the workload of manual configuration, and enables more flexible and efficient canary server allocation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116107756B_ABST
    Figure CN116107756B_ABST
Patent Text Reader

Abstract

The application provides a processing method and device for distributing gray scale, relates to the technical field of data processing, and can be applied to the financial field or other technical fields.The method comprises the following steps: obtaining relevant performance index data corresponding to each server in a load balancing cluster; calculating server comprehensive utilization rates corresponding to each server respectively according to the relevant performance index data; and determining a gray scale server according to the server comprehensive utilization rates, the number of servers in the load balancing cluster and a pre-configured gray scale ratio.The device executes the above method.The processing method and device for distributing gray scale provided in the embodiments of the application can reduce the workload of manual configuration information, optimize the distribution strategy of the gray scale server, and thus improve the server resource utilization rate in the load balancing cluster.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of data processing technology, and specifically to a method and apparatus for allocating grayscale values. Background Technology

[0002] Canary release testing is a common method for testing updated versions. Load balancing clusters include a large number of servers, which can greatly improve the efficiency of access request processing. Therefore, it is particularly important to determine the appropriate canary servers for canary release testing.

[0003] When an application is integrated with a software load balancer, existing technologies require configuring a canary forwarding strategy and including a canary flag when initiating a request. The value of the canary flag is inserted by the application into the cookies field of the HTTP header and passed to the SLB (Server Load Balancer). If the application does not include a canary flag, the SLB will default to load balancing to the application's normal group. The application determines whether canary deployment is needed; if so, it inserts a canary flag, and the SLB will then load balance to the application's canary group.

[0004] Currently, when applications are integrated with software load balancers, if the application needs to use the canary rollout forwarding function, a canary rollout identifier must be configured for each template on the software load balancer management platform. The application then includes the canary rollout identifier when making requests, and the load balancer cluster forwards the canary rollout requests to the application's canary rollout server by recognizing the identifier. If the application needs to expand the canary rollout scope, the canary rollout policy needs to be modified. Currently, each application relies on its own canary rollout policy to implement canary rollout forwarding configuration. The entire canary rollout policy configuration requires manual intervention, incurring significant manpower costs, resulting in low efficiency and low utilization of server resources in the load balancer cluster. Summary of the Invention

[0005] To address the problems in the prior art, embodiments of the present invention provide a method and apparatus for allocating grayscale, which can at least partially solve the problems existing in the prior art.

[0006] On one hand, the present invention proposes a method for allocating grayscale, comprising:

[0007] Obtain relevant performance metrics data for each server in the load balancing cluster;

[0008] The overall server utilization rate corresponding to each server is calculated based on the relevant performance index data.

[0009] The grayscale servers are determined based on the overall utilization rate of each server, the number of servers in the load balancing cluster, and the pre-configured grayscale ratio.

[0010] The calculation of the overall server utilization rate corresponding to each server based on relevant performance index data includes:

[0011] The overall utilization rate of the server system at the system level was calculated based on the first relevant performance index data at the system level for each server.

[0012] The overall utilization rate of the server application layer corresponding to each server is calculated based on the second relevant performance index data at the application layer.

[0013] The overall server utilization rate is calculated based on the overall utilization rate at the server system level and the overall utilization rate at the server application level.

[0014] The first relevant performance index data is obtained by converting the total CPU utilization, memory utilization, and memory swap space utilization respectively; correspondingly, the calculation of the server system-level comprehensive utilization rate corresponding to each server based on the first relevant performance index data at the system level includes:

[0015] The overall utilization rate of the server system is calculated based on the exponential function.

[0016] Wherein, the power of the exponential function is the sum of the converted total CPU utilization, the converted memory utilization, and the converted memory swap space utilization; the base of the exponential function is a real number greater than 1.

[0017] The second relevant performance index data is determined based on whether each performance index data at the application layer exceeds a corresponding preset threshold; correspondingly, the step of calculating the server application layer comprehensive utilization rate corresponding to each server based on the second relevant performance index data at the application layer includes:

[0018] The overall utilization rate of the server application layer is calculated based on a linear function.

[0019] Wherein, the independent variable of the linear function is the second relevant performance index data; the slope of the linear function is a real number greater than 0.

[0020] The step of determining the grayscale servers based on the overall utilization rate of each server, the number of servers in the load balancing cluster, and the pre-configured grayscale ratio includes:

[0021] If it is determined that the conversion result of the pre-configured grayscale ratio is less than the first preset value, then the server with the highest overall server utilization rate is determined as the grayscale server.

[0022] Wherein, the first preset value is the ratio of a preset baseline value to the number of servers.

[0023] The step of determining the grayscale servers based on the overall utilization rate of each server, the number of servers in the load balancing cluster, and the pre-configured grayscale ratio includes:

[0024] If it is determined that the conversion result of the pre-configured grayscale ratio is greater than or equal to the first preset value and less than the second preset value, then the b servers with the highest overall server utilization rate are determined as the grayscale servers.

[0025] Wherein, the second preset value is the ratio of the product of the preset baseline value and a to the number of servers; a is a positive integer greater than or equal to 2 and less than or equal to the number of servers; b is the smallest integer value among a whose conversion result conforming to the pre-configured grayscale ratio is less than the second preset value.

[0026] The grayscale allocation method further includes:

[0027] If the conversion result of the pre-configured grayscale ratio is determined to be equal to the preset benchmark value, then access requests are allocated in order of increasing overall utilization rate of each server.

[0028] On one hand, the present invention proposes a processing device for allocating gray levels, comprising:

[0029] The acquisition unit is used to acquire relevant performance indicator data corresponding to each server in the load balancing cluster.

[0030] The calculation unit is used to calculate the overall server utilization rate corresponding to each server based on the relevant performance index data.

[0031] The determining unit is used to determine the grayscale servers based on the overall utilization rate of each server, the number of servers in the load balancing cluster, and the pre-configured grayscale ratio.

[0032] In another aspect, embodiments of the present invention provide an electronic device, including: a processor, a memory, and a bus, wherein,

[0033] The processor and the memory communicate with each other via the bus;

[0034] The memory stores program instructions that can be executed by the processor, and the processor can execute the following methods by calling the program instructions:

[0035] Obtain relevant performance metrics data for each server in the load balancing cluster;

[0036] The overall server utilization rate corresponding to each server is calculated based on the relevant performance index data.

[0037] The grayscale servers are determined based on the overall utilization rate of each server, the number of servers in the load balancing cluster, and the pre-configured grayscale ratio.

[0038] This invention provides a non-transitory computer-readable storage medium, comprising:

[0039] The non-transitory computer-readable storage medium stores computer instructions that cause the computer to perform the following methods:

[0040] Obtain relevant performance metrics data for each server in the load balancing cluster;

[0041] The overall server utilization rate corresponding to each server is calculated based on the relevant performance index data.

[0042] The grayscale servers are determined based on the overall utilization rate of each server, the number of servers in the load balancing cluster, and the pre-configured grayscale ratio.

[0043] The grayscale allocation method and apparatus provided in this invention obtain relevant performance index data corresponding to each server in the load balancing cluster; calculate the overall server utilization rate corresponding to each server based on the relevant performance index data; and determine the grayscale server based on the overall server utilization rate, the number of servers in the load balancing cluster, and the pre-configured grayscale ratio. This reduces the workload of manual configuration information and optimizes the allocation strategy for grayscale servers, thereby improving the utilization rate of server resources in the load balancing cluster. Attached Figure Description

[0044] To more clearly illustrate the technical solutions in the embodiments of the present invention 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 only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort. In the drawings:

[0045] Figure 1 This is a schematic flowchart of a grayscale allocation method provided in an embodiment of the present invention.

[0046] Figure 2 This is a flowchart illustrating a grayscale allocation method provided in another embodiment of the present invention.

[0047] Figure 3 This is a schematic diagram of the modular structure of the grayscale allocation processing method provided in the embodiments of the present invention.

[0048] Figure 4 This is a schematic diagram of the structure of a grayscale distribution processing device provided in an embodiment of the present invention.

[0049] Figure 5 This is a schematic diagram of the physical structure of an electronic device provided in an embodiment of the present invention. Detailed Implementation

[0050] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the embodiments of the present invention will be further described in detail below with reference to the accompanying drawings. Here, the illustrative embodiments and descriptions of the present invention are used to explain the present invention, but are not intended to limit the present invention. It should be noted that, unless otherwise specified, the embodiments and features in the embodiments of this application can be arbitrarily combined with each other.

[0051] Explanation of relevant terms:

[0052] Gray-scale release: Gray-scale release refers to a release method that allows for a smooth transition. It allows a subset of users to experience new services or features while another subset continues with the existing services or features. Gray-scale releases enable timely detection of problems and control of the impact when new features are launched, ensuring the overall stability of the system.

[0053] Load balancing: Load balancing refers to the even and balanced distribution of load, such as access requests, to backend servers, ensuring that no single server in the cluster will be overloaded and cause performance abnormalities when there is a high volume of business.

[0054] Server overall utilization rate: The overall utilization rate is an indicator calculated from system performance indicators and application layer indicators according to a certain formula, which can effectively reflect the performance of the server.

[0055] Figure 1 This is a flowchart illustrating a grayscale allocation method according to an embodiment of the present invention, as shown below. Figure 1 As shown, the grayscale allocation method provided in this embodiment of the invention includes:

[0056] Step S1: Obtain the relevant performance metrics data corresponding to each server in the load balancing cluster.

[0057] Step S2: Calculate the overall server utilization rate corresponding to each server based on the relevant performance index data.

[0058] Step S3: Determine the grayscale servers based on the overall utilization rate of each server, the number of servers in the load balancing cluster, and the pre-configured grayscale ratio.

[0059] In step S1 above, the device acquires relevant performance indicator data corresponding to each server in the load balancing cluster. The device can be a computer device executing the method, for example, it can include a server, specifically a load balancing cluster management server. It should be noted that the acquisition and analysis of data involved in this embodiment of the invention are authorized by the user. The relevant performance indicator data can include first relevant performance indicator data at the system level and second relevant performance indicator data at the application level; wherein:

[0060] The first relevant performance metric data is obtained by converting the total CPU utilization, memory utilization, and memory swap space utilization. The memory swap space utilization is the same as the swap space utilization. Since the total CPU utilization, memory utilization, and memory swap space utilization are all percentage expressions, the conversion method can be to remove the percentage sign. Taking the total CPU utilization as an example, if the total CPU utilization of server 1 is 50%, then the converted total CPU utilization of server 1 is 50%.

[0061] The second set of relevant performance metrics is determined based on whether each performance metric at the application level exceeds a corresponding preset threshold. The preset thresholds can correspond to each performance metric at the application level, which can be one of the following seven performance metrics:

[0062] Concurrent connections, new connections per second, IDLE idle rate, requests per second, response time, current connections, and new requests per second.

[0063] The data for determining the second relevant performance index are explained as follows:

[0064] For each of the above performance index data, if it exceeds the corresponding preset threshold, the second related performance index data is incremented by 1. It can be understood that the value range of the second related performance index data is between 0 and 7.

[0065] In step S2 above, the device calculates the overall server utilization rate corresponding to each server based on the relevant performance index data.

[0066] The calculation of the overall server utilization rate corresponding to each server based on the relevant performance index data includes:

[0067] The overall server system utilization rate for each server is calculated based on the first relevant performance index data at the system level; the calculation of the overall server system utilization rate for each server based on the first relevant performance index data at the system level includes:

[0068] The overall utilization rate of the server system is calculated based on the exponential function.

[0069] Wherein, the exponential function is the sum of the converted total CPU utilization, the converted memory utilization, and the converted memory swap space utilization; the base of the exponential function is a real number greater than 1. Specifically, the overall server system utilization can be calculated using the following formula:

[0070] y1=a1 cpu+mem+swap

[0071] Where y1 is the overall utilization rate at the server system level, a1 is the base of the exponential function, a1>1, cpu, mem and swap are the converted total CPU utilization rate, converted memory utilization rate and converted memory swap space utilization rate, respectively, which can be represented by x1 as cpu+mem+swap, and can be understood as 0<x1≤300.

[0072] The overall utilization rate of the server application layer corresponding to each server is calculated based on the second relevant performance index data at the application layer; the calculation of the overall utilization rate of the server application layer corresponding to each server based on the second relevant performance index data at the application layer includes:

[0073] The overall utilization rate of the server application layer is calculated based on a linear function.

[0074] Wherein, the independent variable of the linear function is the second relevant performance index data; the slope of the linear function is a real number greater than 0. Specifically, the overall utilization rate of the server application layer can be calculated using the following formula:

[0075] y2=a2x2

[0076] Where y2 is the overall utilization rate of the server application layer, a2 is the slope of the linear function, a2>0, and x2 is the second relevant performance index data, 0≤x2≤7.

[0077] Since the relationship between system metrics and server performance in the production environment is not a simple linear one, and server performance changes more significantly when system metrics change, an exponential function is used to represent the overall utilization rate at the server system level.

[0078] Since there is a simple linear relationship between application metrics and server performance, and server performance changes proportionally when application metrics change, a linear function is used to represent the overall utilization rate of the server application layer.

[0079] The overall server utilization rate is calculated based on the overall server system utilization rate and the overall server application utilization rate. Specifically, the overall server utilization rate y can be calculated using the following formula:

[0080]

[0081] In step S3 above, the device determines the gray-scale servers based on the overall utilization rate of each server, the number of servers in the load balancing cluster, and the pre-configured gray-scale ratio. The pre-configured gray-scale ratio can be set independently according to actual conditions to represent the ratio of the number of users using the new service or function to the total number of users; the total number of users includes the sum of the number of users using the new service or function and the number of users maintaining the old service or function.

[0082] The step of determining the gray-scale servers based on the overall utilization rate of each server, the number of servers in the load balancing cluster, and the pre-configured gray-scale ratio includes:

[0083] If it is determined that the conversion result of the pre-configured grayscale ratio is less than the first preset value, then the server with the highest overall server utilization rate is determined as the grayscale server.

[0084] Wherein, the first preset value is the ratio of the preset baseline value to the number of servers. The conversion method for the pre-configured grayscale ratio can be to remove the percentage sign. If the pre-configured grayscale ratio is 15%, then the conversion result of the pre-configured grayscale ratio is p = 15.

[0085] The preset baseline value can be set independently according to the actual situation, and can be selected as 100. The number of servers n can be selected as 5. Since p < 100 / 5, the conversion result of the pre-configured gray scale ratio is less than the first preset value. Therefore, the server with the highest overall server utilization rate can be determined as the gray scale server.

[0086] Since p=15, its value is less than the average traffic ratio of 20 in the load balancing cluster (obtained by 100 / 5). According to the above explanation of grayscale, it can be understood that the number of users using the newly added service or function is less than the average traffic ratio. In order to alleviate the server performance pressure as evenly as possible, the server with the highest overall server utilization can be used as the grayscale server, so that the traffic ratio allocated to this grayscale server is less than 20.

[0087] The step of determining the gray-scale servers based on the overall utilization rate of each server, the number of servers in the load balancing cluster, and the pre-configured gray-scale ratio includes:

[0088] If it is determined that the conversion result of the pre-configured grayscale ratio is greater than or equal to the first preset value and less than the second preset value, then the b servers with the highest overall server utilization rate are determined as the grayscale servers.

[0089] Wherein, the second preset value is the ratio of the product of the preset baseline value and 'a' to the number of servers; 'a' is a positive integer greater than or equal to 2 and less than or equal to the number of servers; 'b' is the smallest integer value among 'a's that meets the condition that the conversion result of the pre-configured grayscale ratio is less than the second preset value. Referring to the above example, if the pre-configured grayscale ratio is 45%, then p = 45, p > 100 / 5. Since the value of 'a' is [2, n), the second preset value = 100a / 5, its maximum value is less than 100 (when a = n = 5), and its minimum value is greater than or equal to 40 (when a = 2). If a = 2, then p = 45 > 100 × 2 / 5 = 40, which does not meet the condition that the conversion result of the pre-configured grayscale ratio is less than the second preset value.

[0090] Add 1 to a. At this time, p = 45 < 100 × 3 / 5 = 60. That is, the condition is met when a = 3. That is, 3 is the smallest integer value of a that meets the conversion result of the pre-configured gray scale ratio and is less than the second preset value. Therefore, b is 3. The three servers with the highest overall server utilization rate are determined as gray scale servers.

[0091] The grayscale allocation method further includes:

[0092] If the conversion result of the pre-configured grayscale ratio is determined to be equal to the preset baseline value, then access requests are allocated according to the order of the overall utilization rate of each server from lowest to highest. If p = 100, that is, all users are using the new service or function, and no user is maintaining the old service or function, then access requests are allocated according to the order of the overall utilization rate of each server from lowest to highest.

[0093] like Figure 2 As shown, after the step of determining the grayscale servers based on the overall utilization rate of each server, the number of servers in the load balancing cluster, and the pre-configured grayscale ratio, the grayscale allocation method further includes:

[0094] The storage server records information; the server records information includes the number of first access requests processed by the grayscale server and the number of second access requests processed by the non-grayscale server (normal server);

[0095] The consistency of the grayscale ratio is verified based on the server record information. The ratio of the first access request number to the total number of access requests is calculated. If the ratio is consistent with the pre-configured grayscale ratio, the consistency verification result of the grayscale ratio is passed.

[0096] If the above ratio is inconsistent with the pre-configured grayscale ratio, the consistency check result of the grayscale ratio will fail, and an alarm message indicating that the consistency check result of the grayscale ratio has failed can be generated.

[0097] After the step of determining the grayscale servers based on the overall utilization rate of each server, the number of servers in the load balancing cluster, and the pre-configured grayscale ratio, the grayscale allocation method further includes:

[0098] The consistency of the pre-configured canary scale ratios across all servers in the load balancing cluster is checked. These pre-configured canary scale ratios can be stored in advance on each server and need to be updated periodically. If a server fails to update its pre-configured canary scale ratio in a timely manner, it will result in inconsistency between the pre-configured canary scale ratios on that server and those on other servers. Therefore, the consistency check result for the pre-configured canary scale ratios across all servers will be failed.

[0099] like Figure 3 As shown, the grayscale allocation method provided in this embodiment of the invention can be implemented based on modularity, specifically including:

[0100] The intelligent gray-scale forwarding and dynamic adjustment system consists of the following five modules: performance acquisition module 101, gray-scale configuration management module 102, gray-scale processing and allocation module 103, record storage module 104, and consistency verification module 105; among which:

[0101] Performance Acquisition Module 101: This module is responsible for collecting performance metrics data related to the load balancing cluster, including system-level and application-level data. System-level data mainly includes: total CPU utilization, memory utilization, and swap space utilization. Application-level data mainly includes: concurrent connections, new connections per second, idle rate, requests per second, response time, current connections, and new requests per second. The collected data is periodically sent to the canary deployment allocation module 103.

[0102] Gray-scale configuration management module 102: This module is responsible for storing the gray-scale rules and gray-scale ratios configured for the application, and supports users to actively adjust the ratios and send the adjusted ratios to the gray-scale processing and allocation module 103.

[0103] Gray-scale processing and allocation module 103: This module has two main responsibilities. One part is to calculate the overall utilization rate of servers within the cluster based on the performance data transmitted by the performance acquisition module 101 using a certain algorithm. The other part is to integrate and add identifiers based on the configuration sent by the gray-scale configuration management module 102, and achieve load balancing according to the sent ratio and the calculated overall utilization rate. The allocated and forwarded records are sent to the record storage module 104.

[0104] Record storage module 104: This module is responsible for receiving records sent by the grayscale processing and allocation module 103 for subsequent consistency verification. It also stores logs from other modules for later review.

[0105] Consistency Verification Module 105: This module is responsible for periodically collecting forwarding records from the record storage and verifying whether the grayscale and non-grayscale ratios are consistent with those in the grayscale configuration management module 102. It also checks the consistency of configuration files on each server in the load balancing cluster. If an inconsistency is detected, an exception message is sent to the monitoring system to notify the operations and maintenance personnel.

[0106] A load balancing cluster can consist of n homogeneous servers responsible for forwarding application requests. The canary deployment rules, forwarding strategies, application versions, and system specifications across these servers must be consistent. The intelligent canary forwarding and dynamic adjustment system's internal modules provide performance monitoring, canary distribution, and consistency verification capabilities for the cluster.

[0107] The grayscale allocation method provided in this invention eliminates the need for manual configuration of grayscale identifiers, simplifies the workload of grayscale-related modifications on the application side, can calculate the overall utilization rate in real time based on system performance indicators and application performance indicators, and can dynamically adjust the allocation of grayscale servers according to the grayscale ratio while alleviating server performance pressure and improving resource utilization. It is more flexible than the current application-side grayscale identifier method.

[0108] The gray-scale allocation method provided in this invention obtains relevant performance index data corresponding to each server in the load balancing cluster; calculates the overall server utilization rate corresponding to each server based on the relevant performance index data; and determines the gray-scale servers based on the overall server utilization rate, the number of servers in the load balancing cluster, and the pre-configured gray-scale ratio. This method can reduce the workload of manual configuration information and optimize the allocation strategy of gray-scale servers, thereby improving the utilization rate of server resources in the load balancing cluster.

[0109] Furthermore, the calculation of the overall server utilization rate corresponding to each server based on the relevant performance index data includes:

[0110] The overall utilization rate of the server system is calculated based on the first relevant performance index data at the system level, corresponding to each server; the description in the above embodiment is as described above and will not be repeated here.

[0111] The overall utilization rate of the server application layer corresponding to each server is calculated based on the second relevant performance index data at the application layer; the description in the above embodiment can be referred to, and will not be repeated here.

[0112] The overall server utilization rate is calculated based on the overall utilization rate at the server system level and the overall utilization rate at the server application level. This can be referred to the description in the above embodiments, and will not be repeated here.

[0113] The grayscale allocation method provided in this embodiment of the invention can accurately calculate the overall utilization rate of the server.

[0114] Furthermore, the first relevant performance index data is obtained by converting the total CPU utilization, memory utilization, and memory swap space utilization respectively; correspondingly, the calculation of the server system-level comprehensive utilization rate corresponding to each server based on the first relevant performance index data at the system level includes:

[0115] The overall utilization rate of the server system is calculated based on the exponential function; the description in the above embodiment is as described above and will not be repeated here.

[0116] Wherein, the exponential function is the sum of the calculated total CPU utilization, the calculated memory utilization, and the calculated memory swap space utilization; the base of the exponential function is a real number greater than 1. Refer to the description in the above embodiments; further details are omitted.

[0117] The grayscale allocation method provided in this embodiment of the invention can accurately calculate the overall utilization rate at the server system level.

[0118] Furthermore, the second relevant performance index data is determined based on whether each performance index data at the application layer exceeds a corresponding preset threshold; correspondingly, the step of calculating the server application layer comprehensive utilization rate corresponding to each server based on the second relevant performance index data at the application layer includes:

[0119] The overall utilization rate of the server application layer is calculated based on a linear function; the description in the above embodiment is provided and will not be repeated here.

[0120] Wherein, the independent variable of the linear function is the second relevant performance index data; the slope of the linear function is a real number greater than 0. Refer to the description of the above embodiments; further details are omitted here.

[0121] The grayscale allocation method provided in this embodiment of the invention can accurately calculate the overall utilization rate of the server application layer.

[0122] Furthermore, determining the grayscale servers based on the overall utilization rate of each server, the number of servers in the load balancing cluster, and the pre-configured grayscale ratio includes:

[0123] If the conversion result of the pre-configured grayscale ratio is determined to be less than the first preset value, then the server with the highest overall server utilization rate is determined as the grayscale server; the description in the above embodiment can be referred to, and will not be repeated here.

[0124] Wherein, the first preset value is the ratio of a preset baseline value to the number of servers. This can be referred to the description in the above embodiments, and will not be repeated here.

[0125] The grayscale allocation method provided in this embodiment of the invention can further reasonably determine the grayscale server.

[0126] Furthermore, determining the grayscale servers based on the overall utilization rate of each server, the number of servers in the load balancing cluster, and the pre-configured grayscale ratio includes:

[0127] If it is determined that the conversion result of the pre-configured grayscale ratio is greater than or equal to the first preset value and less than the second preset value, then the b servers with the highest overall server utilization rate are determined as the grayscale servers; the description in the above embodiment can be referred to, and will not be repeated here.

[0128] Wherein, the second preset value is the ratio of the product of the preset baseline value and 'a' to the number of servers; 'a' is a positive integer greater than or equal to 2 and less than or equal to the number of servers; and 'b' is the smallest integer value among 'a' whose conversion result conforms to the pre-configured grayscale ratio is less than the second preset value. Refer to the description of the above embodiments; further details are omitted.

[0129] The grayscale allocation method provided in this embodiment of the invention can further reasonably determine the grayscale server.

[0130] Furthermore, the grayscale allocation method further includes:

[0131] If the conversion result of the pre-configured grayscale ratio is determined to be equal to the preset baseline value, then access requests are allocated according to the overall utilization rate of each server in ascending order. Refer to the description in the above embodiments; further details will not be repeated here.

[0132] The grayscale allocation method provided in this embodiment of the invention can further allocate traffic reasonably according to the load balancing strategy.

[0133] It should be noted that the grayscale allocation processing method provided in this embodiment of the invention can be used in the financial field, or in any technical field other than the financial field. This embodiment of the invention does not limit the application field of the grayscale allocation processing method.

[0134] Figure 4 This is a schematic diagram of the structure of a grayscale distribution processing device provided in an embodiment of the present invention, as shown below. Figure 4 As shown, the grayscale allocation processing device provided in this embodiment of the invention includes an acquisition unit 401, a calculation unit 402, and a determination unit 403, wherein:

[0135] The acquisition unit 401 is used to acquire relevant performance index data corresponding to each server in the load balancing cluster; the calculation unit 402 is used to calculate the overall server utilization rate corresponding to each server based on the relevant performance index data; the determination unit 403 is used to determine the grayscale server based on the overall server utilization rate, the number of servers in the load balancing cluster, and the pre-configured grayscale ratio.

[0136] Specifically, the acquisition unit 401 in the device is used to acquire relevant performance index data corresponding to each server in the load balancing cluster; the calculation unit 402 is used to calculate the overall server utilization rate corresponding to each server based on the relevant performance index data; and the determination unit 403 is used to determine the grayscale server based on the overall server utilization rate, the number of servers in the load balancing cluster, and the pre-configured grayscale ratio.

[0137] The grayscale allocation processing device provided in this embodiment of the invention obtains relevant performance index data corresponding to each server in the load balancing cluster; calculates the overall server utilization rate corresponding to each server based on the relevant performance index data; and determines the grayscale server based on the overall server utilization rate, the number of servers in the load balancing cluster, and the pre-configured grayscale ratio. This reduces the workload of manual configuration information and optimizes the allocation strategy for grayscale servers, thereby improving the utilization rate of server resources in the load balancing cluster.

[0138] Furthermore, the computing unit 402 is specifically used for:

[0139] The overall utilization rate of the server system at the system level was calculated based on the first relevant performance index data at the system level for each server.

[0140] The overall utilization rate of the server application layer corresponding to each server is calculated based on the second relevant performance index data at the application layer.

[0141] The overall server utilization rate is calculated based on the overall utilization rate at the server system level and the overall utilization rate at the server application level.

[0142] The grayscale allocation processing device provided in this embodiment of the invention can accurately calculate the overall utilization rate of the server.

[0143] Furthermore, the first relevant performance index data is obtained by converting the total CPU utilization, memory utilization, and memory swap space utilization respectively; correspondingly, the calculation unit 402 is also specifically used for:

[0144] The overall utilization rate of the server system is calculated based on the exponential function.

[0145] Wherein, the power of the exponential function is the sum of the converted total CPU utilization, the converted memory utilization, and the converted memory swap space utilization; the base of the exponential function is a real number greater than 1.

[0146] The grayscale allocation processing device provided in this embodiment of the invention can accurately calculate the overall utilization rate at the server system level.

[0147] Furthermore, the second relevant performance index data is determined based on whether the performance index data at the application layer exceeds the corresponding preset threshold; correspondingly, the calculation unit 402 is also specifically used for:

[0148] The overall utilization rate of the server application layer is calculated based on a linear function.

[0149] Wherein, the independent variable of the linear function is the second relevant performance index data; the slope of the linear function is a real number greater than 0.

[0150] The grayscale allocation processing device provided in this embodiment of the invention can accurately calculate the overall utilization rate of the server application layer.

[0151] Furthermore, the determining unit 403 is specifically used for:

[0152] If it is determined that the conversion result of the pre-configured grayscale ratio is less than the first preset value, then the server with the highest overall server utilization rate is determined as the grayscale server.

[0153] Wherein, the first preset value is the ratio of a preset baseline value to the number of servers.

[0154] The grayscale allocation processing device provided in this embodiment of the invention can further reasonably determine the grayscale server.

[0155] Furthermore, the determining unit 403 is specifically used for:

[0156] If it is determined that the conversion result of the pre-configured grayscale ratio is greater than or equal to the first preset value and less than the second preset value, then the b servers with the highest overall server utilization rate are determined as the grayscale servers.

[0157] Wherein, the second preset value is the ratio of the product of the preset baseline value and a to the number of servers; a is a positive integer greater than or equal to 2 and less than or equal to the number of servers; b is the smallest integer value among a whose conversion result conforming to the pre-configured grayscale ratio is less than the second preset value.

[0158] The grayscale allocation processing device provided in this embodiment of the invention can further reasonably determine the grayscale server.

[0159] Furthermore, the grayscale allocation processing device is also used for:

[0160] If the conversion result of the pre-configured grayscale ratio is determined to be equal to the preset benchmark value, then access requests are allocated in order of increasing overall utilization rate of each server.

[0161] The grayscale allocation processing device provided in this embodiment of the invention can further allocate traffic reasonably according to the load balancing strategy.

[0162] The embodiments of the present invention provide a processing device for allocating grayscale, which can be used to execute the processing flow of the above-described method embodiments. Its functions will not be repeated here, but can be referred to the detailed description of the above-described method embodiments.

[0163] Figure 5 This is a schematic diagram of the physical structure of an electronic device provided in an embodiment of the present invention, such as... Figure 5 As shown, the electronic device includes: a processor 501, a memory 502, and a bus 503;

[0164] The processor 501 and the memory 502 communicate with each other via the bus 503.

[0165] The processor 501 is used to call program instructions in the memory 502 to execute the methods provided in the above-described method embodiments, including, for example:

[0166] Obtain relevant performance metrics data for each server in the load balancing cluster;

[0167] The overall server utilization rate corresponding to each server is calculated based on the relevant performance index data.

[0168] The grayscale servers are determined based on the overall utilization rate of each server, the number of servers in the load balancing cluster, and the pre-configured grayscale ratio.

[0169] This embodiment discloses a computer program product, which includes a computer program stored on a non-transitory computer-readable storage medium. The computer program includes program instructions, and when the program instructions are executed by a computer, the computer can perform the methods provided in the above-described method embodiments, such as:

[0170] Obtain relevant performance metrics data for each server in the load balancing cluster;

[0171] The overall server utilization rate corresponding to each server is calculated based on the relevant performance index data.

[0172] The grayscale servers are determined based on the overall utilization rate of each server, the number of servers in the load balancing cluster, and the pre-configured grayscale ratio.

[0173] This embodiment provides a computer-readable storage medium storing a computer program that causes the computer to execute the methods provided in the above-described method embodiments, including, for example:

[0174] Obtain relevant performance metrics data for each server in the load balancing cluster;

[0175] The overall server utilization rate corresponding to each server is calculated based on the relevant performance index data.

[0176] The grayscale servers are determined based on the overall utilization rate of each server, the number of servers in the load balancing cluster, and the pre-configured grayscale ratio.

[0177] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0178] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0179] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0180] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0181] In the description of this specification, the references to terms such as "an embodiment," "a specific embodiment," "some embodiments," "for example," "example," "specific example," or "some examples," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of the invention. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples.

[0182] The specific embodiments described above further illustrate the purpose, technical solution, and beneficial effects of the present invention. It should be understood that the above descriptions are merely specific embodiments of the present invention and are not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.

Claims

1. A processing method of distributing a gray scale, characterized by, The method comprises the following steps: obtaining performance index data corresponding to each server in a load balancing cluster, wherein the performance index data comprises first performance index data at a system level and second performance index data at an application level, the first performance index data is obtained by converting CPU total usage, memory usage and memory swap space usage, and the second performance index data is obtained by adding one to each performance index data at the application level when the performance index data exceeds a corresponding preset threshold value; calculating server comprehensive usage corresponding to each server according to the performance index data, wherein the server comprehensive usage is calculated according to the first performance index data and the second performance index data; determining a gray server according to the server comprehensive usage, the number of servers in the load balancing cluster and a preconfigured gray ratio, wherein if a conversion result of the preconfigured gray ratio is less than a first preset value, a server with the maximum server comprehensive usage is determined as the gray server, wherein the first preset value is a ratio of a preset reference value to the number of servers, if the conversion result of the preconfigured gray ratio is greater than or equal to the first preset value and less than a second preset value, b servers with the maximum server comprehensive usage are determined as the gray server, wherein the second preset value is a ratio of a product of the preset reference value and a to the number of servers, a is a positive integer greater than or equal to 2 and less than or equal to the number of servers, and b is the minimum integer value of a that satisfies the conversion result of the preconfigured gray ratio being less than the second preset value; detecting consistency of the preconfigured gray ratio in each server in the load balancing cluster; The calculation formula of the server comprehensive utilization rate is: ; is the server system layer comprehensive utilization rate, a1 is the base number of the exponential function, a1>1, x1 is the sum of the converted CPU total utilization rate, the converted memory utilization rate and the converted memory swap space utilization rate; a2x2 is the server application layer comprehensive utilization rate, is the slope of the linear function, , is the second related performance index data.

2. The gradation distribution processing method according to claim 1, characterized by, the method of calculating server comprehensive usage corresponding to each server according to the performance index data comprises the following steps: calculating server system level comprehensive usage corresponding to each server according to the first performance index data at the system level; calculating server application level comprehensive usage corresponding to each server according to the second performance index data at the application level; calculating the server comprehensive usage according to the server system level comprehensive usage and the server application level comprehensive usage.

3. The gradation distribution processing method according to claim 2, characterized by, the method of calculating server system level comprehensive usage corresponding to each server according to the first performance index data at the system level comprises the following steps: calculating the server system level comprehensive usage according to an exponential function; wherein the power of the exponential function is a sum of the converted CPU total usage, the converted memory usage and the converted memory swap space usage, and the base of the exponential function is a real number greater than 1.

4. The gradation distribution processing method according to claim 2, characterized by, the method of calculating server application level comprehensive usage corresponding to each server according to the second performance index data at the application level comprises the following steps: calculating the server application level comprehensive usage according to a linear function; The independent variable of the linear function is the second correlation performance index data; and the slope of the linear function is a real number greater than 0.

5. The gradation distribution processing method according to claim 1, characterized by, The processing method for allocating the gray scale further includes: If it is determined that the conversion result of the pre-configured gray scale ratio is equal to the preset reference value, the access request is allocated according to the order of the server comprehensive utilization rates from small to large.

6. A processing device for distributing a gray scale, characterized by Comprise: The acquisition unit is configured to acquire correlation performance index data corresponding to each server in the load balancing cluster, the correlation performance index data including first correlation performance index data at a system level and second correlation performance index data at an application level, the first correlation performance index data being obtained by converting CPU total utilization rate, memory utilization rate and memory swap space utilization rate respectively, and the second correlation performance index data being determined by adding one when each performance index data at the application level exceeds a corresponding preset threshold value; The calculation unit is configured to calculate server comprehensive utilization rates corresponding to each server respectively according to the correlation performance index data, the server comprehensive utilization rates being calculated according to the first correlation performance index data and the second correlation performance index data; The determination unit is configured to determine a gray scale server according to the server comprehensive utilization rates, the number of servers in the load balancing cluster and a pre-configured gray scale ratio. The consistency of the pre-configured gray scale ratio in each server in the load balancing cluster is detected, including: if it is determined that the conversion result of the pre-configured gray scale ratio is less than a first preset value, a server with the largest server comprehensive utilization rate is determined as the gray scale server; wherein the first preset value is a ratio of a preset reference value to the number of servers; if it is determined that the conversion result of the pre-configured gray scale ratio is greater than or equal to the first preset value and less than a second preset value, b servers with the largest server comprehensive utilization rate are determined as the gray scale servers; wherein the second preset value is a ratio of a product of the preset reference value and a to the number of servers; the a is a positive integer greater than or equal to 2 and less than or equal to the number of servers; the b is the smallest integer value in the a that satisfies the conversion result of the pre-configured gray scale ratio being less than the second preset value; the consistency of the pre-configured gray scale ratio in each server in the load balancing cluster is detected. The calculation formula of the server comprehensive utilization rate is: ; is the server system layer comprehensive utilization rate, a1 is the base number of the exponential function, a1>1, x1 is the sum of the converted CPU total utilization rate, the converted memory utilization rate and the converted memory swap space utilization rate; a2x2 is the server application layer comprehensive utilization rate, is the slope of the linear function, , is the second related performance index data.

7. An electronic device comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, The processor executes the computer program to implement the steps of the method of any one of claims 1 to 5.

8. A computer-readable storage medium having stored thereon a computer program, characterized in that, The computer program is executed by the processor to implement the steps of the method of any one of claims 1 to 5.

Citation Information

Patent Citations

  • Gray release management method, system and device and storage medium

    CN110071960A

  • Micro-service scheduling method, device and equipment and storage device

    CN110806930A

  • Gray release method and system

    CN111949311A