Service quality control method and device, computer equipment and readable storage medium
By obtaining the traffic status of the target client and the traffic usage rate of the bucket, and adaptively adjusting the service quality, the problem of low service quality adjustment in traditional technology is solved, and more efficient processing and response capabilities are achieved.
Patent Information
- Application Number
- CN202411699282.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-26
- Publication Date
- 2025-03-07
- Estimated Expiration
- 2044-11-26
AI Technical Summary
When traditional distributed object storage technology handles cluster exceptions, the service quality adjustment efficiency is low and cannot effectively ensure processing efficiency.
By obtaining the traffic status of the target client and the traffic usage of the bucket, adaptively adjusting the service quality and determining the local traffic threshold of the target client to achieve traffic control.
It improves the granularity and flexibility of service quality control, can dynamically adjust service quality according to the needs of the target client, and improves the processing efficiency and response capabilities of the cluster.
Smart Images

Figure CN119583576A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of data storage, and in particular to a service quality control method, apparatus, computer equipment, computer-readable storage medium, and computer program product. Background Art
[0002] With the development of storage technology, distributed object storage technology achieves advantages such as high availability, high performance and scalability by distributing and storing data on multiple storage nodes.
[0003] However, in traditional distributed object storage technology, a storage gateway is used to process read and write requests sent by clients. The load balancing function of the storage gateway ensures that the request service for each storage bucket is basically consistent. When an abnormality occurs in the cluster and the data needs to be rebalanced, the service quality can only be adjusted globally, and the processing efficiency is low. Summary of the invention
[0004] Based on this, it is necessary to provide a service quality control method, device, computer equipment, computer readable storage medium and computer program product to address the above technical problems, which can adaptively adjust the service quality to ensure processing efficiency.
[0005] In a first aspect, the present application provides a method for controlling quality of service, the method comprising:
[0006] Obtaining the traffic of the target client; the traffic of the target client is the data traffic under the original service quality;
[0007] Based on the traffic of the target client, the traffic status of the target client and the traffic usage rate of the bucket are obtained; the traffic status indicates the numerical range of the traffic of the target client, the target client performs traffic management through the bucket, and the traffic usage rate of the bucket indicates the traffic usage of the traffic statistics of the client managed by the bucket relative to the target threshold;
[0008] Determine a local traffic threshold corresponding to the target client according to a threshold adjustment method adapted to the traffic state and the bucket traffic usage rate;
[0009] The local traffic threshold corresponding to the target client is used to perform traffic control on the target client; the local traffic threshold represents the adjusted service quality of the target client.
[0010] In one embodiment, before obtaining the traffic status of the target client and the traffic usage rate of the bucket based on the traffic of the target client, the method further includes:
[0011] In the server of each storage bucket, the numerical values corresponding to the address identifiers of each server are compared to obtain an address identifier comparison result;
[0012] Determining a main server among the servers according to the comparison result of the address identifiers;
[0013] The acquiring, based on the traffic of the target client, the traffic status of the target client and the traffic usage rate of the storage bucket includes:
[0014] The traffic of the target client is sent to the main server; the main server is used to determine the traffic status of the target client and the traffic usage rate of the bucket based on the traffic of the target client.
[0015] In one embodiment, the acquiring the traffic status of the target client and the traffic usage rate of the bucket based on the traffic of the target client includes:
[0016] Compare the traffic of the target client within the period with the original local traffic threshold; if it is greater, determine that the traffic state of the target client is a blocking state; if it is less than, determine that the traffic state of the target client is a non-blocking state;
[0017] In the case where the traffic of the target client in the period is less than a preset threshold, determining that the traffic state of the target client is an inactive state; the preset threshold is less than the original local traffic threshold;
[0018] The traffic of the clients managed by the storage bucket in the same period is accumulated to obtain the traffic statistics value of the storage bucket; and the traffic usage rate of the storage bucket is determined based on the ratio of the traffic statistics value to the target threshold.
[0019] In one embodiment, determining the local traffic threshold corresponding to the target client according to a threshold adjustment method adapted to the traffic state and the bucket traffic usage rate includes:
[0020] In the case where the traffic state is a blocking state, determining a traffic difference between the target threshold and a non-limited traffic of the storage bucket; the non-limited traffic is traffic that is managed through the storage bucket and does not belong to the client in the blocking state;
[0021] Allocating the traffic difference according to the number of clients in the blocking state managed by the storage bucket to obtain a local traffic threshold of the target client;
[0022] When the traffic state is a non-blocking state, the local traffic threshold of the target client is obtained according to a threshold adjustment method adapted to the bucket traffic usage rate.
[0023] In one embodiment, the method further comprises:
[0024] When the traffic state is an inactive state, the target threshold is allocated according to the number of clients in the inactive state managed by the storage bucket to obtain a local traffic threshold of the target client.
[0025] In one embodiment, obtaining the local traffic threshold of the target client according to the threshold adjustment method adapted to the storage bucket traffic usage rate includes:
[0026] If the traffic usage rate of the storage bucket is greater than the traffic usage rate threshold, lowering the original local traffic threshold of the target client according to the traffic usage rate of the storage bucket to obtain the local traffic threshold of the target client;
[0027] If the traffic usage rate of the storage bucket is less than the traffic usage rate threshold, the original local traffic threshold of the target client is increased according to the traffic usage rate of the storage bucket to obtain the local traffic threshold of the target client.
[0028] In one of the embodiments, when the local traffic threshold corresponding to the target client is increased, the traffic token of the target client increases the number of tokens at a preset interval until the number of traffic tokens of the target client matches the local traffic threshold.
[0029] In one of the embodiments, the target client includes a first target client and a second target client, and the priority of the first target client is higher than the priority of the second target client;
[0030] The local traffic threshold corresponding to the first target client is used to allocate the traffic token of the storage bucket as a first traffic token; the first traffic token is used to perform traffic control on the first target client;
[0031] The local traffic threshold corresponding to the second target client is used to allocate the unallocated traffic token as the second traffic token when there is an unallocated traffic token other than the first traffic token in the traffic token of the storage bucket; the second traffic token is used to perform traffic control on the second target client.
[0032] In a second aspect, the present application further provides a service quality control device, the device comprising:
[0033] An acquisition module, used to acquire the traffic of a target client; the traffic of the target client is the data traffic under the original service quality;
[0034] A conversion module, for obtaining the traffic status of the target client and the traffic usage rate of the bucket based on the traffic of the target client; the traffic status indicates the numerical interval of the traffic of the target client, the target client performs traffic management through the bucket, and the traffic usage rate of the bucket indicates the traffic usage of the traffic statistics of the client managed by the bucket relative to the target threshold;
[0035] An adjustment module is used to determine the local traffic threshold corresponding to the target client according to a threshold adjustment method adapted to the traffic state and the storage bucket traffic usage rate; the local traffic threshold corresponding to the target client is used to perform traffic control on the target client; the local traffic threshold represents the adjusted service quality of the target client.
[0036] In a third aspect, the present application further provides a computer device, wherein the computer device comprises a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the steps of the service quality control in any of the above embodiments are implemented.
[0037] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the steps of the service quality control in any of the above embodiments are implemented.
[0038] In a fifth aspect, the present application further provides a computer program product, wherein the computer program product comprises a computer program, and when the computer program is executed by a processor, the steps of controlling the quality of service in any of the above embodiments are implemented.
[0039] The above-mentioned service quality control method, device, computer equipment, computer-readable storage medium and computer program product obtain the traffic status of the target client and the bucket traffic usage rate based on the traffic of the target client, so that the service quality control granularity of the bucket can be refined, and the threshold adjustment method of the service quality can be flexibly used based on the target client. And because the bucket traffic usage rate is the ratio between the traffic statistics of the bucket and the target threshold, the threshold adjustment method can take into account the global data processing capabilities within the bucket and the target client itself; and then according to the local traffic threshold corresponding to the target client, the traffic of the target client is controlled. Therefore, adaptive negotiation and dynamic adjustment of local traffic thresholds can form a load balancing, and can assist customers in business management and control, and can also better allocate resources on demand, so that the cluster can efficiently process and respond to customer application requests. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the drawings required for use in the embodiments of the present application or related technical descriptions will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0041] Figure 1 A diagram of an application environment of a service quality control method in an embodiment;
[0042] Figure 2 A flowchart of a service quality control method in one embodiment;
[0043] Figure 3 is a flowchart of a method for controlling quality of service with priority in one embodiment;
[0044] Figure 4 A flowchart of a service quality control method in one embodiment;
[0045] Figure 5 A schematic diagram of the process of server-side screening and data conversion in one embodiment;
[0046] Figure 6 A schematic diagram of a flow chart of calculating a flow status and a storage bucket flow usage rate in one embodiment;
[0047] Figure 7 A schematic diagram of a specific flow chart of flow status and bucket flow usage rate calculation in one embodiment;
[0048] Figure 8 A schematic diagram of a flow chart of local flow threshold calculation in one embodiment;
[0049] Fig. 9 A schematic diagram of a flow chart of calculating the traffic usage rate of a storage bucket in one embodiment;
[0050] Fig.10 A schematic diagram of a local flow threshold value in an inactive state in one embodiment;
[0051] Fig.11 A schematic diagram of a local flow threshold value that does not exceed the local flow threshold value in one embodiment;
[0052] Fig.12 A schematic diagram of a local flow threshold adaptively adjusted in one embodiment;
[0053] Fig.13 A schematic diagram of a local flow threshold value in a flow limiting state in one embodiment;
[0054] Fig.14A schematic diagram of a local flow threshold value in a blocking state in one embodiment;
[0055] Fig.15 is a structural block diagram of a service quality control device in one embodiment;
[0056] Fig.16 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0057] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0058] Distributed object storage technology is a storage solution that achieves high availability, high performance, and scalability by distributing data across multiple storage nodes. Distributed object storage technology includes distributed object storage, which can provide massive data storage services and support product specifications for storing tens of billions or even hundreds of billions of objects. It is suitable for storing unstructured data such as pictures, texts, audio and video. In current mainstream video surveillance, large video storage and other actual application scenarios, customers have put forward higher and higher requirements for storage service QoS, which not only includes storage performance and specifications, but also poses more challenges to storage efficiency and adaptive service control.
[0059] The traditional distributed object storage gateway cluster uses the storage gateway to process the object read and write requests sent by the client to obtain the data objects in the storage bucket. The load balancing function of the storage gateway makes the storage gateway's request service for the storage bucket basically consistent. When the cluster is abnormal and the data needs to be rebalanced, the only way is to adjust the front-end business priority or the back-end data recovery priority globally. If there are multiple storage gateways connected to different storage buckets to handle different priority businesses, you can use the token bucket mechanism to set different thresholds for each gateway separately to change the efficiency of each storage gateway in reading and writing data. From the perspective of the cluster, the service quality of the storage bucket remains unchanged. Therefore, how to coordinate the QoS between multiple storage gateways to adjust the read and write service quality received by different storage buckets so that the normal business requests of customers are not affected by cluster abnormalities is a task that needs to be solved.
[0060] Optionally, a distributed object storage cluster can be deployed based on an object storage interface gateway (RADOS GateWay, RGW). The gateway can be deployed on a separate server by running one or more radosgw processes, or it can be deployed on the same node as the data processing service. However, in order to avoid resource competition, the radosgw process is usually chosen for implementation. The customer's actual business connects to the storage cluster through the gateway, and then performs data processing such as data reading and / or data writing on the objects in the bucket. Each gateway can connect to one or more different buckets, and identify and distinguish the target bucket of the business flow through other fields such as the bucket ID. Each bucket can also accept multiple different gateways to perform different types of data reading and writing.
[0061] After the cluster is deployed, the corresponding network bandwidth resources are basically fixed. If there are too many read and write requests corresponding to a certain storage bucket created, the corresponding network resources will also be larger, which will affect the performance of the data reading and writing process of the storage bucket with relatively high business priority in the cluster. Moreover, when the network is congested or the cluster fails, causing data recovery to occupy more bandwidth, the business of all storage buckets in the cluster will be affected. Therefore, this embodiment sets the service quality of the storage bucket to achieve adaptive adjustments such as mutual coordination and interaction between multiple gateways, so that execution resources can be better allocated on demand.
[0062] The service quality control method provided in the embodiment of the present application can be applied to Figure 1 In the application environment shown, the computer devices form a distributed network through the network, and each computer device can be a gateway or a control device of the gateway. This embodiment can be executed through the gateway, or can be implemented by forming a cluster through the gateway or a thread in the gateway.
[0063] Quality of Service (QoS) refers to the technology of providing different service levels for different types of business flows. Through the control of quality of service, business flows that are sensitive to bandwidth, input / output operations per second (IOPS), latency, etc. can be given a higher priority service level, so that the business can meet the user's needs for normal, high-performance use. Optionally, the configurable QoS information can include four types of traffic information: read / write bandwidth and read / write times per second.
[0064] Optionally, in a distributed storage cluster, the basic storage unit for data storage is a storage bucket, which can store various types of data, including images, audio, video, etc.
[0065] Optionally, the components of the storage bucket include a quality of service client (QoS-Client, QC) and a quality of service server (QoS-Serve, QS); the quality of service client and the quality of service server can both be threads, for example, the quality of service client can be an object storage interface gateway, and the object storage interface gateway is an interface for distributed object storage to provide object storage services to the outside world.
[0066] Optionally, the service quality client is the execution entity for performing traffic statistics on the gateway; optionally, the service quality client is used to transmit the traffic situation of the gateway of this node, the gateway status, and the bucket service quality set by the user to the bucket server to perform traffic statistics on the bucket.
[0067] Optionally, the server is used to summarize the traffic statistics and status information reported by all QCs in each cycle, and calculate the bucket traffic utilization rate; the bucket traffic utilization rate can be the difference between the total data traffic of the bucket in the cycle and the target threshold, and the difference value can be a ratio or a percentage, and the difference value can also be the result of adjustment based on the difference or ratio between the total traffic and the target threshold.
[0068] Optionally, the QoS client can also perform flow control management through a flow bucket, i.e., a flow token bucket. A flow bucket is a virtual bucket that performs flow control management based on the flow information of the current QoS client. It is used to periodically deliver flow tokens to the QoS client to avoid traffic surges that cause the flow tokens allocated to the QoS client to be exhausted in a short period of time, resulting in performance jitter.
[0069] Optionally, the main QoS server is globally unique and is elected by the gateway on each node, and the QoS client is the RGW gateway on each node. After the cluster is deployed and resources such as storage pools and buckets are created, the QoS client starts to read and / or write objects in the corresponding bucket. The QoS client is responsible for counting the traffic information of the current gateway and reporting the gateway's traffic, gateway status, bucket target threshold, etc. to the main QoS server every 5 seconds. The main QoS server aggregates the traffic information of the QoS client, calculates the percentage of the total traffic to the bucket target threshold based on whether the gateway is blocked, whether it is limited, and the non-limited traffic of the gateway, and then sends the calculated total traffic and bucket traffic usage, the number of inactive gateways, the number of blocked gateways, and other information to each QoS client for update.
[0070] The local traffic threshold of the QoS client is calculated by the QoS client based on the traffic status when reporting traffic to the main QoS server in the previous cycle and the percentage obtained from the main QoS server, and then the traffic bucket information is updated. The traffic bucket distributes traffic "tokens" to the corresponding QoS client. The QoS client that gets the token can further process the business, while the business of other QoS clients needs to wait. The update of the local traffic threshold of each QoS client is related to the total reported traffic and the current status counted in this cycle.
[0071] In an exemplary embodiment, Figure 2 As shown, a service quality control method is provided, which is applied to Figure 1 The computer device in the example is used to illustrate, including the following steps 202 to 206. Among them:
[0072] Step 202, obtaining the traffic of the target client; the traffic of the target client is the data traffic under the original service quality.
[0073] The traffic of the target client is data traffic processed by the target client, and the target client is a client controlled by the quality of service. Optionally, the traffic of the target client can be data reading traffic through the target client, or data storage traffic through the target client.
[0074] The original quality of service is a client-level quality of service, which is used to indicate the degree of flow restriction of the target client; the original quality of service is applied to the original local flow threshold of the target client, and after the flow of the target client is limited by the original local flow threshold, the flow of the target client is the flow under the original quality of service. Before executing step 204 and step 206, the flow of the target client is flow controlled based on the original quality of service, and after step 206, the flow of the target client is controlled by the adjusted service instruction.
[0075] Optionally, when a network anomaly occurs in the target client or the storage bucket to which the target client belongs, step 206 is not performed, and flow control is continued with the original service quality.
[0076] In an optional embodiment, obtaining the traffic of the target client includes: during the execution of the service by the target client, monitoring the traffic of at least one operation of data reading and data storage through a monitoring thread corresponding to the target client to obtain the traffic of the operation. Thus, the traffic of the target client can be at least one of the read and write performances, so that the data reading performance and the data writing performance can be regulated separately to further refine the control of the service quality and increase flexibility.
[0077] In an optional embodiment, obtaining the traffic of the target client includes: monitoring the traffic of the target client at a preset time interval or frequency to obtain the traffic of the target client. Thus, a traffic monitoring cycle is formed, so that the traffic of the target client can be adjusted according to the applicability of the monitoring cycle to further improve flexibility, and the real-time adjusted service quality is guaranteed to be more suitable for the traffic demand of the target client through the result of the cycle feedback.
[0078] Step 204, based on the traffic of the target client, obtain the traffic status of the target client and the traffic usage rate of the bucket; the traffic status indicates the numerical range of the traffic of the target client, the target client manages the traffic through the bucket, and the traffic usage rate of the bucket indicates the traffic usage of the traffic statistics of the client managed by the bucket relative to the target threshold.
[0079] The traffic state is qualitative data related to the traffic of the target client, indicating the traffic nature of the target client. The traffic state is the traffic information from the perspective of the target client. Optionally, the traffic state belongs to a type of information in the traffic information of the current gateway.
[0080] Optionally, the traffic state indicates the numerical range of the target client's traffic under the original service quality, so that more detailed traffic control can be performed for the original service quality. Optionally, the traffic state includes but is not limited to active state and inactive state, blocking state and non-blocking state. The client with read and write requests is in the active state, and the gateway where the client without read and write requests is in the inactive state; when the client's traffic exceeds the local original threshold, the gateway where the client is located is in the blocking state, otherwise it is in the non-blocking state.
[0081] Optionally, the traffic status can be used to classify the traffic of the target client to form different control methods. Optionally, if the current traffic of the target client does not exceed the original local traffic threshold corresponding to the target client, it is non-limited traffic; if the current traffic of the target client exceeds the original local traffic threshold corresponding to the target client, it is limited traffic; the threshold adjustment methods corresponding to non-limited traffic and limited traffic are different.
[0082] Bucket traffic usage is quantitative data related to the traffic managed by the bucket where the target client is located, indicating the overall traffic usage of the bucket. Bucket traffic usage is traffic information from the bucket perspective; bucket traffic usage is defined relative to the target threshold, so the execution conditions of the threshold adjustment method can be adjusted according to the target threshold, so as to adjust the original local traffic threshold more finely and appropriately.
[0083] The bucket traffic usage indicates the traffic usage of the traffic statistics of the client managed by the bucket relative to the target threshold. Optionally, the bucket traffic usage is the ratio of the traffic statistics to the target threshold, or the processed result of the difference.
[0084] The target threshold is the traffic threshold for traffic management of a bucket. The target threshold is set by command for a bucket's traffic threshold. The target threshold of a bucket is greater than or equal to the client's local traffic threshold to reflect the traffic information at the bucket level. Optionally, the target threshold can be set for different projects. For example, the target threshold can be set separately for read and write IOPS, read and write bandwidth, etc., and can be set for one item alone or multiple items at the same time.
[0085] The traffic statistics value is the traffic statistics result of the clients managed by the bucket. The bucket can manage multiple clients, including the target client. Optionally, the traffic statistics value can be the accumulated traffic value of each client managed by the bucket in the same period, or the accumulated traffic value of some clients managed by the bucket in the same period.
[0086] In an optional embodiment, based on the traffic of the target client, the traffic status of the target client and the bucket traffic usage rate are obtained, including: sending the traffic of the target client to a server for service quality control, and the server determining the traffic status of the target client based on the traffic of the target client; the server obtaining the bucket traffic usage rate based on the traffic of the target client and the traffic of clients belonging to the same bucket as the target client; and the server sending the traffic status of the target client and the bucket traffic usage rate to the target client.
[0087] In an optional embodiment, based on the traffic of the target client, the traffic status of the target client and the traffic usage rate of the bucket are obtained, including: when the target client acts as a server, based on the traffic of the target client, determining the traffic status of the target client; obtaining the traffic of other clients from other clients that manage data in the bucket; and determining the traffic usage rate of the bucket based on the data traffic managed by the bucket and the target threshold.
[0088] Step 206, determine the local traffic threshold corresponding to the target client according to the threshold adjustment method adapted to the traffic status and the bucket traffic usage rate; wherein the local traffic threshold corresponding to the target client is used to perform traffic control on the target client; the local traffic threshold represents the adjusted service quality of the target client.
[0089] The threshold adjustment method is a calculation method used to adjust the service quality adaptively. Since the traffic status is client-level data, equivalent to local data, and the bucket traffic usage rate is bucket-level data, equivalent to global data, the threshold adjustment method is adaptively changed based on local data and global data.
[0090] The local flow threshold is an adjusted local flow threshold, which is used to control the flow of the target client after adjustment. Since it is used to control the flow of the target client, the local flow threshold represents the adjusted service quality of the target client, so that the service quality of the target client can be quantified. Optionally, in different adjustment modes, the local flow threshold can be re-determined or adjusted based on the original local flow threshold.
[0091] In an optional embodiment, the local traffic threshold corresponding to the target client is determined according to a threshold adjustment method adapted to the traffic status and the bucket traffic usage rate, including: mapping according to the traffic status and the bucket traffic usage rate to obtain the threshold adjustment method; determining the local traffic threshold corresponding to the target client based on the data required by the threshold adjustment method and the function of the threshold adjustment method.
[0092] In an optional embodiment, the local traffic threshold corresponding to the target client is determined according to a threshold adjustment method adapted to the traffic state and the bucket traffic usage rate, including: judging whether to use the bucket traffic usage rate to determine the threshold adjustment method according to the traffic state; if so, determining the threshold adjustment method based on the bucket traffic usage rate, and determining the local traffic threshold corresponding to the target client through the threshold adjustment method; if not, determining the threshold adjustment method based on the traffic state, and determining the local traffic threshold corresponding to the target client through the threshold adjustment method. Therefore, since the traffic state is qualitative data and local data, the processing efficiency is relatively high, and thus firstly making a conditional judgment based on the traffic state and then selecting the corresponding threshold adjustment method can ensure that the selection efficiency is relatively high, so as to improve the speed of adaptive adjustment.
[0093] In an exemplary embodiment, Figure 3As shown, the target clients are QC-1, QC-2 and QC-N; QC-1, QC-2 and QC-N respectively perform traffic statistics for business reading and writing, and all report traffic information and status information to the corresponding server QS. The server summarizes the traffic information, obtains the bucket traffic usage rate, and feeds back the corresponding bucket traffic usage rate to QC-1, QC-2 and QC-N. QC-1, QC-2 and QC-N each have their own traffic channels for traffic token distribution, and process read and write tasks through the traffic tokens of each target client. When the priority of QC-N is low, no traffic token is allocated to QC-N until the business processing of QC-1 or QC-2 with a higher priority is completed.
[0094] In the above-mentioned service quality control method, based on the traffic of the target client, the traffic status of the target client and the traffic usage rate of the bucket are obtained, so that the service quality control granularity of the bucket can be refined, and the threshold adjustment method of the service quality can be flexibly used based on the target client. For example, the service quality policy can be dynamically adjusted based on factors such as the importance of the object, the access frequency, and the data processing priority. Moreover, since the traffic usage rate of the bucket is the ratio between the traffic statistics of the bucket and the target threshold, the threshold adjustment method can take into account the global data processing capacity of the bucket and the target client itself; and then according to the local traffic threshold corresponding to the target client, the traffic of the target client is controlled. Therefore, adaptive negotiation and dynamic adjustment of the local traffic threshold can form a load balancing, and can assist customers in business management and control, and can also better allocate resources on demand, so that the cluster can efficiently process and respond to customer application requests.
[0095] In an exemplary embodiment, Figure 4 As shown, before obtaining the traffic status of the target client and the traffic usage rate of the storage bucket based on the traffic of the target client, the method includes steps 402 to 404, and correspondingly, obtaining the traffic status of the target client and the traffic usage rate of the storage bucket based on the traffic of the target client includes step 406. Wherein:
[0096] Step 402: In the server of each storage bucket, the numerical values corresponding to the address identifiers of each server are compared to obtain an address identifier comparison result.
[0097] The server is a component of the bucket, which can be a thread, a process, or another computer device other than the computer device 102. Optionally, the server is a quality of service server set for one or more buckets, which can aggregate the traffic information of the quality of service client and determine the traffic status of the target client in combination with whether the target client is blocked, whether it is limited, and the non-limited traffic of the target client.
[0098] The address identifier of the server can be used to determine the server to call the server. Optionally, when the server is a thread, a process or a computer device, the address identifier may include an IP address; and when the server is a thread or a process, the address identifier may include an IP address and may also include a thread identifier or a process identifier.
[0099] Optionally, the value corresponding to the address identifier of the server can be the value of the address identifier of the server itself, and when the distributed gateways are concentrated in the same area, the value corresponding to the address identifier of the server can also be the value of a certain network segment of the address identifier. In this case, the value corresponding to the address identifier is relatively small, and the comparison process is faster. For example: the IP address of a server is 192.168.46.55, and the value of the network segment 55 can be used as the value corresponding to the address identifier of this server.
[0100] The address identifier comparison result is a sorting result of the numerical values corresponding to the address identifiers. Optionally, the maximum value, the minimum value or the size sequence of the numerical values corresponding to the address identifiers can be determined in the numerical values corresponding to the address identifiers through the address identifier comparison result.
[0101] Step 404, determining the main server among the servers according to the comparison result of the address identifiers.
[0102] The master server is a server selected from the servers. The master server is used to determine the traffic status and bucket traffic usage of each client, including the target client; the servers of other clients maintain communication and information synchronization with the master server, so that when the master server is abnormal, the server can be re-determined as the master server.
[0103] Optionally, if the cluster has only one storage bucket of a gateway node, then no additional election is required, and the server contained in the storage bucket of this node is directly defaulted as the primary server to execute step 202. Optionally, if the cluster has multiple gateway nodes and the primary server fails, the server on the gateway node with the second smallest IP address will take over the information of the failed server and continue to perform the statistical task of service quality control to execute step 202.
[0104] In an optional embodiment, in the server of each storage bucket, the numerical values corresponding to the address identifiers of each server are compared to obtain the address identifier comparison result, including: the client starts to elect the server of the storage bucket; multiple gateway processes of the same node select the gateway process with the smallest process number to vote, and obtain the address identifier with the smallest process number; in each storage bucket, the address identifier with the smallest process number is used as the server of each storage bucket; the IP address of the gateway where each storage bucket is located is compared to obtain the server with the smallest IP address in each storage bucket;
[0105] Correspondingly, according to the comparison result of the address identifiers, a main server among the servers is determined, including: taking the server with the smallest IP address as the main server among the servers.
[0106] Step 406, sending the traffic of the target client to the main server; the main server is used to determine the traffic status of the target client and the traffic usage rate of the bucket based on the traffic of the target client.
[0107] Optionally, the main server is used to compare the traffic of the target client within the period with the original local traffic threshold; if it is greater, the traffic state of the target client is determined to be a blocking state; if it is less than, the traffic state of the target client is determined to be a non-blocking state.
[0108] Optionally, the main server is used to determine that the traffic state of the target client is an inactive state when the traffic of the target client within a period is less than a preset threshold.
[0109] Optionally, the main server is used to accumulate the traffic of the clients managed by the bucket in the same period to obtain the traffic statistics of the bucket; based on the ratio of the traffic statistics to the target threshold, determine the traffic usage rate of the bucket.
[0110] Optionally, when the traffic status of the target client and the bucket traffic usage rate are determined by the main server, the traffic status of the target client and the bucket traffic usage rate can be fed back to the gateway or node where the target client is located, so that the target client can obtain its own traffic status and bucket traffic usage rate, and then continue to execute steps 204 and 206.
[0111] In an exemplary embodiment, Figure 5 As shown in the figure, the client is the QC role and the server is the QS role; correspondingly, the gateway node may be configured with one or more gateway processes, and the gateway processes correspond to different process numbers. After the gateway node is started, the gateway as QC will start to elect QS and vote. Multiple gateway processes of the same node select the gateway with the smallest process number for voting, and the default will be voted for this node as the main QS. When the gateway processes of other nodes are also started, they will also vote for themselves first, and then exchange votes with gateways other than this node. If a gateway with a smaller IP address than the gateway of this node is found, the vote will be cast for the gateway with the smaller IP address until the gateway node with the smallest IP address is selected as the main QS. The QS of other nodes maintain communication and information synchronization with the main QS. If there is only one gateway node in the gateway cluster, there is no need for additional elections, and the node is directly defaulted as the main QS. If there are multiple gateway nodes in the cluster and the main QS fails, the QS on the gateway node with the second smallest IP address will take over the information of the failed QS and continue to perform QoS tasks.
[0112] In this embodiment, the master server is selected from each server through the value corresponding to the address identifier. When the original master server is abnormal, a new master server can be selected efficiently and accurately to ensure the stability of the cluster where each bucket is located. Moreover, the data of different buckets can be aggregated to the same master server, so that this master server and other servers can perform different tasks, so its operation stability is relatively high, and it can run the corresponding tasks in a targeted manner. In this case, the traffic status and bucket traffic usage rate are determined by the master server, and then the target client obtains its own traffic status and bucket traffic usage rate, which can ensure processing efficiency and stability.
[0113] In an exemplary embodiment, Figure 6 As shown, based on the traffic of the target client, the traffic state of the target client and the traffic usage rate of the bucket are obtained, including at least one of step 602 and step 604, and step 606, wherein:
[0114] Step 602, compare the traffic of the target client in the period with the original local traffic threshold; if it is greater, determine that the traffic state of the target client is a blocking state; if it is less than, determine that the traffic state of the target client is a non-blocking state.
[0115] The original local traffic threshold is the traffic threshold assigned to the target client under the original quality of service. When the traffic of the target client exceeds the original local traffic threshold, the traffic of the target client is in a blocking state with a relatively large traffic limit; when the traffic of the target client is less than the original local traffic threshold, the traffic of the target client is in a non-blocking state with a relatively small traffic limit.
[0116] The target client in the blocking state and other clients in the blocking state determine the local traffic threshold based on the non-limited traffic and the target threshold, as well as the corresponding threshold adjustment method. Correspondingly, the target client in the non-blocking state determines the local traffic threshold based on the traffic usage rate of the storage bucket where the target client is located, as well as the corresponding threshold adjustment method.
[0117] In an optional embodiment, comparing the traffic of the target client in a period with the original local traffic threshold includes: comparing the traffic value of the target client in the same period with the original local traffic threshold. Thus, by comparing each period separately, it is helpful to improve flexibility and accuracy.
[0118] In an optional embodiment, comparing the traffic of the target client in a period with the original local traffic threshold includes: comparing the traffic of the target client in multiple periods with the original local traffic threshold; wherein the traffic of the target client is counted separately for each period. Thus, by comparing separately for multiple periods, it is helpful to reduce the same resources and improve processing efficiency.
[0119] In an optional embodiment, determining that the traffic state of the target client is a blocking state includes: determining a value corresponding to the traffic state field of the target client as a value for indicating the blocking state.
[0120] In an optional embodiment, determining that the traffic state of the target client is a blocking state includes: recording an identifier of the target client in a table for indicating the blocking state.
[0121] In an optional embodiment, determining that the traffic state of the target client is a non-blocking state includes: recording an identifier of the target client in a table for indicating a non-blocking state.
[0122] Step 604: When the traffic of the target client in the period is less than a preset threshold, determine that the traffic state of the target client is an inactive state; the preset threshold is less than the original local traffic threshold.
[0123] The preset threshold is a preset reference value for determining whether the target client has traffic transmission. Optionally, when the traffic of the target client in a period is less than the preset threshold, the traffic of the target client can be regarded as 0, and the traffic state of the target client is inactive.
[0124] The target client in the inactive state may determine its corresponding local traffic threshold based on the number of clients in each inactive state, the target threshold and the corresponding adjustment method.
[0125] In an optional embodiment, determining that the traffic state of the target client is an inactive state includes: recording an identifier of the target client in a table for indicating an inactive state.
[0126] In an optional embodiment, determining that the traffic state of the target client is an inactive state includes: determining a value corresponding to the traffic state field of the target client as a value for indicating the inactive state.
[0127] Step 606, accumulate the traffic of the clients managed by the bucket in the same period to obtain the traffic statistics of the bucket; determine the traffic usage rate of the bucket based on the ratio of the traffic statistics to the target threshold.
[0128] In an optional embodiment, the traffic of the clients managed by the bucket in the same period is accumulated to obtain the traffic statistics of the bucket, including: for the bucket used to manage the target client, the traffic of each client managed by the bucket in the same period is accumulated through the server to obtain the traffic statistics of the bucket in the period. Thus, the storage bucket to which it belongs is managed through the server.
[0129] In an optional embodiment, the traffic of the clients managed by the buckets in the same period is accumulated to obtain the traffic statistics of the buckets, including: by the main server, the traffic of the target clients managed by each bucket in the same period is accumulated to obtain the traffic statistics of each bucket. Thus, each bucket is managed by the main server.
[0130] In an exemplary embodiment, Figure 7 As shown in the figure, after the cluster is deployed, if all clients have not started to execute read and write requests, each client is in an inactive state, and the initial value of the local traffic threshold corresponding to each client is the target threshold of the bucket / total number of clients. If the cluster has been reading and writing for a period of time, and the user sets the target threshold of a bucket, all clients will count the average traffic according to the period of 5s, and report the statistical value to the main server. When the server receives the report information from the client for the first time, it determines the status record of the gateway node where each client is located, accumulates the reported traffic, and counts whether the gateway node is active, whether the traffic is blocked, and the gateway non-limited traffic. The judgment rule is: if the traffic reported by the client is 0, it means that the gateway did not accept read and write in the previous cycle and is in an inactive state, and the count is accumulated, otherwise the gateway is active; if the traffic reported by the client is greater than the current local traffic threshold of the client, it means that the traffic exceeds the limit, the gateway will be marked as blocked, and the count will also be accumulated; if the traffic reported by the client does not exceed the local traffic threshold, it will not be limited, and the server accumulates the reported traffic as non-limited information for statistics.
[0131] The main server then calculates the total traffic value and the percentage of the target threshold of the bucket, and then returns the total traffic value, percentage value, number of currently inactive gateways, number of gateways with blocked traffic, and other information to each client. The client calculates the local traffic threshold based on the returned information and the status of the gateway when it last reported.
[0132] In this embodiment, when the traffic state is in a blocked state or a non-blocked state, the traffic exceeds the original local traffic threshold, so that the traffic in the period can pass the corresponding maximum value, and the corresponding threshold adjustment method is dynamically selected. In the case of an inactive state in the traffic state, the corresponding threshold adjustment method can be dynamically selected through a relatively small traffic state. By accumulating the traffic in the same period to obtain the traffic statistics value, and determining the bucket traffic usage rate through the corresponding ratio, it helps to improve processing efficiency and more efficiently manage large-scale clients.
[0133] In an exemplary embodiment, Figure 8 As shown, according to the threshold adjustment method adapted to the traffic state and the bucket traffic usage, the local traffic threshold corresponding to the target client is determined, including:
[0134] Step 802, when the traffic state is a blocking state, determine the traffic difference between the target threshold and the non-limited traffic of the bucket; the non-limited traffic is the traffic of the client that is not in the blocking state and is traffic managed through the bucket.
[0135] In an optional embodiment, determining the flow difference between the target threshold and the non-current-limited flow of the bucket includes: calculating the difference between the target threshold and the non-current-limited flow of the same bucket in the same period, and using the difference as the flow difference.
[0136] In an optional embodiment, determining the flow difference between the target threshold and the non-current-limited flow of the bucket includes: determining the difference between the target threshold and the non-current-limited flow of the bucket; determining an absolute value of the difference; and using the absolute value as the flow difference.
[0137] Step 804, distribute the traffic difference according to the number of clients in the blocking state managed by the storage bucket to obtain the local traffic threshold of the target client.
[0138] The number of clients is the number of clients in the Blocked state that are managed by the same bucket as the target client in the Blocked state.
[0139] In an optional embodiment, the traffic difference is allocated according to the number of clients in a blocked state managed by the storage bucket to obtain the local traffic threshold of the target client, including: dividing the traffic difference by the number of clients in a blocked state managed by the storage bucket to obtain the local traffic threshold of the target client.
[0140] In an optional embodiment, the traffic difference is allocated according to the number of clients in a blocked state managed by the storage bucket to obtain a local traffic threshold of the target client, including: determining the priority of the clients in a blocked state managed by the storage bucket; and allocating traffic tokens adapted to the traffic difference according to the client priority to obtain the local traffic threshold of the target client.
[0141] Step 806, when the traffic state is in a non-blocking state, the local traffic threshold of the target client is obtained according to a threshold adjustment method adapted to the bucket traffic usage rate.
[0142] In an optional embodiment, the local traffic threshold of the target client is obtained according to a threshold adjustment method adapted to the bucket traffic usage, including: mapping the bucket traffic usage to obtain the local traffic threshold of the target client.
[0143] In this embodiment, the traffic state is first used to make a qualitative judgment, and when the traffic state cannot be used, the bucket traffic usage rate is determined to make an adjustment to form a quantitative adjustment, thereby ensuring processing efficiency. When the target client is in a blocked state, the traffic difference allocation is performed separately for the blocked client, which can achieve traffic adaptation of the blocked target client without affecting the non-blocked client.
[0144] In an optional embodiment, the method further includes: when the traffic state is an inactive state, allocating the target threshold according to the number of inactive clients managed by the storage bucket to obtain a local traffic threshold of the target client.
[0145] In an optional embodiment, a target threshold is allocated according to the number of inactive clients managed by the storage bucket to obtain a local traffic threshold of the target client, including: for a storage bucket used for data management of the target client, the target threshold is averaged by the number of inactive clients managed by the storage bucket to obtain an averaged result; and the averaged result is used as the local traffic threshold of the target client.
[0146] In an optional embodiment, a target threshold is allocated according to the number of inactive clients managed by the bucket to obtain a local traffic threshold of the target client, including: a server having a bucket for data management of the target client divides the target threshold of the bucket by the number of inactive clients managed by the bucket to obtain a ratio result; and the ratio result is used as the local traffic threshold of the target client.
[0147] In this embodiment, when the traffic state of the target client is inactive, the number of inactive clients is used to allocate the target threshold, so that the local traffic threshold of the inactive state in this cycle is relatively high, so that the inactive target client can provide higher traffic when processing data. Since the traffic of the inactive target client in the previous cycle is relatively small, even if the local traffic threshold allocated to the target client is relatively high, the impact on the threshold of the storage bucket is relatively small, and it will not affect the overall processing efficiency of the storage bucket.
[0148] In an optional embodiment, the local traffic threshold of the target client is obtained according to a threshold adjustment method adapted to the bucket traffic usage rate, including: if the bucket traffic usage rate is greater than the traffic usage rate threshold, then the original local traffic threshold of the target client is lowered according to the bucket traffic usage rate to obtain the local traffic threshold of the target client; if the bucket traffic usage rate is less than the traffic usage rate threshold, then the original local traffic threshold of the target client is increased according to the bucket traffic usage rate to obtain the local traffic threshold of the target client.
[0149] The traffic usage threshold is the usage standard of the bucket traffic. When the bucket traffic usage is greater than the traffic usage threshold, the data traffic used by the clients of the bucket exceeds the expected traffic usage threshold; and when the bucket traffic usage is less than the traffic usage threshold, the data traffic used by the clients of the bucket is lower than the expected traffic usage threshold.
[0150] Optionally, the traffic usage threshold is 100% or 1; optionally, if the bucket traffic usage is greater than 1, the original local traffic threshold of the target client is divided by the bucket traffic usage to obtain the local traffic threshold of the target client, so that the original local traffic threshold is lowered; if the bucket traffic usage is less than 1, the original local traffic threshold of the target client is divided by the bucket traffic usage to obtain the local traffic threshold of the target client, so that the original local traffic threshold is increased.
[0151] Optionally, from a cycle perspective, the original local traffic threshold flow is the local traffic threshold of the previous cycle; on this basis, since the bucket traffic usage rate can be greater than 100% or less than 100%, it can be decreased or increased by percentage, and its expression is as follows:
[0152] Current local traffic threshold = local traffic threshold of the previous period / Ratio; Ratio is the traffic usage rate of the bucket.
[0153] In this embodiment, the bucket traffic usage rate is used to determine the adjustment method of the original local traffic threshold and to adjust the original local traffic threshold. Thus, the amount of data used for processing is relatively small, which helps to improve processing efficiency.
[0154] In an optional embodiment, when the local traffic threshold corresponding to the target client is increased, the traffic token of the target client increases the number of tokens at a preset interval until the number of traffic tokens of the target client matches the local traffic threshold.
[0155] The preset interval is used to slow down the increase speed of the traffic token of the target client to avoid a sudden increase in traffic, which may cause the traffic allocated to the target client to be exhausted in a short time and cause performance jitter. Optionally, the preset interval can be data such as time length, number of cycles, etc.
[0156] The number of tokens is the number of traffic tokens added to the target client at each preset interval. The number of tokens added can be determined based on a local traffic threshold to improve processing efficiency.
[0157] Exemplarily, after the local traffic threshold of the target client is obtained, traffic is delivered to the traffic bucket of the target client at intervals of 10 ms, and the amount delivered each time is the local traffic threshold / 1000.
[0158] In an optional embodiment, the traffic token of the target client increases the number of tokens at a preset interval until the number of traffic tokens of the target client matches the local traffic threshold, which means that: a process of the computer device delivers the number of tokens to the traffic bucket of the target client at a preset interval until the number of traffic tokens contained in the traffic bucket of the target client matches the local traffic threshold, and then stops delivering the number of tokens.
[0159] In this embodiment, when the local traffic threshold is increased, in order to avoid a sudden increase in traffic that causes the traffic allocated to the target client to be exhausted in a short period of time and causes performance jitter, the number of traffic tokens is gradually increased at preset intervals until the number of traffic tokens of the target client matches the local traffic threshold, so that the actual traffic threshold of the target client matches the increased local traffic threshold. In this way, under the premise of adaptively adjusting the local traffic threshold, performance jitter of the target client can be avoided.
[0160] In an optional embodiment, the target client includes a first target client and a second target client, and the priority of the first target client is higher than the priority of the second target client;
[0161] a local flow threshold corresponding to the first target client, used to allocate the flow token of the storage bucket as a first flow token; the first flow token is used to perform flow control on the first target client;
[0162] The local traffic threshold corresponding to the second target client is used to allocate the unallocated traffic token as the second traffic token when there is an unallocated traffic token other than the first traffic token in the traffic token of the storage bucket; the second traffic token is used to perform traffic control on the second target client.
[0163] The first traffic token is allocated before the second traffic token. Therefore, when the first target client has used up the traffic tokens in the bucket, there is no unallocated traffic token. At this time, there is no second traffic token, and the second target client has no corresponding traffic.
[0164] In this embodiment, by setting the quality of service of the storage bucket, forming the first target client and the second target client with different priorities, dynamic adjustment and network resource allocation can be performed according to the priorities of different objects or requests. Its flexibility can ensure that key tasks are processed first while making full use of network resources and optimizing the overall efficiency of the system.
[0165] In an exemplary embodiment, Fig. 9 As shown in the figure, the client is QC, the corresponding server is QS, the bucket traffic usage is a percentage value, the bucket traffic usage is Ratio, the traffic usage threshold is 100%, the original local traffic threshold is the local traffic threshold of the previous cycle, and the calculation steps of the local traffic threshold of the target client are as follows: Fig. 9 As shown;
[0166] Among them, when QC receives the percentage value, the number of inactive QCs, the number of blocked QCs, the non-limited traffic and other information returned by QS, the target QC calculates the local traffic threshold of the target QC. The calculation method is as follows:
[0167] If the target QC is inactive, the local traffic threshold is bucket target threshold / number of inactive gateways;
[0168] In the previous cycle, if the traffic reported by the target QC does not exceed the original local traffic threshold, it means that the target QC is not limited.
[0169] If Ratio>=100%, the local traffic threshold of QC decreases by percentage based on the local traffic threshold of the previous cycle, that is, the local traffic threshold of the current cycle = the local traffic threshold of the previous cycle / Ratio;
[0170] If Ratio<=100%, the local traffic threshold of QC is increased by percentage based on the local traffic threshold of the previous cycle, that is, the local traffic threshold of the current cycle = the local traffic threshold of the previous cycle / Ratio, and the obtained local traffic threshold cannot exceed the bucket target threshold. Optionally, if the local traffic threshold is greater than the target threshold, it is adjusted to the target threshold.
[0171] In the previous cycle, if the traffic reported by the target QC exceeds the local traffic threshold of the previous cycle, the target QC is limited and the blocking status is recorded. The local traffic threshold of the current cycle = (bucket target threshold - non-limited traffic) / number of blocked gateways.
[0172] In addition, in order to avoid performance jitter caused by the traffic tokens allocated by QC being exhausted in a short time due to a sudden increase in traffic, the traffic token bucket corresponding to the target QC is used to deliver traffic to the target QC at intervals of 10ms, and the amount delivered each time is the local traffic threshold corresponding to the target QC / 1000.
[0173] In a specific embodiment, after the cluster is deployed, three gateway nodes are connected, and an RGW gateway process is started on each gateway node. There are a total of three QCs, namely QC-1, QC-2 and QC-3. After election, the first gateway node serves as the main QS.
[0174] After creating a bucket, the write bandwidth of the bucket is set to 300MB / s. According to the above process, in the initial state, each QC is inactive, and the corresponding local traffic threshold is 300 / 3=100MB / s. Fig.10 shown.
[0175] Then, it is detected that the user uses two gateways QC-1 and QC-2 to connect to the bucket for reading and writing, and QC-3 is not used temporarily. Assume that the current write bandwidth flow of QC-1 is 110MB / s, and the current write bandwidth flow of QC-2 is 90MB / s. After 5 seconds, it is reported to QS for statistics and percentage calculation. QC receives the returned calculation results and updates the threshold.
[0176] The actual traffic of QC-1 is 110MB / s, which exceeds the corresponding local traffic threshold of 100MB / s. It is limited and the reported status is blocked. The reported traffic is 100MB / s.
[0177] The actual flow of QC-2 is 90MB / s, which does not exceed the corresponding local flow threshold of 100MB / s. It is not limited, the reported status is non-blocking, the reported flow is the actual 90MB / s, and the non-limited flow is recorded as 90MB / s.
[0178] QC-3 is not enabled, the actual traffic is 0, and it is not limited, but the reported traffic status is inactive.
[0179] QS receives the reported information, calculates the total traffic as 100+90=190MB / s, and calculates the percentage as Ratio=190 / 300, which is less than 100%, with 1 blocked gateway, 1 inactive gateway, and 90MB / s of non-limited traffic. It returns the information to QC.
[0180] QC-1 updates the corresponding local traffic threshold, and because it is limited and blocked, the corresponding local traffic threshold = (bucket target threshold - non-limited traffic) / number of blocked gateways = (300-90) / 1 = 210MB / s.
[0181] QC-2 updates the corresponding local traffic threshold. Since it is not limited, the state is non-blocking, and Rati0<100%, the corresponding local traffic threshold = the local traffic threshold corresponding to the previous cycle / Ratio=90 / 190 / 300=142MB / s.
[0182] QC-3 updates the corresponding local traffic threshold: Because QC-3 is not started, the reported traffic is 0 and the status is inactive. The corresponding local traffic threshold = bucket target threshold / number of inactive gateways = 300 / 1 = 300MB / s.
[0183] After the first update, the local flow threshold of each QC is as follows: Fig.11 shown.
[0184] Next, the second update of the local traffic threshold is performed. QC1 and QC-2 continue to maintain the current write bandwidth traffic for write operations, and QC-3 continues not to increase the traffic.
[0185] The last reported traffic of QC-1 was 100MB / s. This time, because the actual traffic did not exceed the corresponding local traffic threshold of 210MB / s, it was not limited and the reported status was non-blocking. Therefore, the reported traffic this time was 110MB / s.
[0186] The last reported traffic of QC-2 was 90MB / s. This time, because the actual traffic did not exceed the corresponding local traffic threshold of 142MB / s, it was not limited and the reported status was non-blocking. Therefore, the reported traffic this time is still 90MB / s.
[0187] QC-3 is not enabled, the actual traffic is 0, it is not limited, and the reported status is inactive.
[0188] QS receives the reported information and calculates the total flow as 110+90=200MB / s. The calculated percentage is Ratio=200 / 300, which is less than 100%. The corresponding local flow threshold of the non-blocking QC needs to be increased. The blocking gateway is 0, the inactive gateway is 1, and the non-limited flow is 110+90=200MB / s. QS returns the corresponding information to the three QCs.
[0189] Then, QC-1 updates the corresponding local traffic threshold, which is not limited, Ratio<100%, and the corresponding local traffic threshold = 110 / (200 / 300) = 150MB / s; QC-2 updates the corresponding local traffic threshold, which is not limited, Ratio<100%, and the corresponding local traffic threshold = 90 / (200 / 300) = 135MB / s; QC-3 updates the corresponding local traffic threshold, which is not limited, and the corresponding local traffic threshold = 300 / 1 = 300MB / s.
[0190] From the second adjustment, we can see that even if the flow of each QC remains unchanged, the corresponding local flow threshold will change. Fig.12 shown.
[0191] Then, the third update of the local traffic threshold is performed. QC-3 is enabled, the write bandwidth of QC-1 is increased to 210 MB / s, and the write bandwidth of QC-2 is increased to 110 MB / s.
[0192] The last reported traffic of QC-1 was 110MB / s. Because the traffic increased to 210MB / s, it exceeded the corresponding local traffic threshold of 150MB / s this time, so it was limited. The reporting status this time was blocked, and the reported traffic was 150MB / s.
[0193] The last reported traffic of QC-2 was 90MB / s. Because the traffic increased to 110MB / s, it did not exceed the corresponding local traffic threshold of 135MB / s this time, so it was not limited. The current reporting status is non-blocking, and the reported traffic is 110MB / s.
[0194] After QC-3 is enabled, the last traffic was 0, and this time it is reported as 100MB / s, but it is not limited.
[0195] QS receives the reported information and calculates the total flow as 150+110+100=360MB / s, and the percentage is Ratio=360 / 300. The ratio is greater than 100%, and the corresponding local flow threshold of the non-blocking QC needs to be lowered, the blocking gateway is 1, the inactive gateway is 0, and the non-limited flow is 110+100=210MB / s. And return it to QC.
[0196] QC-1 updates the corresponding local traffic threshold and is limited, Ratio>100%, the corresponding local traffic threshold = (300-210) / 1 = 90MB / s;
[0197] QC-2 updates the corresponding local traffic threshold and is not limited, but Ratio>100%, the corresponding local traffic threshold = 135 / 360 / 300 = 112.5MB / s;
[0198] QC-3 updates the corresponding local traffic threshold and is not limited, but Ratio>100%, the corresponding local traffic threshold = 300 / 360 / 300 = 250MB / s, the third update process is as follows Fig.13 shown.
[0199] Then, the fourth update of the local traffic threshold is performed, and all QCs continue to maintain the existing traffic and continue the write operation:
[0200] The last reported traffic of QC-1 was 150MB / s. Because the traffic continued to be 210MB / s, which exceeded the corresponding local traffic threshold of 90MB / s, it was limited. The reporting status was blocked this time, and the reported traffic was 90MB / s.
[0201] The last reported traffic of QC-2 was 110MB / s. Because the traffic continued to be 110MB / s and did not exceed the corresponding local traffic threshold of 110MB / s, it was not limited. The reporting status this time was non-blocking, and the reported traffic was still 110MB / s.
[0202] After QC-3 is enabled, the last reported traffic is 100MB / s. Since the traffic has not changed and has not exceeded the corresponding local traffic threshold of 250MB / s, it is not limited. The current reporting status is non-blocking, and the current report is 100MB / s.
[0203] QS receives the reported information and calculates the total flow as 90+110+100=300MB / s, and the percentage is Ratio=300 / 300, which is equal to 100%. The corresponding local flow threshold of the non-blocking QC needs to be lowered, the blocking gateway is 1, the inactive gateway is 0, and the non-limited flow is 110+100=210MB / s. And returns it to QC.
[0204] QC-1 updates the corresponding local traffic threshold. At this time, QC-1 is limited, Ratio=100%, and the corresponding local traffic threshold=(300-210) / 1=90MB / s.
[0205] QC-2 updates the corresponding local flow threshold. At this time, QC-2 is not limited, but Ratio = 100%, and the local threshold
[0206] =112.5 / 300 / 300=112.5MB / s.
[0207] QC-3 updates the corresponding local traffic threshold. At this time, QC-3 is not limited, but Ratio=100%, and the corresponding local traffic threshold=250 / 300 / 300=250 MB / s.
[0208] It can be seen that after the fourth update, even if the traffic of the QC itself remains unchanged or changes repeatedly, the traffic reported by all QCs is 300MB / s and the bucket target threshold is 300MB / s. The process of the fourth update is as follows: Fig.14 shown.
[0209] In addition, the test description under abnormal conditions; if the gateway node corresponding to QC-2 has network abnormalities or node restarts, process restarts and other failures, the QC-2 reporting process will be abnormal, which may cause the QS message return timeout. QC-2 will continue to use the corresponding local traffic threshold of the current cycle. When the business traffic on QC-2 is stable, the traffic will not fluctuate repeatedly.
[0210] If the gateway node where the main QS is located has a network anomaly or the node is restarted, the traffic corresponding to QC-1 changes, and the state also changes. The QS on QC-2 becomes the main QS and restarts new statistics and calculations.
[0211] If a new gateway node is connected to the cluster during the business reading and writing process, the QC and QC quantity corresponding to the gateway node will also increase. The newly added QC needs to reallocate the corresponding local traffic threshold. For the already stable business traffic, there will be a brief fluctuation, but it will soon stabilize.
[0212] Therefore, this example provides a distributed object storage bucket QoS control method, which can effectively solve the service quality problem of multiple gateways and multiple storage buckets in distributed object storage, and help customers better manage services and allocate resources. When network resources are fixed, when the client sends read and write requests to a storage bucket in the cluster through one or more object gateways, it occupies a higher total service bandwidth, causing the services in the higher priority storage buckets connected by other gateways to increase latency due to insufficient bandwidth, affecting the execution of services. In order to complete the services of higher priority storage buckets better and faster, the QoS of other buckets can be limited or the QoS of the current bucket can be improved. The corresponding multiple gateways can automatically coordinate in a short time to allocate bandwidth or IOPS to high priority bucket services.
[0213] In addition, the device supports setting the read and write bandwidth and read and write IOPS of the bucket at the same time. The object gateway distinguishes and adjusts the corresponding traffic according to the bucket ID and other fields. In terms of reliability, when the object gateway processing the request is abnormal, the QoS of the bucket will not jitter for a long time due to the change of the gateway topology. After the gateway traffic is stable, the read and write request traffic received by the bucket also tends to be stable. The message notification mechanism better helps operation and maintenance personnel to timely understand the current allocation of customer network resources and business priorities, and assist customers in timely processing when encountering resource shortages.
[0214] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
[0215] Based on the same inventive concept, the embodiment of the present application also provides a service quality control device for implementing the service quality control method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in one or more service quality control device embodiments provided below can refer to the limitations of the service quality control method above, and will not be repeated here.
[0216] In an exemplary embodiment, Fig.15 As shown, a service quality control device is provided, comprising:
[0217] The acquisition module 1502 is used to acquire the traffic of the target client; the traffic of the target client is the data traffic under the original service quality;
[0218] The conversion module 1504 is used to obtain the traffic state of the target client and the traffic usage rate of the bucket based on the traffic of the target client; the traffic state indicates the numerical range of the traffic of the target client, the target client performs traffic management through the bucket, and the traffic usage rate of the bucket indicates the traffic usage of the traffic statistics of the client managed by the bucket relative to the target threshold;
[0219] Adjustment module 1506 is used to determine the local traffic threshold corresponding to the target client according to a threshold adjustment method adapted to the traffic state and the bucket traffic usage rate; the local traffic threshold corresponding to the target client is used to perform traffic control on the target client; the local traffic threshold represents the adjusted service quality of the target client.
[0220] In one embodiment, the conversion module 1504 is used to:
[0221] In the server of each storage bucket, the numerical values corresponding to the address identifiers of each server are compared to obtain an address identifier comparison result;
[0222] Determining a main server among the servers according to the comparison result of the address identifiers;
[0223] The traffic of the target client is sent to the main server; the main server is used to determine the traffic status of the target client and the traffic usage rate of the bucket based on the traffic of the target client.
[0224] In one embodiment, the conversion module 1504 is used to:
[0225] Compare the traffic of the target client within the period with the original local traffic threshold; if it is greater, determine that the traffic state of the target client is a blocking state; if it is less than, determine that the traffic state of the target client is a non-blocking state;
[0226] In the case where the traffic of the target client in the period is less than a preset threshold, determining that the traffic state of the target client is an inactive state; the preset threshold is less than the original local traffic threshold;
[0227] The traffic of the clients managed by the storage bucket in the same period is accumulated to obtain the traffic statistics value of the storage bucket; and the traffic usage rate of the storage bucket is determined based on the ratio of the traffic statistics value to the target threshold.
[0228] In one embodiment, the adjustment module 1506 is used to:
[0229] In the case where the traffic state is a blocking state, determining a traffic difference between the target threshold and a non-limited traffic of the storage bucket; the non-limited traffic is traffic that is managed through the storage bucket and does not belong to the client in the blocking state;
[0230] Allocating the traffic difference according to the number of clients in the blocking state managed by the storage bucket to obtain a local traffic threshold of the target client;
[0231] When the traffic state is a non-blocking state, the local traffic threshold of the target client is obtained according to a threshold adjustment method adapted to the bucket traffic usage rate.
[0232] In one embodiment, the adjustment module 1506 is used to:
[0233] When the traffic state is an inactive state, the target threshold is allocated according to the number of clients in the inactive state managed by the storage bucket to obtain a local traffic threshold of the target client.
[0234] In one embodiment, the adjustment module 1506 is used to:
[0235] If the traffic usage rate of the storage bucket is greater than the traffic usage rate threshold, lowering the original local traffic threshold of the target client according to the traffic usage rate of the storage bucket to obtain the local traffic threshold of the target client;
[0236] If the traffic usage rate of the storage bucket is less than the traffic usage rate threshold, the original local traffic threshold of the target client is increased according to the traffic usage rate of the storage bucket to obtain the local traffic threshold of the target client.
[0237] In one of the embodiments, when the local traffic threshold corresponding to the target client is increased, the traffic token of the target client increases the number of tokens at a preset interval until the number of traffic tokens of the target client matches the local traffic threshold.
[0238] In one of the embodiments, the target client includes a first target client and a second target client, and the priority of the first target client is higher than the priority of the second target client;
[0239] The local traffic threshold corresponding to the first target client is used to allocate the traffic token of the storage bucket as a first traffic token; the first traffic token is used to perform traffic control on the first target client;
[0240] The local traffic threshold corresponding to the second target client is used to allocate the unallocated traffic token as the second traffic token when there is an unallocated traffic token other than the first traffic token in the traffic token of the storage bucket; the second traffic token is used to perform traffic control on the second target client.
[0241] Each module in the above-mentioned service quality control device can be implemented in whole or in part by software, hardware or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute the operations corresponding to each module above.
[0242] In an exemplary embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as shown in FIG. Fig.16 As shown. The computer device includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. The processor, the memory and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a service quality control method is implemented.
[0243] Those skilled in the art will understand that Fig.16 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0244] In one embodiment, a computer device is further provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps in the above method embodiments when executing the computer program.
[0245] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.
[0246] In one embodiment, a computer program product is provided, including a computer program, which implements the steps in the above method embodiments when executed by a processor.
[0247] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant regulations.
[0248] Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, an artificial intelligence (AI) processor, etc., but are not limited to this.
[0249] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.
[0250] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. A method for controlling quality of service, characterized in that: The method comprises: Obtaining the traffic of the target client; the traffic of the target client is the data traffic under the original service quality; Based on the traffic of the target client, the traffic status of the target client and the traffic usage rate of the bucket are obtained; the traffic status indicates the numerical range of the traffic of the target client, the target client performs traffic management through the bucket, and the traffic usage rate of the bucket indicates the traffic usage of the traffic statistics of the client managed by the bucket relative to the target threshold; Determine a local traffic threshold corresponding to the target client according to a threshold adjustment method adapted to the traffic state and the bucket traffic usage rate; The local traffic threshold corresponding to the target client is used to perform traffic control on the target client; the local traffic threshold represents the adjusted service quality of the target client.
2. The method according to claim 1, characterized in that Before obtaining the traffic status of the target client and the traffic usage rate of the bucket based on the traffic of the target client, the method further includes: In the server of each storage bucket, the numerical values corresponding to the address identifiers of each server are compared to obtain an address identifier comparison result; Determining a main server among the servers according to the comparison result of the address identifiers; The acquiring, based on the traffic of the target client, the traffic status of the target client and the traffic usage rate of the storage bucket includes: The traffic of the target client is sent to the main server; the main server is used to determine the traffic status of the target client and the traffic usage rate of the bucket based on the traffic of the target client.
3. The method according to claim 1, characterized in that The acquiring, based on the traffic of the target client, the traffic status of the target client and the traffic usage rate of the storage bucket includes: Compare the traffic of the target client within the period with the original local traffic threshold; if it is greater, determine that the traffic state of the target client is a blocking state; if it is less than, determine that the traffic state of the target client is a non-blocking state; In the case where the traffic of the target client in the period is less than a preset threshold, determining that the traffic state of the target client is an inactive state; the preset threshold is less than the original local traffic threshold; The traffic of the clients managed by the storage bucket in the same period is accumulated to obtain the traffic statistics value of the storage bucket; and the traffic usage rate of the storage bucket is determined based on the ratio of the traffic statistics value to the target threshold.
4. The method according to claim 1, characterized in that: The determining, according to a threshold adjustment method adapted to the traffic state and the bucket traffic usage rate, a local traffic threshold corresponding to the target client includes: In the case where the traffic state is a blocking state, determining a traffic difference between the target threshold and a non-limited traffic of the storage bucket; the non-limited traffic is traffic that is managed through the storage bucket and does not belong to the client in the blocking state; Allocating the traffic difference according to the number of clients in the blocking state managed by the storage bucket to obtain a local traffic threshold of the target client; When the traffic state is a non-blocking state, the local traffic threshold of the target client is obtained according to a threshold adjustment method adapted to the bucket traffic usage rate.
5. The method according to claim 4, characterized in that The method further comprises: When the traffic state is an inactive state, the target threshold is allocated according to the number of clients in the inactive state managed by the storage bucket to obtain a local traffic threshold of the target client.
6. The method according to claim 4, characterized in that The obtaining of the local traffic threshold of the target client according to the threshold adjustment method adapted to the traffic usage rate of the storage bucket includes: If the traffic usage rate of the storage bucket is greater than the traffic usage rate threshold, lowering the original local traffic threshold of the target client according to the traffic usage rate of the storage bucket to obtain the local traffic threshold of the target client; If the traffic usage rate of the storage bucket is less than the traffic usage rate threshold, the original local traffic threshold of the target client is increased according to the traffic usage rate of the storage bucket to obtain the local traffic threshold of the target client.
7. The method according to claim 1, characterized in that In the case that the local traffic threshold corresponding to the target client is increased, the traffic token of the target client increases the number of tokens at a preset interval until the number of traffic tokens of the target client matches the local traffic threshold.
8. The method according to claim 1, characterized in that The target client includes a first target client and a second target client, and the priority of the first target client is higher than the priority of the second target client; The local traffic threshold corresponding to the first target client is used to allocate the traffic token of the storage bucket as a first traffic token; The first traffic token is used to perform traffic control on the first target client; The local traffic threshold corresponding to the second target client is used to allocate the unallocated traffic token as the second traffic token when there is an unallocated traffic token other than the first traffic token in the traffic token of the storage bucket; The second traffic token is used to perform traffic control on the second target client.
9. A service quality control device, characterized in that: The device comprises: An acquisition module, used to acquire the traffic of a target client; the traffic of the target client is the data traffic under the original service quality; A conversion module, for obtaining the traffic status of the target client and the traffic usage rate of the bucket based on the traffic of the target client; the traffic status indicates the numerical interval of the traffic of the target client, the target client performs traffic management through the bucket, and the traffic usage rate of the bucket indicates the traffic usage of the traffic statistics of the client managed by the bucket relative to the target threshold; An adjustment module is used to determine the local traffic threshold corresponding to the target client according to a threshold adjustment method adapted to the traffic state and the storage bucket traffic usage rate; the local traffic threshold corresponding to the target client is used to perform traffic control on the target client; the local traffic threshold represents the adjusted service quality of the target client.
10. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 8 are implemented.
Citation Information
Patent Citations
Flow control method and system, server and storage medium
CN110198275A
Flow limiting threshold setting method of service node and server equipment
CN111767142A
Flow control method, electronic device, storage medium and computer program product
CN118400321A
Flow control method and device, electronic equipment, storage medium and program product
CN118677842A
Flow control method and device, equipment, storage medium and program product
CN118827563A
Cited By
Token distribution method and device based on traffic prediction, equipment and storage medium
CN120835037A
Token allocation method and device based on traffic prediction, equipment and storage medium
CN120835037B