A fine-grained QoS control method for Rados Gateway

CN113709063BActive Publication Date: 2025-01-21SHANDONG LANGCHAO YUNTOU INFORMATION TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202110894080.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-08-05
Publication Date
2025-01-21
Estimated Expiration
2041-08-05

AI Technical Summary

Technical Problem

因此网络服务的QoS更加关注有限资源的合理利用,令牌桶是实现网络服务QoS的一种常见方法,但是对于Rados Gateway来说普通的令牌桶算法并不能满足需求,首先客户端层面的QoS粒度太大,不同用户和桶之间也存在资源竞争,同样需要进行QoS;其次用户和桶的数量十分庞大,为每一个用户和桶建立一个线程维护它的令牌是不实际的,即使硬件支持,在大量分布式锁和分布式变量同步的影响下Rados Gateway的效率也很难保障

Benefits of technology

[0035](1)本发明通过用户和桶两种细粒度的QoS,可以更合理的控制资源分配,无需单独开辟线程每秒向令牌桶中添加令牌,通过记录最早令牌时间的方式,将添加令牌的过程放在每次消耗和释放令牌之前的检测里,用少量的存储空间换取了计算时间和减少了cpu消耗,提高了QoS的效率;

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113709063B_ABST
    Figure CN113709063B_ABST
Patent Text Reader

Abstract

The invention discloses a fine-grained QoS control method for Rados Gateway, which relates to the technical field of network services, and includes: opening an API interface for setting QoS, querying QoS, and deleting QoS; through the API interface, an administrator sends a request to Rados Gateway, sets QoS for two granularities, namely, user level and bucket level, and records and persists the QoS status of the two granularities; after sending the request, detects the QoS of the two granularities in turn, and processes the request; after the request is processed, returns the number of tokens occupied by the request. The invention can more reasonably control resource allocation through two fine-grained QoS of user and bucket, without the need to open a separate thread to add tokens to the token bucket every second, and by recording the earliest token time, the process of adding tokens is placed in the detection before each consumption and release of tokens, a small amount of storage space is used in exchange for computing time and CPU consumption is reduced, thereby improving the efficiency of QoS.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to the technical field of network services, in particular to a fine-grained QoS control method for Rados Gateway. Background Art

[0002] QoS (Quality of Service) is the abbreviation of service quality. The QoS of network services includes many aspects, such as transmission bandwidth, latency, concurrency, and data packet loss rate. Common QoS solutions include setting firewall rules and routing policies. In network services, ensuring the service quality of certain services also damages the service quality of other services, because network resources are always limited. Therefore, the QoS of network services pays more attention to the rational use of limited resources. Token bucket is a common method to achieve QoS of network services, but for Rados Gateway, the ordinary token bucket algorithm cannot meet the needs. First, the QoS granularity at the client level is too large, and there is resource competition between different users and buckets, which also requires QoS; second, the number of users and buckets is very large, and it is not practical to establish a thread for each user and bucket to maintain its token. Even if the hardware supports it, the efficiency of Rados Gateway is difficult to guarantee under the influence of a large number of distributed locks and distributed variable synchronization. Summary of the invention

[0003] In view of the needs and shortcomings of current technology development, the present invention provides a fine-grained QoS control method for Rados Gateway.

[0004] A fine-grained QoS control method for Rados Gateway of the present invention solves the above technical problems by adopting the following technical solutions:

[0005] A fine-grained QoS control method for Rados Gateway includes the following steps:

[0006] Open the API interface for setting Qos, querying Qos, and deleting Qos;

[0007] Through the API interface, the administrator sends a request to Rados Gateway to set QoS at two granularities: user level and bucket level. At the same time, the QoS status of the two granularities is recorded and persisted.

[0008] After sending the request, the two granularity QoS are detected in turn to process the request;

[0009] After the request is processed, the number of tokens occupied by the request will be returned.

[0010] Optionally, the three API interfaces involved are all admin interfaces, which are called by the administrator user of the Ceph cluster;

[0011] All three API interfaces must specify the QoS sub-resources in the operation cluster in the URL, and the specific parameter values ​​involved in the operation are contained in the body represented in XML format.

[0012] Optionally, when setting QoS through the API interface, the body of the request needs to include the granularity of QoS, the name of the resource instance corresponding to the granularity, the category of the network resource to be restricted by QoS, and the maximum value of the corresponding network resource;

[0013] After the administrator sends a request to Rados Gateway, Rados Gateway parses the parameters in the body and records the name of the QoS resource instance, the category of the network resource, the maximum value of the network resource, the earliest token time, and the current number of tokens in the attrs attribute of the corresponding object of the metadata pool.

[0014] Further optionally, the granularity of the QoS involved includes user level and bucket level;

[0015] (a) If the QoS granularity is user-level, the name of the QoS resource instance, the category of the network resource, and the maximum value of the network resource are recorded in the attrs attribute of the user metadata object in the users.uid namespace in the metadata pool. At the same time, the current time is recorded as the earliest token time, the number of tokens is initialized to the maximum value of the corresponding network resource, and the above two token-related parameters are also persisted in the attrs attribute of the uid object;

[0016] (b) If the granularity of QoS is bucket level, the name of the QoS resource instance, the category of the network resource, and the maximum value of the network resource are recorded in the attrs attribute of the instance object under the root namespace in the metadata pool.

[0017] Optionally, when querying or deleting a QoS, the request body needs to specify the QoS granularity and the name of the resource instance;

[0018] When deleting QoS, the granularity of the QoS to be deleted is determined, and then the attrs attribute of the QoS of the object in the corresponding metadata pool is deleted.

[0019] Optionally, the QoS of the user level is detected and the request is processed. The specific process is as follows:

[0020] Perform user authority authentication;

[0021] After authentication, check the user's uid object;

[0022] If there is a QoS setting in attrs, first determine the difference between the current time and the earliest recorded token time. When the difference is greater than 1 second, update the current number of tokens to the maximum value of the corresponding network resources, and update the earliest token time to the current time. Then determine the difference between the current number of tokens and the number of tokens consumed by the current request:

[0023] (i) When the difference is non-negative, continue processing the request.

[0024] (ii) When the difference is negative, the current request is put back into the work queue of the Rados Gateway front end, waiting for the next processing by the worker thread.

[0025] Optionally, the bucket-level QoS is detected and the request is processed. The specific process is as follows:

[0026] Check whether there is QoS setting in the attrs attribute of the instance in the metadata pool corresponding to the bucket;

[0027] If it exists, first determine the difference between the current time and the earliest recorded token time. When the difference is greater than 1 second, update the current number of tokens to the maximum value of the corresponding network resource, and update the earliest token time to the current time. Then determine the difference between the current number of tokens and the number of tokens to be consumed by the current request:

[0028] (i) When the difference is non-negative, continue processing the request.

[0029] (ii) When the difference is a negative number, the current request is put back into the work queue of the Rados Gateway front end. Before putting it back into the work queue, the flag and status attributes corresponding to the request instance need to be restored to the state before the request was processed.

[0030] Optionally, after the request is processed, the number of tokens occupied by the request is returned. The specific process is as follows:

[0031] Read the current token status and determine the difference between the current time and the earliest recorded token time:

[0032] (i) When the difference is greater than 1 second, update the current number of tokens to the maximum value of the corresponding network resource, and update the earliest token time to the current time, and then directly return the result to the client that issued the request;

[0033] (ii) When the difference is no more than 1 second, add the current number of tokens to the number of tokens occupied by the request. If the sum is greater than the maximum value of the corresponding network resource, then the current number of tokens is used as the maximum value of the corresponding network resource, and the sum of the tokens is recorded in the current token state. Finally, the result is returned to the client that issued the request.

[0034] The fine-grained QoS control method of Rados Gateway of the present invention has the following beneficial effects compared with the prior art:

[0035] (1) The present invention can control resource allocation more reasonably through two fine-grained QoSs, user and bucket, without the need to create a separate thread to add tokens to the token bucket every second. By recording the earliest token time, the process of adding tokens is placed in the detection before each token consumption and release, using a small amount of storage space in exchange for computing time and reducing CPU consumption, thereby improving QoS efficiency.

[0036] (2) The present invention persists the token state in the metadata pool, avoiding the impact of distributed locks and distributed variable synchronization on the execution efficiency of Rados Gateway, and solving the problem that the token state of the system cannot be restored after the machine loses power;

[0037] (3) The present invention strictly separates and decouples the IO concurrency and bandwidth, and the restrictions on different network resources will not affect each other. BRIEF DESCRIPTION OF THE DRAWINGS

[0038] Attached Figure 1 is a flow chart of the method of the present invention;

[0039] Attached Figure 2 It is a schematic diagram of the process of sequentially detecting QoS of two granularities in the present invention. DETAILED DESCRIPTION

[0040] In order to make the technical solution, the technical problem solved and the technical effect of the present invention more clearly understood, the technical solution of the present invention is clearly and completely described below in conjunction with specific embodiments.

[0041] Embodiment 1:

[0042] Combined with Figure 1 This embodiment proposes a fine-grained QoS control method for Rados Gateway, including the following steps:

[0043] (1) Open the API interface for setting QoS, querying QoS, and deleting QoS.

[0044] In this embodiment, the three API interfaces are all admin interfaces for the administrator user of the ceph cluster to call.

[0045] All three API interfaces must specify the QoS sub-resources in the operation cluster in the URL, and the specific parameter values ​​involved in the operation are contained in the body represented in XML format.

[0046] When setting QoS through the API interface, the body of the request needs to include the granularity of QoS, the name of the resource instance corresponding to the granularity, the category of network resources to be restricted by QoS, and the maximum value of the corresponding network resources.

[0047] (2) Through the API interface, the administrator sends a request to Rados Gateway to set QoS at both the user level and the bucket level, and records and persists the QoS status of the two granularities.

[0048] After the administrator sends a request to Rados Gateway, Rados Gateway parses the parameters in the body and records the name of the QoS resource instance, the category of the network resource, the maximum value of the network resource, the earliest token time, and the current number of tokens in the attrs attribute of the corresponding object in the metadata pool.

[0049] In this embodiment, the granularity of QoS includes user level and bucket level;

[0050] (a) If the QoS granularity is user-level, the name of the QoS resource instance, the category of the network resource, and the maximum value of the network resource are recorded in the attrs attribute of the user metadata object in the users.uid namespace in the metadata pool. At the same time, the current time is recorded as the earliest token time, the number of tokens is initialized to the maximum value of the corresponding network resource, and the above two token-related parameters are also persisted in the attrs attribute of the uid object;

[0051] (b) If the granularity of QoS is bucket level, the name of the QoS resource instance, the category of the network resource, and the maximum value of the network resource are recorded in the attrs attribute of the instance object under the root namespace in the metadata pool.

[0052] When querying or deleting QoS, the QoS granularity and the name of the resource instance need to be specified in the request body.

[0053] When deleting QoS, the granularity of the QoS to be deleted is determined, and then the attrs attribute of the QoS of the object in the corresponding metadata pool is deleted.

[0054] (III) Combined with attachment Figure 2 ,After sending the request, the QoS of two granularities are detected in turn and the request is processed.

[0055] (1) Detect the user-level QoS and process the request. The specific process is as follows:

[0056] Perform user authority authentication;

[0057] After authentication, check the user's uid object;

[0058] If there is a QoS setting in attrs, first determine the difference between the current time and the earliest recorded token time. When the difference is greater than 1 second, update the current number of tokens to the maximum value of the corresponding network resources, and update the earliest token time to the current time. Then determine the difference between the current number of tokens and the number of tokens consumed by the current request:

[0059] (i) When the difference is non-negative, continue processing the request.

[0060] (ii) When the difference is negative, the current request is put back into the work queue of the Rados Gateway front end, waiting for the next processing by the worker thread.

[0061] (2) Detect bucket-level QoS and process the request. The specific process is as follows:

[0062] Check whether there is QoS setting in the attrs attribute of the instance in the metadata pool corresponding to the bucket;

[0063] If it exists, first determine the difference between the current time and the earliest recorded token time. When the difference is greater than 1 second, update the current number of tokens to the maximum value of the corresponding network resource, and update the earliest token time to the current time. Then determine the difference between the current number of tokens and the number of tokens to be consumed by the current request:

[0064] (i) When the difference is non-negative, continue processing the request.

[0065] (ii) When the difference is a negative number, the current request is put back into the work queue of the Rados Gateway front end. Before putting it back into the work queue, the flag and status attributes corresponding to the request instance need to be restored to the state before the request was processed.

[0066] (IV) After the request is processed, the number of tokens occupied by the request is returned. The specific process is as follows:

[0067] Read the current token status and determine the difference between the current time and the earliest recorded token time:

[0068] (i) When the difference is greater than 1 second, update the current number of tokens to the maximum value of the corresponding network resource, and update the earliest token time to the current time, and then directly return the result to the client that issued the request;

[0069] (ii) When the difference is no more than 1 second, add the current number of tokens to the number of tokens occupied by the request. If the sum is greater than the maximum value of the corresponding network resource, then the current number of tokens is used as the maximum value of the corresponding network resource, and the sum of the tokens is recorded in the current token state. Finally, the result is returned to the client that issued the request.

[0070] In summary, the fine-grained QoS control method of Rados Gateway of the present invention can more reasonably control resource allocation through two fine-grained QoS of users and buckets, without the need to open a separate thread to add tokens to the token bucket every second, thereby improving the efficiency of QoS.

[0071] The above specific examples are used to explain the principles and implementation methods of the present invention in detail. These examples are only used to help understand the core technical content of the present invention. Based on the above specific embodiments of the present invention, any improvements and modifications made by technicians in this technical field without departing from the principles of the present invention should fall within the scope of patent protection of the present invention.

Claims

1. A fine-grained QoS control method for Rados Gateway, characterized in that: The steps include: Open the API interface for setting Qos, querying Qos, and deleting Qos; Through the API interface, the administrator sends a request to Rados Gateway to set QoS at two granularities, user level and bucket level, and record and persist the QoS status of the two granularities. The body of the request needs to include the granularity of QoS, the name of the resource instance of the corresponding granularity, the category of the network resource to be restricted by QoS, and the maximum value of the corresponding network resource. When the granularity of QoS is user level, the name of the resource instance of QoS, the category of network resource and the maximum value of network resource are recorded in the attrs attribute of the user metadata object under the users.uid namespace in the metadata pool. At the same time, the current time is recorded as the earliest token time, the number of tokens is initialized to the maximum value of the corresponding network resource, and the above two token-related parameters are also persisted in the attrs attribute of the uid object. When the granularity of QoS is bucket level, the name of the resource instance of QoS, the category of network resource and the maximum value of network resource are recorded in the attrs attribute of the instance object under the root namespace in the metadata pool. After sending the request, the two granularity QoS are detected in turn and the request is processed. Specifically, (1) the user-level QoS is detected and the request is processed. The specific process is as follows: user authority authentication is performed; after authentication, the user's uid object is checked; if there is a QoS setting in attrs, the difference between the current time and the earliest token time recorded is first determined. When the difference is greater than 1 second, the current number of tokens is updated to the maximum value of the corresponding network resource, and the earliest token time is updated to the current time. Then, the difference between the current number of tokens and the number of tokens consumed by the current request is further determined: (i) when the difference is non-negative, the request processing process continues; (ii) when the difference is negative, the current request is put back into Rado. sGateway front-end work queue, waiting for the next work thread to take it out for processing; (2) Detect bucket-level QoS and process the request. The specific process is: check whether there is a QoS setting in the attrs attribute of the instance in the metadata pool corresponding to the bucket; if so, first determine the difference between the current time and the earliest recorded token time. When the difference is greater than 1 second, update the current number of tokens to the maximum value of the corresponding network resource, and update the earliest token time to the current time. Then further determine the difference between the current number of tokens and the number of tokens to be consumed by the current request: (i) When the difference is non-negative, continue the request processing process; (ii) When the difference is negative, put the current request back to the work queue of the Rados Gateway front end. Before putting it back to the work queue, the flag and status attributes corresponding to the request instance need to be restored to the state before the request is processed; After the request is processed, the number of tokens occupied by the request will be returned.

2. According to claim 1, a fine-grained QoS control method for Rados Gateway is characterized in that: The three API interfaces are all admin interfaces, which are called by the administrator users of the Ceph cluster; All three API interfaces must specify the QoS sub-resources in the operation cluster in the URL, and the specific parameter values ​​involved in the operation are contained in the body represented in XML format.

3. According to claim 2, a fine-grained QoS control method for Rados Gateway is characterized in that: When querying or deleting QoS, the QoS granularity and resource instance name must be specified in the request body. When deleting QoS, the granularity of the QoS to be deleted is determined, and then the attrs attribute of the QoS of the object in the corresponding metadata pool is deleted.

4. A fine-grained QoS control method for Rados Gateway according to claim 3, characterized in that: After the request is processed, the number of tokens occupied by the request is returned. The specific process is as follows: Read the current token status and determine the difference between the current time and the earliest recorded token time: (i) When the difference is greater than 1 second, update the current number of tokens to the maximum value of the corresponding network resources, and update the earliest token time to the current time, and then directly return the result to the client that issued the request; (ii) When the difference is no more than 1 second, add the current number of tokens to the number of tokens occupied by the request. If the sum is greater than the maximum value of the corresponding network resource, then the current number of tokens is used as the maximum value of the corresponding network resource, and the sum of the tokens is recorded in the current token state. Finally, the result is returned to the client that issued the request.

Citation Information

Patent Citations

  • QoS setting method for Ceph cloud storage system based on token bucket algorithm

    CN107579926A

  • Systems and / or methods for resource use limitation in a cloud environment

    US20160142323A1