Access current limiting method, server and storage medium

By monitoring the month-on-month change rate of the number of coroutines and the number of Ceph clusters, the access request threshold of the Ceph cluster is dynamically adjusted, which solves the problem of uneven resource utilization caused by uneven access and achieves more balanced and efficient resource utilization.

CN113805802BInactive Publication Date: 2025-01-21CHINANETCENT TECH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202110921031.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-08-11
Publication Date
2025-01-21
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

In Ceph clusters, uneven access leads to uneven resource utilization, resulting in some Ceph clusters being denied access due to current limits, and resources cannot be reasonably utilized.

Method used

By monitoring the relationship between the current number of coroutines and the preset threshold, the number of the first Ceph cluster and the second Ceph cluster is obtained, and their ring-to-month change rate is calculated. When the chain change rate meets the preset conditions, the access request threshold of each Ceph cluster is dynamically adjusted to balance resource utilization.

Benefits of technology

It achieves dynamic adjustment of the access request threshold in the case of uneven access, avoids resource waste and access denial caused by current limiting, and improves the resource utilization of the Ceph cluster and the adaptability of the system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113805802B_ABST
    Figure CN113805802B_ABST
Patent Text Reader

Abstract

The embodiments of the present invention relate to the field of distributed storage systems, and disclose a method, server, and storage medium for access flow limiting. The method for access flow limiting in the present invention includes: if it is determined that the number of current coroutines is less than a preset coroutine threshold, then the number of first Ceph clusters and the number of second Ceph clusters are obtained; if it is detected that the month-on-month change rate between the number of the first Ceph clusters and the number of the second Ceph clusters meets the preset adjustment condition, then the access request threshold of each first Ceph cluster is adjusted; the first Ceph cluster corresponding to the access request is obtained as the target Ceph cluster; if it is determined that the number of requests of the target Ceph cluster is greater than the access request threshold of the target Ceph cluster, the access request is returned. By adopting the embodiments of the present application, the problem of uneven resource utilization caused by uneven access can be solved, and the resources of the Ceph cluster can be used evenly.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present invention relate to the field of distributed storage systems, and in particular to an access current limiting method, a server and a storage medium. Background Art

[0002] Ceph is a unified, distributed storage system with excellent performance, reliability and scalability. As a component of the Ceph system, the Reliable Autonomic Distributed Object Store Gateway (Radosgw) acts as an access gateway in the Ceph system. In a Ceph system, usually one Radosgw can only connect to one Ceph cluster. If there are multiple Ceph clusters at the same time, the access volume of each cluster varies. The Radosgw corresponding to the Ceph cluster with high access volume is busy, and even causes a bottleneck in the processing of access requests by the Ceph system, while the Radosgw corresponding to the Ceph cluster with low access volume is idle. In order to reduce the occurrence of this state, Radosgw can now access different Ceph clusters based on the identification information of the Ceph cluster carried in the access request, solving the problem of uneven processing of access requests by Radosgw.

[0003] After receiving an access request, Radosgw will immediately package the access request data into a request object and create a corresponding coroutine to process the request object. When the number of access requests to a cluster in a certain period of time is much greater than the number of access requests to other Ceph clusters, if a fixed request threshold is used to directly limit the access requests, the access requests to other Ceph clusters during this period of time may be rejected due to current limiting, and access resources cannot be reasonably used. Summary of the invention

[0004] The purpose of the embodiments of the present invention is to provide a method, a server and a storage medium for access flow limiting, which can solve the problem of uneven resource utilization caused by uneven access and evenly utilize the resources of the Ceph cluster.

[0005] To solve the above technical problems, in the first aspect, an implementation method of the present application provides a method for access flow limiting, including: if it is determined that the current number of coroutines is less than a preset coroutine threshold, then obtaining the number of first Ceph clusters and the number of second Ceph clusters, the first Ceph cluster being the Ceph cluster corresponding to the request currently processed by the coroutine, and the second Ceph cluster being the Ceph cluster corresponding to the request processed by the coroutine at the last adjustment moment; if it is detected that the month-on-month change rate between the number of the first Ceph clusters and the number of the second Ceph clusters meets the preset adjustment conditions, then adjusting the access request threshold of each of the first Ceph clusters; obtaining the first Ceph cluster corresponding to the access request as the target Ceph cluster; if it is determined that the number of requests of the target Ceph cluster is greater than the access request threshold of the target Ceph cluster, returning the access request.

[0006] In a second aspect, an embodiment of the present application further provides a server, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the above-mentioned access flow limiting method.

[0007] In a third aspect, an embodiment of the present application further provides a computer-readable storage medium storing a computer program, which implements the above-mentioned access current limiting method when executed by a processor.

[0008] The access flow limiting method in the embodiment of the present application is applied to the distributed object storage gateway RGW. After receiving the access request, the RGW will create a corresponding coroutine to process the access request. If it is determined that the number of current coroutines is less than the preset coroutine threshold, it indicates that the current RGW's ability to process access requests is not saturated, and the access request can be processed, which can avoid the problem of RGW program crashing due to too many access requests. In the present application, by obtaining the month-on-month change rate between the number of the first Ceph cluster and the number of the second Ceph cluster, it is determined whether to adjust the access request threshold of each first Ceph cluster. When the month-on-month change rate meets the adjustment condition, the access request threshold of each first Ceph cluster is adjusted. Since a fixed access request threshold is not used, when the access request volume of a certain Ceph cluster is large, access to other Ceph clusters will not be rejected due to flow limiting; balanced access to each first Ceph cluster improves the utilization rate of the Ceph cluster; and since the adjustment is dynamic, the adaptability of restricting access to the Ceph cluster is improved. BRIEF DESCRIPTION OF THE DRAWINGS

[0009] One or more embodiments are exemplarily described by pictures in the corresponding drawings, and these exemplified descriptions do not constitute limitations on the embodiments. Elements with the same reference numerals in the drawings represent similar elements, and unless otherwise stated, the figures in the drawings do not constitute proportional limitations.

[0010] Figure 1 This is a flow chart of a method for access flow limiting provided according to an embodiment of the present application;

[0011] Figure 2 It is a specific implementation schematic diagram of detecting whether the month-on-month change rate meets a preset adjustment condition according to an embodiment of the present application;

[0012] Figure 3 It is a schematic diagram of a situation where the RGW receives only one access request according to an embodiment of the present application;

[0013] Figure 4 It is a schematic diagram of a situation where a new access request Req_c2 is received during RGW processing of an access request Req_c2 according to an embodiment of the present application;

[0014] Figure 5 It is a schematic diagram of a situation in which the RGW is still processing access requests to the Ceph_c1 cluster and the Ceph_c2 cluster and receives a new access request Req_c2 at the same time according to an embodiment of the present application;

[0015] Figure 6 It is a schematic diagram of a situation in which the RGW is still processing access requests to the Ceph_c1 cluster and the Ceph_c2 cluster and receives a new access request Req_c3 at the same time according to an embodiment of the present application;

[0016] Figure 7 It is a schematic diagram of the completion of the processing of the access request of the Ceph_c1 and Ceph_c3 clusters by the RGW provided in the embodiment of the present application;

[0017] Figure 8 It is a specific implementation diagram of adjusting the access request threshold of each first Ceph cluster provided in an embodiment of the present application;

[0018] Fig. 9 It is a structural diagram of a server provided according to an embodiment of the present application. DETAILED DESCRIPTION

[0019] In order to make the purpose, technical scheme and advantages of the embodiments of the present invention clearer, the following will be described in detail with reference to the accompanying drawings. However, it will be appreciated by those skilled in the art that in the various embodiments of the present invention, many technical details are provided in order to enable the reader to better understand the present application. However, even without these technical details and various changes and modifications based on the following embodiments, the technical scheme claimed in the present application can be implemented.

[0020] The division of the following embodiments is for the convenience of description and shall not constitute any limitation on the specific implementation of the present invention. The embodiments may be combined with each other and referenced to each other without contradiction.

[0021] The first embodiment of the present invention relates to a method for access flow limiting. The method for access flow limiting is executed by a distributed object storage gateway, which is referred to as Radosgw or RGW; RGW can be deployed in a server, which can be a server in a Ceph cluster or a server other than a Ceph cluster. RGW can communicate with N Ceph clusters, where N is an integer greater than 0. The RGW is used to receive access requests from external users. Usually, the access requests initiated by users are sent to the RGW through the business system. After receiving the access request, the RGW will immediately package the data of the access request into a request object, and create a corresponding coroutine to process the access object. At this time, the access step of the access request has been completed. If the RGW receives a new access request, the above process is repeated. The coroutine will be destroyed after processing the access request to release the resources it uses.

[0022] The speed at which the coroutine processes access requests depends on the complexity of the access request execution logic and the busyness of the Ceph cluster. If a large number of access requests arrive at the RGW in a short period of time, the RGW will create a large number of coroutines. If the coroutines are not processed in time, the memory usage will increase sharply, causing the RGW to respond slowly or even crash. Therefore, current limiting is required. The flowchart of the method for implementing access current limiting in this application is as follows Figure 1 As shown:

[0023] Step 101: If it is determined that the current number of coroutines is less than a preset coroutine threshold, the number of first Ceph clusters and the number of second Ceph clusters are obtained. The first Ceph cluster is the Ceph cluster corresponding to the request currently processed by the coroutine, and the second Ceph cluster is the Ceph cluster corresponding to the request processed by the coroutine at the last adjustment time.

[0024] Specifically, the hardware parameters of the server, such as memory capacity, etc., can be obtained in advance, and the number of coroutines that the RGW can carry can be determined based on the hardware parameters of the server. The number of coroutines that the RGW can carry can be used as a preset coroutine threshold. In this example, the coroutine threshold is set as total_coroutine_num. Since each access request is processed by its corresponding coroutine, the number of coroutines in the RGW can be used to characterize the number of access requests. Therefore, after receiving the access request, it can be detected whether the current number of coroutines exceeds the coroutine threshold. If it exceeds the coroutine threshold, the access request is returned. If it is determined that the current number of coroutines is less than the coroutine threshold, it indicates that the current RGW can continue to process the access request.

[0025] When processing access requests, RGW creates a corresponding coroutine for each access request, and the coroutine processes the access request. After the access request is processed, RGW destroys the corresponding coroutine. When the access requests increase, the corresponding coroutines will also increase. If the number of coroutines is too large, the access requests will not be processed in time. Therefore, the number of access requests processed by RGW is related to the number of coroutines in the RGW, that is, it is related to the hardware parameters of the RGW. The coroutine threshold determined by the hardware parameters of the RGW is accurate, which can effectively prevent the number of access requests from exceeding the processing range of the RGW.

[0026] It should be noted that the access request includes identification information of the Ceph cluster to be accessed, so that the RGW can access the corresponding Ceph cluster according to the access request, thereby enabling one RGW to access multiple Ceph clusters simultaneously.

[0027] There are many ways to obtain the number of the first Ceph cluster and the number of the second Ceph cluster. For example, the first Ceph cluster can be counted by reading the identification information of the Ceph cluster to be accessed in the access request. The following specifically describes the process of obtaining the number of the first Ceph cluster and the number of the second Ceph cluster:

[0028] A set of identification information of the Ceph cluster processed by the coroutine can be pre-built, and the set can be used as the first Ceph cluster identification set. When a new access request is received, the ID number of the Ceph cluster to be accessed of the access request is obtained, and it is detected whether the ID number of the Ceph cluster to be accessed exists in the first Ceph cluster identification set. If it exists, the number in the first Ceph cluster identification set is directly counted as the number of the first Ceph cluster. If it does not exist, the ID number of the Ceph cluster to be accessed is added to the first Ceph cluster identification set, and then the number in the first Ceph cluster identification set is obtained as the number of the first Ceph cluster.

[0029] Since the second Ceph cluster is the Ceph cluster corresponding to the request processed by the coroutine at the last adjustment time, the number in the first Ceph cluster identifier set at the last adjustment time can be used as the number of the second Ceph cluster. For example, the number in the first Ceph cluster identifier set at the last adjustment time is 5, and the number in the first Ceph cluster identifier set at the current time is 3, then the number of the first Ceph cluster is 3, and the number of the second Ceph cluster is 5.

[0030] Step 102: If it is detected that the month-on-month change rate between the number of first Ceph clusters and the number of second Ceph clusters meets a preset adjustment condition, the access request threshold of each first Ceph cluster is adjusted.

[0031] Specifically, a month-on-month change rate between the number of the first Ceph cluster and the number of the second Ceph cluster is obtained, where the month-on-month change rate includes a month-on-month growth rate or a month-on-month decrease rate. The preset adjustment condition may be that when the month-on-month change rate is greater than 0, that is, when the number of the first Ceph cluster is different from the number of the second Ceph cluster, it is determined to adjust the access request threshold of each first Ceph cluster.

[0032] It should be noted that the month-on-month growth rate can be expressed as shown in formula (1):

[0033] x=(current_key_num-last_key_num) / last_key_num formula (1);

[0034] Wherein, x represents the month-on-month growth rate, current_key_num represents the number of the first Ceph cluster, and last_key_num represents the number of the second Ceph cluster.

[0035] The month-on-month reduction rate can be calculated using formula (2):

[0036] y=(last_key_num-current_key_num) / current_key_num formula (1);

[0037] Wherein, y represents the month-on-month decrease rate, current_key_num represents the number of the first Ceph cluster, and last_key_num represents the number of the second Ceph cluster.

[0038] The process of adjusting the access request threshold of each first Ceph cluster may be: obtaining a ratio of the coroutine threshold to the number of first Ceph clusters; and adjusting the access request threshold of each first Ceph cluster to the ratio. For example, if the number of first Ceph clusters is 2 and the coroutine threshold is W, then the access request threshold of each first Ceph cluster is adjusted to W / 2.

[0039] Each access request threshold is the same and is related to the number of first Ceph clusters. The access request threshold of each first Ceph cluster is balanced. The access request threshold determined in this way is simple and fast.

[0040] Step 103: Obtain the first Ceph cluster corresponding to the access request as the target Ceph cluster.

[0041] Specifically, the access request received by the RGW includes identification information of the Ceph cluster to be accessed, obtains the identification information of the Ceph cluster to be accessed in the access request, determines the first Ceph cluster corresponding to the access request, and uses the first Ceph cluster corresponding to the access request as the target Ceph cluster.

[0042] Step 104: If it is determined that the number of requests of the target Ceph cluster is greater than the access request threshold of the target Ceph cluster, the access request is returned.

[0043] If it is determined that the number of requests from the target Ceph cluster is less than or equal to the access request threshold of the target Ceph cluster, it is determined that the RGW can process the access request, and the RGW creates a coroutine to process the access request. If it is determined that the number of requests from the target Ceph cluster is less than or equal to the access request of the target Ceph cluster, it is determined that the RGW can no longer process the access request, and the access request is returned.

[0044] When the access request is processed by the corresponding coroutine, RGW destroys the coroutine corresponding to the access request, and if it is detected that there is a first Ceph cluster whose number of access requests is changed to 0, the first Ceph cluster is updated. The specific implementation process may be: if it is detected that there is identification information of the first Ceph cluster whose number of access requests is 0 in the first Ceph cluster identification set, the identification information of the first Ceph cluster is removed from the first Ceph cluster identification set, and the first Ceph cluster identification set is updated.

[0045] In this embodiment, after a new access request is received, the access request threshold of each first Ceph cluster is adjusted according to the preset adjustment conditions, which not only enables the RGW with multi-cluster access function to perform current limiting protection when a large number of access requests arrive, but also when a large number of access requests from a single Ceph cluster arrive, access to other Ceph clusters will not be completely rejected due to current limiting.

[0046] The access flow limiting method in the embodiment of the present application is applied to the distributed object storage gateway RGW. After receiving the access request, the RGW will create a corresponding coroutine to process the access request. If it is determined that the number of current coroutines is less than the preset coroutine threshold, it indicates that the current RGW's ability to process access requests is not saturated, and the access request can be processed, which can avoid the problem of RGW program crashing due to too many access requests. In the present application, by obtaining the month-on-month change rate between the number of the first Ceph cluster and the number of the second Ceph cluster, it is determined whether to adjust the access request threshold of each first Ceph cluster. When the month-on-month change rate meets the adjustment condition, the access request threshold of each first Ceph cluster is adjusted. Since a fixed access request threshold is not used, when the access request volume of a certain Ceph cluster is large, access to other Ceph clusters will not be rejected due to flow limiting; balanced access to each first Ceph cluster improves the utilization rate of the Ceph cluster; and since the adjustment is dynamic, the adaptability of restricting access to the Ceph cluster is improved.

[0047] In one embodiment, a method for detecting whether the month-on-month change rate meets a preset adjustment condition is provided, and the specific implementation process is as follows: Figure 2 As shown:

[0048] Step 101: If it is determined that the number of current coroutines is less than a preset coroutine threshold, the number of first Ceph clusters and the number of second Ceph clusters are obtained.

[0049] Step 1021: Detect whether the month-on-month change rate exceeds a preset adjustment ratio, and if it is determined that the month-on-month change rate does not exceed the adjustment ratio, execute step 1022. If it is determined that the month-on-month change rate exceeds the adjustment ratio, execute step 1023.

[0050] Specifically, the month-on-month change rate includes a month-on-month growth rate or a month-on-month decrease rate. The preset adjustment ratio can be set according to actual conditions, for example, the adjustment ratio can be set to any value between 10% and 100%.

[0051] When the month-on-month growth rate or the month-on-month decrease rate exceeds the adjustment ratio, it is determined to adjust the access request threshold of each first Ceph cluster, and step 1023 is executed. If it is determined that the month-on-month change rate does not exceed the adjustment ratio, step 1022 is executed.

[0052] It should be noted that, if it is determined that the month-on-month and month-on-month ratio does not exceed the adjustment ratio, step 1022 may not be performed, but the current access request thresholds of each first Ceph cluster may be maintained; and steps 103 and 104 may be directly performed.

[0053] In order to further simplify the process of detecting whether the month-on-month change rate exceeds the preset adjustment ratio, this embodiment deforms the formulas of the month-on-month growth rate and the month-on-month decrease rate. According to formula (1), if it is detected that the number of the first Ceph cluster, current_key_num, is greater than last_key_num*(1+coroutine_rate_factor), it is determined that the month-on-month growth rate exceeds the adjustment ratio, where coroutine_rate_factor represents the adjustment ratio, last_key_num represents the number of the second Ceph cluster, and current_key_num represents the number of the first Ceph cluster.

[0054] According to formula (2), if it is detected that the number of the first Ceph cluster, current_key_num, is less than last_key_num / (1+coroutine_rate_factor), it is determined that the month-on-month decrease rate exceeds the adjustment ratio, where coroutine_rate_factor represents the adjustment ratio, last_key_num represents the number of the second Ceph cluster, and current_key_num represents the number of the first Ceph cluster.

[0055] Step 1022: Detect whether the time from the last adjustment time exceeds the preset time. If it is determined that the time from the last adjustment time exceeds the preset time, execute step 1023.

[0056] If it is determined that the month-on-month change rate does not exceed the adjustment ratio, it indicates that the number of the first Ceph cluster is slightly different from the number of the second Ceph cluster, and the change fluctuation is small. In order to ensure the stability of processing access requests, the access request threshold of the first Ceph cluster may not be adjusted at this time.

[0057] In this embodiment, in order to further improve the applicability of restricting access requests, after determining that the month-on-month change rate does not exceed the adjustment ratio, processing such as step 1022 may be performed.

[0058] Specifically, a preset duration can be set in advance, and the preset duration can be set to 60 seconds. If it is determined that the month-on-month change rate does not exceed the adjustment ratio, it is detected whether the duration from the last adjustment time exceeds the preset duration. That is, it is detected that current_key_num is less than last_key_num*(1+coroutine_rate_factor) and greater than last_key_num / (1+coroutine_rate_factor) and is not equal to last_key_num; then it is detected whether the duration from the last adjustment time exceeds the preset duration, and if it exceeds, step 1023 is executed.

[0059] It should be noted that the time of each adjustment of the access request threshold of each first Ceph cluster can be recorded to detect the time since the last adjustment. Since this example focuses on the last adjustment time, a last adjustment time is set, recorded as last_adjust_time; after this adjustment, the last_adjust_time time can be updated, without recording all adjustment times, reducing unnecessary data storage.

[0060] Step 1023: Determine whether the detected month-on-month change rate satisfies a preset adjustment condition.

[0061] Step 1024: Adjust the access request threshold of each first Ceph cluster.

[0062] It should be noted that after executing step 1024, the adjustment time is updated, and the first Ceph cluster identification information set is updated so that the RGW executes step 101 after receiving a new access request.

[0063] Step 103: Obtain the first Ceph cluster corresponding to the access request as the target Ceph cluster.

[0064] Step 104: If it is determined that the number of requests of the target Ceph cluster is greater than the access request threshold of the target Ceph cluster, the access request is returned.

[0065] In this embodiment, a method for detecting whether the month-on-month change rate satisfies a preset adjustment condition is provided. Since the number of access requests is constantly changing, an adjustment ratio is set in this example. When the month-on-month change rate is greater than the adjustment ratio, the access request threshold of each first Ceph cluster is adjusted to ensure that the access request threshold of each first Ceph cluster can be adjusted in time. In addition, when the month-on-month change rate is less than the adjustment ratio, it indicates that the fluctuation of the Ceph cluster to be accessed is small, so the access request threshold of each first Ceph cluster may not be adjusted. If it is determined that the month-on-month change rate does not exceed the adjustment ratio, and the detection time from the last adjustment time exceeds the preset time, it indicates that the change in the number of first Ceph clusters has stabilized. At this time, the access request threshold of each first Ceph cluster is adjusted, further improving the adaptive ability of adjusting the access request threshold of the first Ceph cluster.

[0066] The following is combined with Figure 3 ~Attached Figure 7 , introduce the process of adjusting the access limit:

[0067] Figure 3 For the case where the RGW receives only one access request, such as Figure 3As shown, assuming that there are three Ceph clusters, RGW_A is connected to the three Ceph clusters respectively, and the first Ceph cluster identification set is pre-built in RGW. If there is no access request, the first Ceph cluster identification set is empty. When RGW receives the access request Req_c1, it determines that the number of current coroutines is less than the coroutine threshold, obtains the identification information Ceph_c1 of the cluster to be accessed by the access request Req_c1, and detects that the Ceph_c1 is not in the first Ceph cluster identification set, then adds the Ceph_c1 to the first Ceph cluster identification set. Since only one access request is received, and the number of access requests corresponds to the number of coroutines, the access request threshold of the Ceph_c1 cluster can be set to the preset coroutine threshold W.

[0068] Figure 4 When RGW processes access request Req_c1 and receives a new access request Req_c2, Figure 4 In the example, it is assumed that the coroutine threshold is W. When RGW receives the access request Req_c2, it is determined that the number of current coroutines is less than the coroutine threshold, the Ceph cluster to be accessed by Req_c2 is Ceph_c2, and the first Ceph cluster identification set includes the identification information of the Ceph_c1 cluster. If there is no identification information of the Ceph_c2 cluster, the identification information of the Ceph_c2 cluster is added to the first Ceph cluster identification set. The number of the first Ceph cluster is obtained as 2, and the number of the second Ceph cluster is obtained as 1. The month-on-month change rate is 100%, and the preset adjustment ratio is 10%. If the month-on-month change rate exceeds the adjustment ratio, the access request threshold of the Ceph_c1 cluster and the access request threshold of the Ceph_c2 cluster are adjusted to W / 2. It is detected whether the number of access requests of the Ceph_c2 cluster exceeds the access request threshold of W / 2. If so, the access request Req_c2 is returned, otherwise, the access request Req_c2 is processed.

[0069] Figure 5 The access request to the Ceph_c1 cluster and the Ceph_c2 cluster is still being processed by RGW, and a new access request Req_c2 is received at the same time. Figure 5In the example, it is assumed that the coroutine threshold is W. When RGW receives the access request Req_c2, it is determined that the number of current coroutines is less than the coroutine threshold, and the Ceph cluster to be accessed by the new Req_c2 is the Ceph_c2 cluster. It is detected that the first Ceph cluster identification set includes the identification information of the Ceph_c1 cluster and the identification information of the Ceph_c2 cluster; then the number of the first Ceph cluster is directly obtained as 2, and the number of the second Ceph cluster is obtained as 2, and the month-on-month change rate is 0, and the month-on-month change rate does not exceed the adjustment ratio, and the access request threshold of the Ceph_c1 cluster and the access request threshold of the Ceph_c2 cluster are maintained at W / 2. It is detected whether the number of access requests of the Ceph_c2 cluster exceeds the access request threshold of W / 2. If so, the access request Req_c2 is returned, otherwise, the access request Req_c2 is processed.

[0070] Figure 6 The access request to the Ceph_c1 cluster and the Ceph_c2 cluster is still being processed by RGW, and a new access request Req_c3 is received at the same time. Figure 6 In the example, it is assumed that the coroutine threshold is W. When RGW receives the access request Req_c3, it is determined that the number of current coroutines is less than the coroutine threshold, the Ceph cluster to be accessed by Req_c3 is Ceph_c3, and the first Ceph cluster identification set includes identification information of the Ceph_c1 cluster and identification information of the Ceph_c2 cluster. If there is no identification information of the Ceph_c3 cluster, the identification information of the Ceph_c3 cluster is added to the first Ceph cluster identification set. The number of the first Ceph cluster is obtained as 3, and the number of the second Ceph cluster is obtained as 2. The month-on-month change rate is 50%, and the preset adjustment ratio is 10%. If the month-on-month change rate exceeds the adjustment ratio, the access request threshold of the Ceph_c1 cluster, the access request threshold of the Ceph_c2 cluster, and the access request threshold of the Ceph_c3 cluster are adjusted to W / 3. Check whether the number of access requests of the Ceph_c3 cluster exceeds the access request threshold of W / 3. If so, return the access request Req_c3; otherwise, process the access request Req_c3.

[0071] Figure 7 RGW completes processing of access requests to Ceph_c1 and Ceph_c3 clusters, the corresponding coroutines will be destroyed, and the identification information of the Ceph_c1 cluster and the identification information of the Ceph_c3 cluster will be deleted from the first Ceph cluster identification set; the number of the first Ceph cluster is obtained as 1, and the number of the second Ceph cluster is obtained as 3. The month-on-month change rate is 200%, and the preset adjustment ratio is 10%. If the month-on-month change rate exceeds the adjustment ratio, the access request threshold of the Ceph_c2 cluster is adjusted to W.

[0072] In one embodiment, other methods for adjusting the access request threshold of each first Ceph cluster are provided, and the specific implementation is as follows: Figure 8 As shown:

[0073] Step 10241: Assign corresponding weight values ​​to each first Ceph cluster.

[0074] According to the first rate reached by the requests of each first Ceph cluster or the second rate of processing the requests of each first Ceph cluster, the corresponding weight value assigned to each first Ceph cluster is determined. The weight value assigned to the first Ceph cluster with a high first rate reached by the requests may be smaller than the weight value assigned to the first Ceph cluster with a low first rate reached by the requests. The weight value assigned to the first Ceph cluster with a high second rate may be higher than the weight value assigned to the first Ceph cluster with a low second rate.

[0075] Step 10242: Determine the access request threshold of each first Ceph cluster according to the weight value and the coroutine threshold of each first Ceph cluster.

[0076] Specifically, the coroutine threshold may be allocated according to the weight value of each first Ceph cluster to obtain the access request threshold of each first Ceph cluster.

[0077] In this embodiment, weight values ​​are assigned to each first Ceph cluster through various data, so that the number of requests for accessing the first Ceph cluster is as balanced as possible.

[0078] The step division of the above methods is only for the purpose of clear description. When implemented, they can be combined into one step or some steps can be split and decomposed into multiple steps. As long as they include the same logical relationship, they are all within the scope of protection of this patent; adding insignificant modifications to the algorithm or process or introducing insignificant designs without changing the core design of the algorithm and process are all within the scope of protection of this patent.

[0079] The second embodiment of the present application relates to a server, such as Fig. 9 As shown, it includes at least one processor 201; and a memory 202 that is communicatively connected to the at least one processor 201; wherein the memory 202 stores instructions that can be executed by the at least one processor 201, and the instructions are executed by the at least one processor 201 so that the at least one processor 201 can execute the access flow limiting method as described above.

[0080] Among them, the memory 202 and the processor 201 are connected in a bus manner, and the bus may include any number of interconnected buses and bridges, and the bus links various circuits of one or more processors and memories together. The bus can also link various other circuits such as peripherals, voltage regulators, and power management circuits together, which are all well known in the art, so they are not further described in this article. The bus interface provides an interface between the bus and the transceiver. The transceiver can be one element or multiple elements, such as multiple receivers and transmitters, providing a unit for communicating with various other devices on a transmission medium. The data processed by the processor is transmitted on a wireless medium through an antenna, and further, the antenna also receives data and transmits the data to the processor.

[0081] The processor is responsible for managing the bus and general processing, and can also provide various functions, including timing, peripheral interfaces, voltage regulation, power management, and other control functions. Memory can be used to store data used by the processor when performing operations.

[0082] The third embodiment of the present application relates to a computer-readable storage medium storing a computer program, which implements the above-mentioned access current limiting method when the computer program is executed by a processor.

[0083] Those skilled in the art can understand that all or part of the steps in the above-mentioned embodiment method can be completed by instructing the relevant hardware through a program, and the program is stored in a storage medium, including several instructions to enable a device (which can be a single-chip microcomputer, chip, etc.) or a processor to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program codes.

[0084] Those skilled in the art will appreciate that the above-mentioned embodiments are specific examples for implementing the present invention, and in actual applications, various changes may be made thereto in form and detail without departing from the spirit and scope of the present invention.

Claims

1. A method for access current limiting, characterized in that: Distributed object storage gateway used in servers, including: If it is determined that the current number of coroutines is less than the preset coroutine threshold, the number of first Ceph clusters and the number of second Ceph clusters are obtained, where the first Ceph cluster is the Ceph cluster corresponding to the request currently processed by the coroutine, and the second Ceph cluster is the Ceph cluster corresponding to the request processed by the coroutine at the last adjustment time; If it is detected that the month-on-month change rate between the number of the first Ceph clusters and the number of the second Ceph clusters meets a preset adjustment condition, adjusting the access request threshold of each of the first Ceph clusters; Obtaining the first Ceph cluster corresponding to the access request as a target Ceph cluster; If it is determined that the number of requests of the target Ceph cluster is greater than the access request threshold of the target Ceph cluster, the access request is returned; If it is detected that the month-on-month change rate between the number of the first Ceph clusters and the number of the second Ceph clusters meets a preset adjustment condition, it includes: Detecting whether the month-on-month change rate exceeds a preset adjustment ratio, and if it is determined that the month-on-month change rate exceeds the adjustment ratio, determining that the month-on-month change rate satisfies a preset adjustment condition; The adjusting the access request threshold of each of the first Ceph clusters includes: Obtaining a ratio of the coroutine threshold to the number of the first Ceph clusters; Adjust the access request threshold of each of the first Ceph clusters to the ratio or, The adjusting the access request threshold of each of the first Ceph clusters includes: Assigning a corresponding weight value to each of the first Ceph clusters; An access request threshold of each of the first Ceph clusters is determined according to the weight value of each of the first Ceph clusters and the coroutine threshold.

2. The access flow limiting method according to claim 1, characterized in that: If it is detected that the month-on-month change rate between the number of the first Ceph clusters and the number of the second Ceph clusters meets a preset adjustment condition, the method further includes: If it is determined that the month-on-month change rate does not exceed the adjustment ratio, then detect whether the time from the last adjustment time exceeds the preset time. If it is determined that the time from the last adjustment time exceeds the preset time, then determine that the detected month-on-month change rate meets the preset adjustment condition.

3. The access flow limiting method according to claim 1, characterized in that: The allocating a corresponding weight value to each of the first Ceph clusters includes: According to a first rate reached by requests from each of the first Ceph clusters or a second rate at which requests from each of the first Ceph clusters are processed, a corresponding weight value allocated to each of the first Ceph clusters is determined.

4. The access current limiting method according to any one of claims 1 to 3, characterized in that: The month-on-month change rate includes the month-on-month growth rate and the month-on-month decrease rate.

5. The access current limiting method according to claim 1, characterized in that: The coroutine threshold is determined according to the hardware parameters of the server.

6. A server, characterized in that: include: at least one processor; as well as, a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the access flow limiting method as described in any one of claims 1-5.

7. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the access flow limiting method according to any one of claims 1 to 5 is implemented.

Citation Information

Patent Citations

  • Access request distribution method and device, storage medium and computer equipment

    CN109327550A

  • Access request response method and device, apparatus and storage medium

    CN110138732A