An automated flow limiting process and apparatus
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- INDUSTRIAL AND COMMERCIAL BANK OF CHINA
- Filing Date
- 2021-12-16
- Publication Date
- 2026-07-07
AI Technical Summary
Existing automated rate limiting methods cannot be planned in a coordinated manner at the entire service level, which may result in downstream services being overloaded and failing to trigger the rate limiting mechanism in time.
By obtaining the maximum utilization rate of a single server's hardware, the current performance capacity of the service, and the performance capacity of downstream services, the overall performance index is calculated and compared with the preset rate limiting threshold to determine whether to automatically limit the overall service.
It enables automated rate limiting at the entire service level, thereby improving service performance and quality.
Smart Images

Figure CN114185681B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of server technology, and specifically to an automated rate limiting method and apparatus. Background Technology
[0002] To ensure good service performance, it is especially important to implement automated rate limiting.
[0003] Existing automated rate limiting methods set rate limiting thresholds for individual devices or services. When a device or service reaches its threshold, rate limiting is implemented. However, these methods limit rates at a local level within the overall service and cannot be planned holistically at the service level. This can lead to a situation where rate limiting is only triggered when a service reaches its maximum performance capacity, while downstream services may already be operating beyond capacity. Summary of the Invention
[0004] To address the problems in the prior art, embodiments of the present invention provide an automated current limiting method and apparatus, which can at least partially solve the problems existing in the prior art.
[0005] On the one hand, this invention proposes an automated current limiting method, comprising:
[0006] The maximum utilization rate of a single server hardware is obtained, and the overall maximum utilization rate of the service hardware is determined based on the number of single servers in the service and the maximum utilization rate of a single server hardware; wherein, the maximum utilization rate of a single server hardware is the utilization rate of the hardware with the highest utilization rate value in a single server.
[0007] Obtain the current performance capacity of the service and the maximum performance capacity that the service can support, and obtain the current performance capacity and the maximum performance capacity that the downstream services of the service can support.
[0008] Based on the overall maximum hardware utilization of the service, the current performance capacity of the service, the maximum performance capacity that the service can support, the current performance capacity of the downstream service, and the maximum performance capacity that the downstream service can support, an overall performance index value reflecting the overall service is determined. Based on the comparison result between the overall performance index value and the preset overall service rate limiting threshold, it is determined whether to perform automatic rate limiting on the overall service.
[0009] The hardware of a single server includes at least two of the following: CPU, memory, disk, and network; correspondingly, obtaining the maximum utilization rate of the single server hardware includes:
[0010] The maximum utilization rate of the single server hardware is obtained by comparing the utilization rates of at least two of the following: overall CPU utilization, overall memory utilization, overall disk utilization, and overall network utilization. The overall disk utilization rate is the ratio of the current disk read / write rate to the maximum disk read / write rate, and the overall network utilization rate is the ratio of the current network read / write rate to the current server network bandwidth.
[0011] The step of determining the overall maximum hardware utilization of the service based on the number of individual servers in the service and the maximum hardware utilization of individual servers includes:
[0012] The sum of the maximum utilization rates of each individual server is used as the ratio of the sum of the maximum utilization rates of each individual server to the total number of individual servers, which is taken as the overall maximum utilization rate of the service hardware.
[0013] The step of determining whether to automatically limit the overall service based on the comparison between the overall performance index value and the preset overall service rate limiting threshold includes:
[0014] If the overall performance index value is greater than the preset overall service rate limiting threshold, then it is determined that the overall service will be subject to automated rate limiting.
[0015] If the overall performance index value is less than or equal to the preset overall service rate limiting threshold, then it is determined that no automatic rate limiting will be applied to the overall service.
[0016] The step of determining the overall performance index value reflecting the overall service based on the service's overall maximum hardware utilization, the service's current performance capacity, the service's maximum performance capacity, the downstream service's current performance capacity, and the downstream service's maximum performance capacity includes:
[0017] The service load level is calculated based on the current performance capacity of the service and the maximum performance capacity that the service can support; the service load level of the downstream service is calculated based on the current performance capacity of the downstream service and the maximum performance capacity that the downstream service can support.
[0018] The overall performance index value reflecting the overall service is determined based on the maximum hardware utilization rate of the service, the service busyness level of the service, the service busyness level of the downstream services, and their respective weights.
[0019] The automated rate limiting method further includes:
[0020] If the service does not have downstream services, the preset overall service rate limiting threshold is used to replace the service busyness of the downstream services, and an overall performance index value reflecting the overall service is determined.
[0021] On one hand, the present invention proposes an automated current limiting processing device, comprising:
[0022] The determination module is used to obtain the maximum utilization rate of a single server hardware and determine the overall maximum utilization rate of the service hardware based on the number of all single servers in the service and the maximum utilization rate of a single server hardware; wherein, the maximum utilization rate of a single server hardware is the utilization rate of the hardware with the highest utilization rate value in a single server.
[0023] The acquisition module is used to acquire the current performance capacity of the service and the maximum performance capacity that the service can bear, as well as the current performance capacity and the maximum performance capacity that the downstream service of the service can bear.
[0024] The rate limiting module is used to determine the overall performance index value reflecting the overall service based on the overall maximum hardware utilization of the service, the current performance capacity of the service, the maximum performance capacity that the service can bear, the current performance capacity of the downstream service, and the maximum performance capacity that the downstream service can bear, and to determine whether to perform automatic rate limiting on the overall service based on the comparison result of the overall performance index value and the preset overall service rate limiting threshold.
[0025] In another aspect, embodiments of the present invention provide an electronic device, including: a processor, a memory, and a bus, wherein,
[0026] The processor and the memory communicate with each other via the bus;
[0027] 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:
[0028] The maximum utilization rate of a single server hardware is obtained, and the overall maximum utilization rate of the service hardware is determined based on the number of single servers in the service and the maximum utilization rate of a single server hardware; wherein, the maximum utilization rate of a single server hardware is the utilization rate of the hardware with the highest utilization rate value in a single server.
[0029] Obtain the current performance capacity of the service and the maximum performance capacity that the service can support, and obtain the current performance capacity and the maximum performance capacity that the downstream services of the service can support.
[0030] Based on the overall maximum hardware utilization of the service, the current performance capacity of the service, the maximum performance capacity that the service can support, the current performance capacity of the downstream service, and the maximum performance capacity that the downstream service can support, an overall performance index value reflecting the overall service is determined. Based on the comparison result between the overall performance index value and the preset overall service rate limiting threshold, it is determined whether to perform automatic rate limiting on the overall service.
[0031] This invention provides a non-transitory computer-readable storage medium, comprising:
[0032] The non-transitory computer-readable storage medium stores computer instructions that cause the computer to perform the following methods:
[0033] The maximum utilization rate of a single server hardware is obtained, and the overall maximum utilization rate of the service hardware is determined based on the number of single servers in the service and the maximum utilization rate of a single server hardware; wherein, the maximum utilization rate of a single server hardware is the utilization rate of the hardware with the highest utilization rate value in a single server.
[0034] Obtain the current performance capacity of the service and the maximum performance capacity that the service can support, and obtain the current performance capacity and the maximum performance capacity that the downstream services of the service can support.
[0035] Based on the overall maximum hardware utilization of the service, the current performance capacity of the service, the maximum performance capacity that the service can support, the current performance capacity of the downstream service, and the maximum performance capacity that the downstream service can support, an overall performance index value reflecting the overall service is determined. Based on the comparison result between the overall performance index value and the preset overall service rate limiting threshold, it is determined whether to perform automatic rate limiting on the overall service.
[0036] The automated rate limiting method and apparatus provided in this invention determine the overall performance index value reflecting the overall service based on the maximum utilization rate of the overall service hardware, the current performance capacity of the service, the maximum performance capacity that the service can bear, the current performance capacity of the downstream service, and the maximum performance capacity that the downstream service can bear. Based on the comparison result between the overall performance index value and the preset overall service rate limiting threshold, it determines whether to perform automated rate limiting on the overall service. This can reasonably perform automated rate limiting on the overall service from the entire service level, thereby improving service performance quality. Attached Figure Description
[0037] 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:
[0038] Figure 1 This is a flowchart illustrating an automated rate limiting method provided in an embodiment of the present invention.
[0039] Figure 2 This is a schematic diagram of the internal structure of the mounting device.
[0040] Figure 3 This is a schematic diagram of the internal structure of the system information collection device.
[0041] Figure 4 This is a schematic diagram of the internal structure of the request interception device.
[0042] Figure 5 This is a schematic diagram of the internal structure of the data aggregation device.
[0043] Figure 6 This is a schematic diagram of the internal structure of the information receiving device.
[0044] Figure 7 This is a schematic diagram of the internal structure of a statistical analysis device.
[0045] Figure 8 This is a schematic diagram illustrating the implementation process of an automated rate limiting method for system resource utilization.
[0046] Figure 9 This is a schematic diagram of the structure of an automated current limiting processing device provided in an embodiment of the present invention.
[0047] Figure 10 This is a schematic diagram of the physical structure of an electronic device provided in an embodiment of the present invention. Detailed Implementation
[0048] 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.
[0049] Figure 1 This is a flowchart illustrating an automated rate limiting method provided in an embodiment of the present invention, as shown below. Figure 1 As shown, the automated rate limiting method provided in this embodiment of the invention includes:
[0050] Step S1: Obtain the maximum hardware utilization of a single server, and determine the overall maximum hardware utilization of the service based on the number of single servers in the service and the maximum hardware utilization of a single server; wherein, the maximum hardware utilization of a single server is the utilization of the hardware with the highest utilization value in a single server.
[0051] Step S2: Obtain the current performance capacity of the service and the maximum performance capacity that the service can support, and obtain the current performance capacity of the downstream service and the maximum performance capacity that the downstream service can support.
[0052] Step S3: Based on the overall maximum hardware utilization of the service, the current performance capacity of the service, the maximum performance capacity that the service can support, the current performance capacity of the downstream service, and the maximum performance capacity that the downstream service can support, determine the overall performance index value reflecting the overall service, and determine whether to perform automatic rate limiting on the overall service based on the comparison result between the overall performance index value and the preset overall service rate limiting threshold.
[0053] In step S1 above, the device obtains the maximum utilization rate of a single server hardware and determines the overall maximum hardware utilization rate of the service based on the number of all single servers in the service and the maximum utilization rate of a single server hardware. The maximum utilization rate of a single server hardware is the utilization rate corresponding to the hardware with the highest utilization rate among the single servers. The device can be a computer device executing this method. The single server hardware may include at least two of the following: CPU, memory, disk, and network. These at least two components enable comparison of the utilization rate values of a single server, thereby obtaining the utilization rate corresponding to the hardware with the highest utilization rate among the single servers.
[0054] The overall maximum hardware utilization rate of a service can be understood as the average maximum hardware utilization rate of all individual servers in that service.
[0055] Furthermore, obtaining the maximum utilization rate of a single server hardware includes:
[0056] The maximum hardware utilization of a single server is obtained by comparing at least two of the following: overall CPU utilization, overall memory utilization, overall disk utilization, and overall network utilization. Specifically, the overall disk utilization is the ratio of the current disk read / write speed to the maximum disk read / write speed, and the overall network utilization is the ratio of the current network read / write speed to the current server network bandwidth. The overall CPU utilization and overall memory utilization can be obtained directly from the server.
[0057] To illustrate how to obtain the maximum hardware utilization of a single server, the following example is provided:
[0058] If a single server hardware unit includes both CPU and memory, then the overall CPU utilization and overall memory utilization are compared. If the overall CPU utilization is greater than the overall memory utilization, then the overall CPU utilization is determined to be the maximum utilization of the single server hardware unit.
[0059] If the overall utilization of a single server hardware includes three items: CPU, memory, and disk, then the overall CPU utilization, memory utilization, and disk utilization are compared. If the overall CPU utilization is the highest, then the overall CPU utilization is determined to be the maximum utilization of the single server hardware.
[0060] The explanation of the four hardware metrics for a single server—CPU utilization, memory utilization, disk utilization, and network utilization—will not be repeated here.
[0061] Furthermore, determining the overall maximum hardware utilization of the service based on the number of individual servers in the service and the maximum hardware utilization of individual servers includes:
[0062] The sum of the maximum hardware utilization rates of each individual server, divided by the total number of individual servers, is used as the overall maximum hardware utilization rate of the service. This step calculates the average maximum hardware utilization rate of all individual servers for the service.
[0063] In step S2 above, the device obtains the current performance capacity and maximum performance capacity that the service can support, as well as the current performance capacity and maximum performance capacity that the downstream services of the service can support. When a service is invoked, the calling function can be intercepted to record how many concurrent functions are accessing the service, thereby calculating the current performance capacity of the service. The maximum performance capacity that the service can support can be obtained through service attribute information.
[0064] Similarly, when a downstream service is invoked, the calling function can be intercepted to record how many calling functions are concurrently accessing the downstream service. This allows the current performance capacity of the downstream service to be calculated, and the maximum performance capacity that the downstream service can bear can be obtained through the downstream service attribute information.
[0065] In step S3 above, the device determines the overall performance index value reflecting the overall service based on the overall maximum hardware utilization rate of the service, the current performance capacity of the service, the maximum performance capacity that the service can bear, the current performance capacity of the downstream service, and the maximum performance capacity that the downstream service can bear. Based on the comparison result between the overall performance index value and the preset overall service rate limiting threshold, the device determines whether to perform automatic rate limiting on the overall service.
[0066] Further, determining whether to perform automated rate limiting on the overall service based on the comparison result between the overall performance index value and the preset overall service rate limiting threshold includes:
[0067] If the overall performance index value is greater than the preset overall service rate limiting threshold, then it is determined that the overall service will be subject to automatic rate limiting. The preset overall service rate limiting threshold can be set independently according to the actual situation and can be selected as 0.9.
[0068] If the overall performance index value is less than or equal to the preset overall service rate limiting threshold, then it is determined that no automatic rate limiting will be applied to the overall service.
[0069] Furthermore, determining the overall performance index value reflecting the overall service based on the service's overall maximum hardware utilization, the service's current performance capacity, the service's maximum performance capacity, the downstream service's current performance capacity, and the downstream service's maximum performance capacity includes:
[0070] The service busyness level is calculated based on the current performance capacity of the service and the maximum performance capacity that the service can bear; the service busyness level of the downstream service is calculated based on the current performance capacity of the downstream service and the maximum performance capacity that the downstream service can bear; the ratio of the current performance capacity of the service to the maximum performance capacity that the service can bear can be used as the service busyness level of the service; the ratio of the current performance capacity of the downstream service to the maximum performance capacity that the downstream service can bear can be used as the service busyness level of the downstream service.
[0071] Based on the overall maximum hardware utilization rate of the service, the service's busy level, the busy level of the downstream services, and their respective weights, an overall performance index reflecting the overall service is determined. The weight corresponding to the overall maximum hardware utilization rate of the service is denoted as a1, the weight corresponding to the service's busy level as a2, and the weight corresponding to the busy level of the downstream services as a3. The specific values of a1, a2, and a3 can be set independently according to actual conditions, for example, 0.6, 0.2, and 0.2 respectively.
[0072] The overall performance index reflecting the service as a whole can be calculated using the following formula:
[0073] Overall performance index value = maximum utilization rate of overall service hardware × a1 + service busyness level × a2 + service busyness level of downstream services × a3.
[0074] The conditions that trigger automated rate limiting are:
[0075] The total hardware utilization rate of the service × a1 + the service's busy level × a2 + the service's busy level of downstream services × a3 > K.
[0076] Where K is the preset overall service rate limiting threshold.
[0077] Furthermore, the automated rate limiting method also includes:
[0078] If the service does not have downstream services, the preset overall service rate limiting threshold is used to replace the service busyness of the downstream services, and an overall performance index value reflecting the overall service is determined.
[0079] Referring to the conditions for triggering automated rate limiting, the service busyness of the downstream service in the formula is replaced with K, which makes the rate limiting conditions for the overall hardware utilization and the service busyness of the service more stringent, thereby further ensuring service performance quality.
[0080] The automated rate limiting method provided in this invention determines an overall performance index value reflecting the overall service based on the service's overall maximum hardware utilization, the service's current performance capacity, the service's maximum performance capacity, the downstream service's current performance capacity, and the downstream service's maximum performance capacity. It then determines whether to perform automated rate limiting on the entire service based on a comparison between the overall performance index value and a preset overall service rate limiting threshold. This allows for reasonable automated rate limiting of the entire service at the service level, thereby improving service performance quality.
[0081] It should be noted that the automated rate limiting 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 automated rate limiting method.
[0082] The embodiments of the present invention mainly implement the rate limiting strategy through a service rate limiting tool, which can be divided into a data collection submodule and a statistical analysis submodule.
[0083] The data acquisition submodule dynamically mounts itself to the target application, such as the Dubbo service, to enable communication with it. When the target application is invoked, the data acquisition submodule intercepts the call, records how many concurrent calls are accessing the service from the server, and simultaneously calculates the real-time utilization of the server's CPU, memory, disk, and network, sending this data to the statistical analysis submodule for statistical analysis.
[0084] The statistical analysis submodule dynamically mounts to the gateway and communicates with it. In addition to real-time acquisition of the current workload of each service node and system-level usage information such as CPU, memory, disk, and network from the data acquisition submodule, the statistical analysis submodule also receives real-time workload information from downstream services. It then calculates whether rate limiting is necessary based on the following formula.
[0085] The total hardware utilization rate of the service × a1 + the service's busy level × a2 + the service's busy level of downstream services × a3 > K.
[0086] Service rate limiting tools include the following devices:
[0087] Service rate limiting tool startup device 1: Used to start and run the service rate limiting tool.
[0088] Mounting Device 2: Used to mount the data acquisition submodule and statistical analysis submodule of the service rate limiting tool to the gateway and target application, and maintain real-time communication.
[0089] System information collection device 3: used to collect the usage rate of system resources such as CPU, memory, disk, and network of the current server in real time.
[0090] Request interception device 4: When a service is invoked, the call is intercepted, and the number of concurrent calls to the service is recorded.
[0091] Data aggregation device 5: Aggregates the system resource utilization information obtained by system information collection device 3 and the service call information obtained by request interception device 4, and sends the aggregation result to information receiving device 6.
[0092] Information receiving device 6: Receives system resource utilization information and service call information sent by data aggregation device 5, and also receives downstream service busy information sent by downstream services, and performs content parsing.
[0093] Statistical analysis device 7: Used to statistically analyze whether flow limiting measures need to be triggered under the current circumstances based on the following formula:
[0094] The total hardware utilization rate of the service × a1 + the service's busy level × a2 + the service's busy level of downstream services × a3 > K.
[0095] Rate limiting device 8: Limits the rate of the service.
[0096] like Figure 2 As shown, the mounting device 2 includes a gateway mounting unit 21 and a service mounting unit 22:
[0097] Gateway mounting unit 21: Used to mount the statistical analysis submodule to the gateway program.
[0098] Service mounting unit 22: Used to mount the data acquisition submodule to the target application, such as the Dubbo service.
[0099] like Figure 3 As shown, the system information collection device 3 includes a CPU information collection unit 31, a memory information collection unit 32, a disk information collection unit 33, and a network information collection unit 34, wherein:
[0100] CPU information collection unit 31: Used to collect and analyze the overall CPU utilization of the target server.
[0101] Memory information collection unit 32: Used to collect and analyze the overall memory usage of the target server.
[0102] Disk information collection unit 33: Used to collect and analyze the overall disk usage of the target server.
[0103] Network information collection unit 34: Used to collect and analyze the overall network utilization rate of the target server.
[0104] like Figure 4 As shown, the request interception device 4 includes a request interception unit 41 and a request statistics unit 42. Wherein:
[0105] Request interception unit 41: Intercepts and records requests to the target service.
[0106] Request statistics unit 42: Calculates the concurrency of the server by performing statistics on all running requests intercepted by request interception unit 41.
[0107] like Figure 5 As shown, the data aggregation device 5 includes a data aggregation unit 51 and a data transmission unit 52. Wherein:
[0108] Data aggregation unit 51: used to encapsulate the system resource utilization information obtained by the system information collection device 3 and the service call information obtained by the request interception device 4 in a unified format.
[0109] Data sending unit 52: Used to send the data encapsulated by data aggregation unit 51 to information receiving device 6.
[0110] like Figure 6 As shown, the information receiving device 6 includes an information receiving unit 61 and an information parsing unit 62. Wherein:
[0111] Information receiving unit 61: Receives system resource utilization information and service call information sent by data aggregation device 5, as well as downstream service busyness information sent by downstream services.
[0112] Information parsing unit 62: parses and classifies the various types of information received by information receiving unit 61, and then sends them to statistical analysis device 7 for statistical analysis.
[0113] like Figure 7 As shown, the statistical analysis device 7 includes a statistical analysis unit 71 and a result comparison unit 72. Wherein:
[0114] Statistical analysis unit 71: Performs statistical analysis on three types of data obtained by information receiving device 6: the maximum hardware utilization rate of the overall service, the busy level of the service, and the busy level of downstream services, and calculates the final current score of the service.
[0115] Result comparison unit 72: compares the score K value calculated by the statistical analysis device 71 to determine whether to trigger flow restriction measures at that moment.
[0116] The implementation process of the automated current limiting method based on the above devices is as follows: Figure 8 As shown in the illustration. For details, please refer to the above embodiments; further explanation is unnecessary.
[0117] Figure 9 This is a schematic diagram of the structure of an automated current limiting processing device provided in an embodiment of the present invention, as shown below. Figure 9 As shown, the automated rate limiting processing device provided in this embodiment of the invention includes a determining module 901, an acquiring module 902, and a rate limiting processing module 903, wherein:
[0118] The determination module 901 is used to obtain the maximum utilization rate of a single server hardware, and determine the overall maximum utilization rate of the service hardware based on the number of single servers in the service and the maximum utilization rate of a single server hardware; wherein, the maximum utilization rate of a single server hardware is the utilization rate corresponding to the hardware with the highest utilization rate value in a single server; the acquisition module 902 is used to obtain the current performance capacity of the service and the maximum performance capacity that the service can bear, as well as the current performance capacity and the maximum performance capacity that the downstream services of the service can bear; the rate limiting module 903 is used to determine the overall performance index value reflecting the overall service based on the overall maximum utilization rate of the service hardware, the current performance capacity of the service, the maximum performance capacity that the service can bear, the current performance capacity and the maximum performance capacity that the downstream services can bear, and the downstream services can bear, and determine whether to perform automatic rate limiting processing on the overall service based on the comparison result of the overall performance index value and the preset overall service rate limiting threshold.
[0119] Specifically, the determining module 901 is used to obtain the maximum utilization rate of a single server hardware, and determine the overall maximum hardware utilization rate of the service based on the number of single servers in the service and the maximum utilization rate of a single server hardware; wherein, the maximum utilization rate of a single server hardware is the utilization rate corresponding to the hardware with the highest utilization rate value in a single server; the obtaining module 902 is used to obtain the current performance capacity of the service and the maximum performance capacity that the service can support, as well as the current performance capacity of the downstream service and the maximum performance capacity that the downstream service can support; the rate limiting processing module 903 is used to determine the overall performance index value reflecting the overall service based on the overall maximum hardware utilization rate of the service, the current performance capacity of the service, the maximum performance capacity that the service can support, the current performance capacity of the downstream service, and the maximum performance capacity that the downstream service can support, and determine whether to perform automatic rate limiting processing on the overall service based on the comparison result of the overall performance index value and the preset overall service rate limiting threshold.
[0120] The automated rate limiting device provided in this embodiment of the invention determines the overall performance index value reflecting the overall service based on the maximum utilization rate of the overall service hardware, the current performance capacity of the service, the maximum performance capacity that the service can bear, the current performance capacity of the downstream service, and the maximum performance capacity that the downstream service can bear. Based on the comparison result between the overall performance index value and the preset overall service rate limiting threshold, it determines whether to perform automated rate limiting on the overall service. This device can reasonably perform automated rate limiting on the overall service from the entire service level, thereby improving service performance quality.
[0121] The embodiments of the present invention provide an automated current limiting processing device that 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.
[0122] Figure 10 This is a schematic diagram of the physical structure of an electronic device provided in an embodiment of the present invention, such as... Figure 10 As shown, the electronic device includes: a processor 1001, a memory 1002, and a bus 1003;
[0123] The processor 1001 and the memory 1002 communicate with each other via the bus 1003.
[0124] The processor 1001 is used to call program instructions in the memory 1002 to execute the methods provided in the above-described method embodiments, including, for example:
[0125] The system obtains the maximum utilization rate of a single server's hardware and determines the overall maximum hardware utilization rate of the service based on the number of single servers in the service and the maximum utilization rate of a single server's hardware. The maximum utilization rate of a single server's hardware is the utilization rate corresponding to the hardware with the highest utilization rate among all single servers. The system also obtains the current performance capacity and maximum performance capacity that the service can support, as well as the current performance capacity and maximum performance capacity that the downstream services of the service can support. Based on the overall maximum hardware utilization rate, the current performance capacity, the maximum performance capacity that the service can support, the current performance capacity, and the maximum performance capacity that the downstream services can support, the system determines an overall performance indicator value reflecting the overall service. Finally, based on the comparison between the overall performance indicator value and a preset overall service rate limiting threshold, the system determines whether to perform automated rate limiting on the overall service.
[0126] 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 execute the methods provided in the above-described method embodiments, such as: obtaining the maximum utilization rate of a single server hardware, and determining the overall maximum utilization rate of the service hardware based on the number of all single servers in the service and the maximum utilization rate of the single server hardware; wherein, the maximum utilization rate of a single server hardware is the utilization rate corresponding to the hardware with the highest utilization rate value in a single server; obtaining the current performance capacity of the service and the maximum performance capacity that the service can bear, and obtaining the current performance capacity of the downstream service and the maximum performance capacity that the downstream service can bear; determining an overall performance index value reflecting the overall service based on the overall maximum utilization rate of the service hardware, the current performance capacity of the service, the maximum performance capacity that the service can bear, the current performance capacity of the downstream service, and the maximum performance capacity that the downstream service can bear, and determining whether to perform automatic rate limiting processing on the overall service based on the comparison result of the overall performance index value and a preset overall service rate limiting threshold.
[0127] This embodiment provides a computer-readable storage medium storing a computer program that causes a computer to execute the methods provided in the above-described method embodiments. For example, the methods include: obtaining the maximum utilization rate of a single server hardware, and determining the overall maximum hardware utilization rate of the service based on the number of single servers in the service and the maximum utilization rate of the single server hardware; wherein the maximum utilization rate of a single server hardware is the utilization rate corresponding to the hardware with the highest utilization rate among the single servers; obtaining the current performance capacity of the service and the maximum performance capacity that the service can support, and obtaining the current performance capacity of the downstream services of the service and the maximum performance capacity that the downstream services can support; determining an overall performance index value reflecting the overall service based on the overall maximum hardware utilization rate of the service, the current performance capacity of the service, the maximum performance capacity that the service can support, the current performance capacity of the downstream services, and the maximum performance capacity that the downstream services can support; and determining whether to perform automatic rate limiting processing on the overall service based on a comparison result between the overall performance index value and a preset overall service rate limiting threshold.
[0128] 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.
[0129] 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.
[0130] 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.
[0131] 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.
[0132] 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.
[0133] 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. An automated current limiting method, characterized in that, include: The maximum utilization rate of a single server hardware is obtained, and the overall maximum utilization rate of the service hardware is determined based on the number of single servers in the service and the maximum utilization rate of a single server hardware; wherein, the maximum utilization rate of a single server hardware is the utilization rate of the hardware with the highest utilization rate value in a single server. Obtain the current performance capacity of the service and the maximum performance capacity that the service can support, and obtain the current performance capacity and the maximum performance capacity that the downstream services of the service can support. Based on the overall maximum hardware utilization of the service, the current performance capacity of the service, the maximum performance capacity that the service can support, the current performance capacity of the downstream service, and the maximum performance capacity that the downstream service can support, an overall performance index value reflecting the overall service is determined, and based on the comparison result between the overall performance index value and the preset overall service rate limiting threshold, it is determined whether to perform automatic rate limiting on the overall service. The step of determining the overall performance index value reflecting the overall service based on the service's overall maximum hardware utilization, the service's current performance capacity, the service's maximum performance capacity, the downstream service's current performance capacity, and the downstream service's maximum performance capacity includes: The service load level is calculated based on the current performance capacity of the service and the maximum performance capacity that the service can support; the service load level of the downstream service is calculated based on the current performance capacity of the downstream service and the maximum performance capacity that the downstream service can support. The overall performance index value reflecting the overall service is determined based on the maximum hardware utilization rate of the service, the service busyness level of the service, the service busyness level of the downstream services, and their respective weights.
2. The automated current limiting method according to claim 1, characterized in that, A single server hardware unit includes at least two of the following: CPU, memory, disk, and network; correspondingly, obtaining the maximum utilization rate of the single server hardware includes: The maximum utilization rate of the single server hardware is obtained by comparing the utilization rates of at least two of the following: overall CPU utilization, overall memory utilization, overall disk utilization, and overall network utilization. The overall disk utilization rate is the ratio of the current disk read / write rate to the maximum disk read / write rate, and the overall network utilization rate is the ratio of the current network read / write rate to the current server network bandwidth.
3. The automated current limiting method according to claim 1, characterized in that, The determination of the overall maximum hardware utilization of the service based on the number of individual servers in the service and the maximum hardware utilization of individual servers includes: The sum of the maximum utilization rates of each individual server is used as the ratio of the sum of the maximum utilization rates of each individual server to the total number of individual servers, which is taken as the overall maximum utilization rate of the service hardware.
4. The automated current limiting method according to claim 1, characterized in that, The step of determining whether to automatically limit the overall service based on the comparison result between the overall performance index value and the preset overall service rate limiting threshold includes: If the overall performance index value is greater than the preset overall service rate limiting threshold, then it is determined that the overall service will be subject to automated rate limiting. If the overall performance index value is less than or equal to the preset overall service rate limiting threshold, then it is determined that no automatic rate limiting will be applied to the overall service.
5. The automated current limiting method according to any one of claims 1 to 4, characterized in that, The automated rate limiting method further includes: If the service does not have downstream services, the preset overall service rate limiting threshold is used to replace the service busyness of the downstream services, and an overall performance index value reflecting the overall service is determined.
6. An automated current limiting device, characterized in that, include: The determination module is used to obtain the maximum utilization rate of a single server hardware and determine the overall maximum utilization rate of the service hardware based on the number of all single servers in the service and the maximum utilization rate of a single server hardware; wherein, the maximum utilization rate of a single server hardware is the utilization rate of the hardware with the highest utilization rate value in a single server. The acquisition module is used to acquire the current performance capacity of the service and the maximum performance capacity that the service can bear, as well as the current performance capacity and the maximum performance capacity that the downstream service of the service can bear. The rate limiting module is used to determine the overall performance index value reflecting the overall service based on the overall maximum hardware utilization of the service, the current performance capacity of the service, the maximum performance capacity that the service can bear, the current performance capacity of the downstream service, and the maximum performance capacity that the downstream service can bear, and to determine whether to perform automatic rate limiting on the overall service based on the comparison result between the overall performance index value and the preset overall service rate limiting threshold. The current limiting module is specifically used for: The service load level is calculated based on the current performance capacity of the service and the maximum performance capacity that the service can support; the service load level of the downstream service is calculated based on the current performance capacity of the downstream service and the maximum performance capacity that the downstream service can support. The overall performance index value reflecting the overall service is determined based on the maximum hardware utilization rate of the service, the service busyness level of the service, the service busyness level of the downstream services, and their respective weights.
7. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 5.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 5.