CN107276827B - Method and device for realizing Qos in distributed storage system - Google Patents

Method and device for realizing Qos in distributed storage system Download PDF

Info

Publication number
CN107276827B
CN107276827B CN201710612235.XA CN201710612235A CN107276827B CN 107276827 B CN107276827 B CN 107276827B CN 201710612235 A CN201710612235 A CN 201710612235A CN 107276827 B CN107276827 B CN 107276827B
Authority
CN
China
Prior art keywords
token bucket
tokens
token
read
write operation
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201710612235.XA
Other languages
Chinese (zh)
Other versions
CN107276827A (en
Inventor
王利朋
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Zhengzhou Yunhai Information Technology Co Ltd
Original Assignee
Zhengzhou Yunhai Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Zhengzhou Yunhai Information Technology Co Ltd filed Critical Zhengzhou Yunhai Information Technology Co Ltd
Priority to CN201710612235.XA priority Critical patent/CN107276827B/en
Publication of CN107276827A publication Critical patent/CN107276827A/en
Application granted granted Critical
Publication of CN107276827B publication Critical patent/CN107276827B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/50Network service management, e.g. ensuring proper service fulfilment according to agreements
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/50Network service management, e.g. ensuring proper service fulfilment according to agreements
    • H04L41/5003Managing SLA; Interaction between SLA and QoS
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/50Network service management, e.g. ensuring proper service fulfilment according to agreements
    • H04L41/5041Network service management, e.g. ensuring proper service fulfilment according to agreements characterised by the time relationship between creation and deployment of a service
    • H04L41/5051Service on demand, e.g. definition and deployment of services in real time
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/10Flow control; Congestion control
    • H04L47/215Flow control; Congestion control using token-bucket
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/10Flow control; Congestion control
    • H04L47/24Traffic characterised by specific attributes, e.g. priority or QoS
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1097Protocols in which an application is distributed across nodes in the network for distributed storage of data in networks, e.g. transport arrangements for network file system [NFS], storage area networks [SAN] or network attached storage [NAS]

Abstract

The invention provides a method and a device for realizing Qos in a distributed storage system, wherein after a read-write operation instruction is received, tokens are respectively applied from a read-write operation token bucket and a bandwidth token bucket, the total number of the tokens stored in each token bucket is related to the service quality purchased by a user per se according to the actual requirement, the tokens can be applied from the token bucket only when the tokens exist in the token bucket, and the operation corresponding to the read-write operation instruction can be executed only when the tokens are applied from both the read-write operation token and the bandwidth token bucket. The number of tokens in the read-write operation token bucket is used for limiting the number of times of read-write operation (IOPS) per second, and the number of tokens in the bandwidth token bucket is used for limiting the bandwidth of the read-write operation. The requirement of IOPS and bandwidth can be met simultaneously.

Description

Method and device for realizing Qos in distributed storage system
Technical Field
The invention belongs to the technical field of distributed storage, and particularly relates to a method and a device for realizing Qos in a distributed storage system.
Background
With the rise of cloud computing, distributed storage is stepping into the cloud storage era. The cloud storage provides customizable and pay-as-needed services for users, and the users can purchase storage services corresponding to quality of service (QoS) according to actual demands of the users.
QoS guarantees are important for resource-limited distributed storage scenarios, especially for streaming multimedia application scenarios, which have high requirements on the number of read/write (I/O) operations per second (IOPS) and bandwidth.
The method for realizing the Qos in the distributed storage system in the prior art cannot meet the higher requirements of the IOPS and the bandwidth at the same time.
Therefore, providing a Qos implementation method capable of meeting the higher requirements of the IOPS and the bandwidth at the same time is a problem that needs to be solved urgently by those skilled in the art.
Disclosure of Invention
In view of this, the present invention aims to provide a method and an apparatus for implementing Qos in a distributed storage system, so as to solve the problem that the method for implementing Qos in a distributed storage system in the prior art cannot meet the higher requirements of the IOPS and the bandwidth at the same time.
The technical scheme is as follows:
the invention provides a method for realizing Qos in a distributed storage system, which comprises the following steps:
after receiving a read/write operation instruction, applying for a token from a token bucket; the token bucket comprises a read-write operation token bucket and a bandwidth token bucket;
judging whether tokens are applied from the read-write operation token bucket and the bandwidth token bucket;
and if the tokens are judged to be applied from the read-write operation token and the bandwidth token bucket, executing the operation corresponding to the read-write operation instruction.
Preferably, the applying for tokens from the token bucket includes:
judging whether tokens exist in the token bucket or not;
and if the token exists in the token bucket, obtaining the token from the token bucket, and removing the obtained token from the token bucket.
Preferably, after determining whether there is a token in the token bucket, the method further includes:
if the token does not exist in the token bucket, updating the token bucket;
and obtaining tokens from the updated token bucket.
Preferably, the updating the token bucket comprises:
acquiring the volume attribute of the storage block corresponding to the read-write operation instruction;
obtaining the speed of adding tokens to the token bucket from the volume attributes;
and updating the token bucket according to a preset rule according to the speed of adding the tokens in the token bucket.
Preferably, the preset rule is:
T(i+1)=T(i)+V*Interval
T(i+1)=(T(i+1)>MAX)?MAX:T(i+1)
wherein t (i) represents the number of tokens in the token bucket at the ith iteration, Interval represents the time difference between the ith iteration and the (i + 1) th iteration, and is expressed in seconds, MAX represents the maximum value of the number of tokens in the token bucket, MAX is α × V, V represents the speed of adding tokens in the token bucket, and is expressed in units of number of tokens per second, and α is any natural number greater than 1.
The invention also provides a device for realizing Qos in the distributed storage system, which comprises:
the acquisition unit is used for applying for tokens from the token bucket after receiving the read/write operation instruction; the token bucket comprises a read-write operation token bucket and a bandwidth token bucket;
the judging unit is used for judging whether tokens are applied from the read-write operation token bucket and the bandwidth token bucket or not;
and the execution unit is used for executing the operation corresponding to the read-write operation instruction when the judgment unit judges that the tokens are applied from the read-write operation token and the bandwidth token bucket.
Preferably, the acquiring unit specifically includes:
judging whether tokens exist in the token bucket or not;
and if the token exists in the token bucket, obtaining the token from the token bucket, and removing the obtained token from the token bucket.
Preferably, the method further comprises the following steps:
the updating unit is used for updating the token bucket when the token does not exist in the token bucket;
the obtaining unit is further configured to obtain tokens from the updated token bucket.
Preferably, the updating unit specifically includes:
acquiring the volume attribute of the storage block corresponding to the read-write operation instruction;
obtaining the speed of adding tokens to the token bucket from the volume attributes;
and updating the token bucket according to a preset rule according to the speed of adding the tokens in the token bucket.
Preferably, the preset rule is:
T(i+1)=T(i)+V*Interval
T(i+1)=(T(i+1)>MAX)?MAX:T(i+1)
wherein t (i) represents the number of tokens in the token bucket at the ith iteration, Interval represents the time difference between the ith iteration and the (i + 1) th iteration, and is expressed in seconds, MAX represents the maximum value of the number of tokens in the token bucket, MAX is α × V, V represents the speed of adding tokens in the token bucket, and is expressed in units of number of tokens per second, and α is any natural number greater than 1.
Compared with the prior art, the technical scheme provided by the invention has the following advantages:
according to the technical scheme, after the read-write operation instruction is received, tokens are respectively applied from the read-write operation token bucket and the bandwidth token bucket, the total number of the tokens stored in each token bucket is related to the service quality purchased by the user according to the actual requirement, the tokens can be applied from the token bucket only when the tokens exist in the token bucket, and the operation corresponding to the read-write operation instruction can be executed only when the tokens are applied from the read-write operation token bucket and the bandwidth token bucket. The number of tokens in the read-write operation token bucket is used for limiting the number of times of read-write operation (IOPS) per second, and the number of tokens in the bandwidth token bucket is used for limiting the bandwidth of the read-write operation. The requirement of IOPS and bandwidth can be met simultaneously.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to these drawings without creative efforts.
Fig. 1 is a flowchart of a QOS implementation method in a distributed storage system according to an embodiment of the present invention;
fig. 2 is a flowchart of a QOS implementation method in another distributed storage system according to an embodiment of the present invention;
fig. 3 is a schematic structural diagram of a QOS implementation apparatus in a distributed storage system according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The invention discloses a QOS realization method in a distributed storage system, referring to fig. 1, the embodiment comprises the following steps:
s101, after receiving a read/write operation instruction, applying for a token from a token bucket; the token bucket comprises a read-write operation token bucket and a bandwidth token bucket;
the core principle is that the flow rate entering a port of a storage network is monitored, the exceeding part of the flow is punished, and the flow of each client is allocated, so that the flow is controlled within a set range.
In the token bucket algorithm, a token is a flag in a distributed storage system that controls whether read and write operations are performed. The token bucket is a pool of storage tokens, and the number of tokens stored in the token bucket has a maximum value. Wherein the maximum value is related to the quality of service actually required to be purchased by the user himself, and therefore the number of tokens stored in the token bucket provided to different users differs.
The token bucket in this embodiment includes two types of token buckets, a read-write operation token bucket and a bandwidth token bucket, where the read-write operation token bucket is used to limit the number of times (IOPS) of read-write operations per second, and the bandwidth token bucket is used to limit the bandwidth of the read-write operations. And the token bucket only limits the IOPS and the upper limit value of the bandwidth, but not limits the lower limit value, and the lower limit value defaults to 0.
For read/write operations, the read operation and the write operation can respectively limit respective IOPS upper limit values, namely the read operation corresponds to one read-write operation token bucket, the write operation corresponds to one read-write operation token bucket, and the number of tokens stored in the two read-write operation token buckets is different; the read operation and the write operation can respectively limit respective bandwidths, at the moment, the read operation corresponds to one bandwidth token bucket, and the write operation corresponds to one bandwidth token bucket; read and write operations can also limit read and write mixed bandwidth, and at the moment, the read/write operations correspond to a bandwidth token bucket together.
When a read operation or a write operation is performed, a token is applied from a token bucket. Applying for tokens from the token bucket only if the current token number in the token bucket is not 0, namely the tokens exist in the token bucket; if the current token bucket is empty, tokens cannot be applied from the token bucket.
In this embodiment, in order to implement the limitation on the IOPS and the bandwidth, a read-write operation token bucket and a bandwidth token bucket are respectively set, and after receiving a read/write operation instruction, tokens need to be applied from the read-write operation token bucket and the bandwidth token bucket, respectively. The sequence of applying for the tokens is to apply for the tokens from the read-write operation token bucket first and then apply for the tokens from the bandwidth token bucket.
A read/write operation instruction corresponding to one read/write operation needs to obtain a token from a read/write operation token bucket; the number of corresponding data to be read or written is different for one read/write operation instruction, and each bit of the data needs to obtain one token from the bandwidth token bucket, so the number of tokens required to be obtained from the bandwidth token bucket for one read/write operation instruction is not fixed, but is related according to the number of bits of the read/write data.
S102, judging whether tokens are applied from the read-write operation token bucket and the bandwidth token bucket or not;
judging whether the token is applied from the read-write operation token and the bandwidth token bucket, and executing a step S103;
after applying for tokens from a read-write operation token bucket and a bandwidth token bucket respectively, judging whether tokens are applied from the read-write operation token bucket and the bandwidth token bucket or not;
the method comprises the steps of obtaining a bandwidth token bucket according to a read/write operation instruction, and obtaining a token number from the bandwidth token bucket according to the read/write operation instruction. And the read-write operation can be completed only by obtaining tokens with the same number as the read-write data bits from the bandwidth token bucket.
And S103, executing the operation corresponding to the read-write operation instruction.
And applying for a token allowing the read-write operation from the read-write operation token bucket, and after applying for a token allowing the read-write operation command to the data to be read and written from the bandwidth token bucket, executing the read-write operation corresponding to the read-write operation command.
As long as the required number of tokens is not applied from any one of the two token buckets, the read-write operation will be blocked or a corresponding error message will be returned.
According to the technical scheme, after the read-write operation instruction is received, tokens are respectively applied from the read-write operation token bucket and the bandwidth token bucket, the total number of the tokens stored in each token bucket is related to the service quality purchased by the user according to the actual requirement, the tokens can be applied from the token bucket only when the tokens exist in the token bucket, and the operation corresponding to the read-write operation instruction can be executed only when the tokens are applied from the read-write operation token bucket and the bandwidth token bucket. The number of tokens in the read-write operation token bucket is used for limiting the number of times of read-write operation (IOPS) per second, and the number of tokens in the bandwidth token bucket is used for limiting the bandwidth of the read-write operation. The requirement of IOPS and bandwidth can be met simultaneously.
The invention discloses another method for realizing Qos in a distributed storage system, which comprises the following steps of:
s201, after receiving a read/write operation instruction, judging whether a token exists in the token bucket;
if the token bucket is judged to have the token, executing the step S202;
if no token exists in the token bucket, executing step S205;
s202, acquiring volume attributes of the storage blocks corresponding to the read-write operation instructions;
the number of tokens stored in the token bucket may be incremented at a rate over time. I.e. adding tokens to the token bucket at a certain rate. Wherein the speed of adding tokens to the token bucket is determined by the quality of service that the user actually needs to purchase. In practical application, the speed of adding tokens to the read-write operation token bucket is set as the upper limit value of the IOPS, and the speed of adding tokens to the bandwidth token bucket is set as the upper limit value of the bandwidth.
The application scenario in this embodiment is distributed block storage. The speed of adding tokens to the token bucket is stored in the back-end storage cluster, and data loss is avoided.
When the storage data block is established, the speed value of the token added to the token bucket is read from the configuration file of the distributed storage cluster, and the read speed value is set in the volume attribute of the storage data block.
If the speed value of the added token to the token bucket cannot be read from the configuration file of the distributed storage cluster, a default speed value is set in the volume attribute of the storage data block.
When a storage data block is deleted, the volume attribute data of the storage data block is deleted together without performing an additional operation.
The value of the speed of adding tokens to the token bucket stored in the back-end storage cluster may be modified in the configuration file when the quality of service purchased by the user changes. Of course, after the storage data block is established, the volume attribute of the storage data block may be modified through a corresponding command without restarting the cluster, and the token bucket may be updated according to the speed value of the token added to the token bucket in the modified volume attribute.
S203, acquiring the speed of adding tokens into the token bucket from the volume attribute;
s204, updating the token bucket according to a preset rule according to the speed of adding tokens in the token bucket;
the preset rule is as follows:
T(i+1)=T(i)+V*Interval
T(i+1)=(T(i+1)>MAX)?MAX:T(i+1)
wherein t (i) represents the total number of tokens in the token bucket at the ith iteration, Interval represents the time difference between the ith iteration and the (i + 1) th iteration, and is expressed in seconds, MAX represents the maximum value of the total number of tokens in the token bucket, MAX is α × V, V represents the speed of adding tokens in the token bucket, and is expressed in units of number of tokens per second, and α is any natural number greater than 1.
V is the upper limit value of the IOPS and the upper limit value of the bandwidth acquired from the volume attribute. The Interval represents a time difference between the ith iteration and the (i + 1) th iteration, namely a time Interval for updating the token bucket, and can be reasonably set according to actual needs. In this embodiment, Interval is 1 s.
Since a certain storage data block is not accessed for a long time in a specific scenario, a large number of read/write data operation instructions, i.e. IO burst flooding, are generated at the same time when the data block is just accessed. Therefore, in order to handle the IO burst flood, it is necessary to ensure that each read-write data operation instruction can obtain tokens from the read-write operation token bucket and the bandwidth token bucket, respectively. Based on this, if the total number of tokens stored in the read-write operation token bucket is the upper limit value of the IOPS and the total number of tokens stored in the bandwidth token bucket is the upper limit value of the bandwidth, part of the read-write data operation instructions in the IO burst flood cannot acquire the tokens, and thus the IO burst flood cannot be processed in time. In contrast, the maximum value MAX of the total number of tokens in the token bucket is α × V, where α is an arbitrary natural number greater than 1, that is, the total number of tokens that can be stored in the token bucket is greater than V and greater than the upper limit value of the IOPS and the upper limit value of the bandwidth.
And because the token bucket completes one update at regular intervals, and the total number of tokens that can be stored in the token bucket is fixed, the number of tokens that should be stored in the token bucket obtained by calculation may be greater than the total number of tokens that can be stored in the token bucket itself after the token bucket is updated according to the speed of adding tokens to the token bucket. In contrast, when the number of tokens to be stored in the token bucket obtained by calculation is greater than the total number of tokens that can be stored in the token bucket, the number of tokens stored in the token bucket is set to be the total number of tokens that can be stored in the token bucket.
In this embodiment, although the step of updating the token bucket follows the step of determining that the total number of tokens in the token bucket is 0, in practice, it is not necessary to determine what the total number of tokens currently stored in the token bucket is each time the token bucket is updated. Whether the token in the current token bucket is always 0 or not 0, the token bucket is updated only at regular intervals.
S205, obtaining tokens from the token bucket, and removing the obtained tokens from the token bucket;
the operation of obtaining tokens from the token bucket and the operation of updating the token bucket are processed in parallel, and the two operations do not affect each other.
And aiming at one read/write operation instruction, the number of tokens in the token buckets of different types is reduced after the tokens are obtained from the token buckets. For the read-write operation token bucket, one read/write operation instruction corresponds to one read/write operation, and only one token is obtained in each read/write operation, so that the number of tokens in the read-write operation token bucket is reduced by 1 per time; for the bandwidth token bucket, the number of bits of data to be read or written is different for one read/write operation instruction, and each bit of the data needs to obtain one token from the bandwidth token bucket, so the number of tokens required to be obtained from the bandwidth token bucket by one read/write operation instruction is not fixed but related according to the number of bits of read/write data, and therefore the number of tokens reduced each time in the bandwidth token bucket is the same as the number of bits of read/write data.
S206, judging whether tokens are applied from the read-write operation token bucket and the bandwidth token bucket;
if the read-write operation token and the bandwidth token bucket both apply for tokens, step S207 is executed;
and S207, executing the operation corresponding to the read-write operation instruction.
The implementation manners of steps S206 to S207 in this embodiment are similar to the implementation manners of steps S102 to S103 in the previous embodiment, and are not described herein again.
According to the technical scheme, the upper limit value of the IOPS and the upper limit value of the bandwidth are stored in the distributed storage cluster, data can be guaranteed not to be lost, the upper limit value of the IOPS and the upper limit value of the bandwidth are used as volume attributes of the storage data blocks, after the storage data blocks are established, when user requirements change, namely the upper limit value of the IOPS and the upper limit value of the bandwidth change, the volume attributes can be directly modified through corresponding commands, and the token bucket can be updated according to the upper limit value of the IOPS and the upper limit value of the bandwidth in the modified volume attributes without restarting the cluster. The user experience is improved.
Corresponding to the QOS implementation method in the distributed storage system, the present invention further provides a QOS implementation apparatus in the distributed storage system, where a schematic structural diagram of the QOS implementation apparatus is shown in fig. 3, and the QOS implementation apparatus in this embodiment includes:
an acquisition unit 301, a judgment unit 302, an execution unit 303, and an update unit 304;
an obtaining unit 301, configured to apply for a token from a token bucket after receiving a read/write operation instruction; the token bucket comprises a read-write operation token bucket and a bandwidth token bucket;
the obtaining unit 301 specifically includes:
judging whether tokens exist in the token bucket or not;
and if the token exists in the token bucket, obtaining the token from the token bucket, and removing the obtained token from the token bucket.
A determining unit 302, configured to determine whether a token is applied to both the read-write operation token bucket and the bandwidth token bucket;
an executing unit 303, configured to execute an operation corresponding to the read-write operation instruction when the determining unit determines that the token is applied from both the read-write operation token and the bandwidth token bucket;
an updating unit 304, configured to update the token bucket when it is determined that no token exists in the token bucket;
the updating unit 304 specifically includes:
acquiring the volume attribute of the storage block corresponding to the read-write operation instruction;
obtaining the speed of adding tokens to the token bucket from the volume attributes;
and updating the token bucket according to a preset rule according to the speed of adding the tokens in the token bucket.
Wherein, the preset rule is as follows:
T(i+1)=T(i)+V*Interval
T(i+1)=(T(i+1)>MAX)?MAX:T(i+1)
wherein t (i) represents the number of tokens in the token bucket at the ith iteration, Interval represents the time difference between the ith iteration and the (i + 1) th iteration, and is expressed in seconds, MAX represents the maximum value of the number of tokens in the token bucket, MAX is α × V, V represents the speed of adding tokens in the token bucket, and is expressed in units of number of tokens per second, and α is any natural number greater than 1.
The obtaining unit 301 is further configured to obtain tokens from the updated token bucket.
According to the technical scheme, after the read-write operation instruction is received, tokens are respectively applied from the read-write operation token bucket and the bandwidth token bucket, the total number of the tokens stored in each token bucket is related to the service quality purchased by the user per se, the tokens can be applied from the token bucket only when the tokens exist in the token bucket, and the operation corresponding to the read-write operation instruction can be executed only when the tokens are applied from the read-write operation token bucket and the bandwidth token bucket. The number of tokens in the read-write operation token bucket is used for limiting the number of times of read-write operation (IOPS) per second, and the number of tokens in the bandwidth token bucket is used for limiting the bandwidth of the read-write operation. The requirement of IOPS and bandwidth can be met simultaneously. Meanwhile, the upper limit value of the IOPS and the upper limit value of the bandwidth are stored in the distributed storage cluster, so that data can be guaranteed not to be lost, the upper limit value of the IOPS and the upper limit value of the bandwidth are used as volume attributes of the storage data blocks, and after the storage data blocks are established, when user requirements change, namely the upper limit value of the IOPS and the upper limit value of the bandwidth change, the volume attributes can be directly modified through corresponding commands, and the token bucket can be updated according to the upper limit value of the IOPS and the upper limit value of the bandwidth in the modified volume attributes without restarting the cluster. The user experience is improved.
The embodiments in the present description are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments are referred to each other. For the device provided by the embodiment, the description is relatively simple because the device corresponds to the method provided by the embodiment, and the relevant points can be referred to the method part for description.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
The previous description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the present invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the invention. Thus, the present invention is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
The foregoing is only a preferred embodiment of the present invention, and it should be noted that, for those skilled in the art, various modifications and decorations can be made without departing from the principle of the present invention, and these modifications and decorations should also be regarded as the protection scope of the present invention.

Claims (8)

1. A method for implementing QoS in a distributed storage system is characterized by comprising the following steps:
after receiving a read/write operation instruction, applying for a token from a token bucket; the token bucket comprises a read-write operation token bucket and a bandwidth token bucket;
judging whether tokens are applied from the read-write operation token bucket and the bandwidth token bucket;
judging whether tokens are applied from the read-write operation token and the bandwidth token bucket, and executing operation corresponding to the read-write operation instruction;
further comprising: updating the token bucket;
the updating the token bucket comprises:
acquiring the volume attribute of the storage block corresponding to the read-write operation instruction; the upper limit value of the read-write operation times and the upper limit value of the bandwidth per second are used as the volume attributes of the storage block; obtaining the speed of adding tokens to the token bucket from the volume attributes; storing the speed of adding the token in a back-end storage cluster, reading the speed of adding the token from a configuration file of a distributed storage cluster when a storage data block is established, and setting the read speed value in the volume attribute of the storage data block;
updating the token bucket according to a preset rule according to the speed of adding tokens in the token bucket; the total number of the tokens capable of being stored in the token bucket is larger than the number of the tokens added in a time interval according to the speed of adding the tokens in the token bucket.
2. The method of claim 1, wherein applying for tokens from a token bucket comprises:
judging whether tokens exist in the token bucket or not;
and if the token exists in the token bucket, obtaining the token from the token bucket, and removing the obtained token from the token bucket.
3. The method of claim 2, wherein after determining whether the token exists in the token bucket, the method further comprises:
if the token does not exist in the token bucket, updating the token bucket;
and obtaining tokens from the updated token bucket.
4. The implementation method of claim 1, wherein the preset rule is:
T(i+1)=T(i)+V*Interval
T(i+1)=(T(i+1)>MAX)?MAX:T(i+1)
wherein t (i) represents the number of tokens in the token bucket at the ith iteration, Interval represents the time difference between the ith iteration and the (i + 1) th iteration, and is expressed in seconds, MAX represents the maximum value of the number of tokens in the token bucket, MAX is α × V, V represents the speed of adding tokens in the token bucket, and is expressed in units of number of tokens per second, and α is any natural number greater than 1.
5. An apparatus for implementing Qos in a distributed storage system, comprising:
the acquisition unit is used for applying for tokens from the token bucket after receiving the read/write operation instruction; the token bucket comprises a read-write operation token bucket and a bandwidth token bucket;
the judging unit is used for judging whether tokens are applied from the read-write operation token bucket and the bandwidth token bucket or not;
the execution unit is used for executing the operation corresponding to the read-write operation instruction when the judgment unit judges that the tokens are applied from the read-write operation token and the bandwidth token bucket;
still include the update unit, the update unit specifically includes:
acquiring the volume attribute of the storage block corresponding to the read-write operation instruction; the upper limit value of the read-write operation times and the upper limit value of the bandwidth per second are used as the volume attributes of the storage block;
obtaining the speed of adding tokens to the token bucket from the volume attributes; storing the speed of adding the token in a back-end storage cluster, reading the speed of adding the token from a configuration file of a distributed storage cluster when a storage data block is established, and setting the read speed value in the volume attribute of the storage data block;
updating the token bucket according to a preset rule according to the speed of adding tokens in the token bucket; the total number of the tokens capable of being stored in the token bucket is larger than the number of the tokens added in a time interval according to the speed of adding the tokens in the token bucket.
6. The implementation device of claim 5, wherein the obtaining unit specifically comprises:
judging whether tokens exist in the token bucket or not;
and if the token exists in the token bucket, obtaining the token from the token bucket, and removing the obtained token from the token bucket.
7. The apparatus of claim 6, further comprising:
the updating unit is used for updating the token bucket when the token does not exist in the token bucket;
the obtaining unit is further configured to obtain tokens from the updated token bucket.
8. The implementation device of claim 5, wherein the preset rule is:
T(i+1)=T(i)+V*Interval
T(i+1)=(T(i+1)>MAX)?MAX:T(i+1)
wherein t (i) represents the number of tokens in the token bucket at the ith iteration, Interval represents the time difference between the ith iteration and the (i + 1) th iteration, and is expressed in seconds, MAX represents the maximum value of the number of tokens in the token bucket, MAX is α × V, V represents the speed of adding tokens in the token bucket, and is expressed in units of number of tokens per second, and α is any natural number greater than 1.
CN201710612235.XA 2017-07-25 2017-07-25 Method and device for realizing Qos in distributed storage system Active CN107276827B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710612235.XA CN107276827B (en) 2017-07-25 2017-07-25 Method and device for realizing Qos in distributed storage system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710612235.XA CN107276827B (en) 2017-07-25 2017-07-25 Method and device for realizing Qos in distributed storage system

Publications (2)

Publication Number Publication Date
CN107276827A CN107276827A (en) 2017-10-20
CN107276827B true CN107276827B (en) 2021-04-23

Family

ID=60078517

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710612235.XA Active CN107276827B (en) 2017-07-25 2017-07-25 Method and device for realizing Qos in distributed storage system

Country Status (1)

Country Link
CN (1) CN107276827B (en)

Families Citing this family (16)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107959635B (en) * 2017-11-23 2021-04-30 郑州云海信息技术有限公司 IOPS control method and device based on token bucket algorithm
CN107948090B (en) * 2017-11-23 2021-04-30 郑州云海信息技术有限公司 Bandwidth control method and device for Ceph storage cluster volume
CN108196954A (en) * 2017-12-28 2018-06-22 杭州时趣信息技术有限公司 A kind of file read/write method, system, equipment and computer storage media
CN110018781B (en) * 2018-01-09 2022-06-21 阿里巴巴集团控股有限公司 Disk flow control method and device and electronic equipment
CN108647082A (en) * 2018-04-13 2018-10-12 中国民航信息网络股份有限公司 Task processing method, device, equipment based on token mechanism and medium
CN110515535B (en) * 2018-05-22 2021-01-01 杭州海康威视数字技术股份有限公司 Hard disk read-write control method and device, electronic equipment and storage medium
CN108804043A (en) * 2018-06-26 2018-11-13 郑州云海信息技术有限公司 Distributed block storage system bandwidth traffic control method, device, equipment and medium
WO2020062297A1 (en) * 2018-09-30 2020-04-02 深圳市大疆创新科技有限公司 Token management method and apparatus, chip, and mobile platform
CN111290701B (en) * 2018-12-10 2022-06-24 杭州朗和科技有限公司 Data read-write control method, device, medium and electronic equipment
CN110011855B (en) * 2019-04-12 2023-01-10 苏州浪潮智能科技有限公司 Distributed cluster volume QoS (quality of service) adjusting method, device, equipment and storage medium
CN111901249B (en) * 2020-07-31 2024-03-22 深圳前海微众银行股份有限公司 Service flow limiting method, device, equipment and storage medium
CN112671666B (en) * 2020-11-16 2022-05-27 新华三大数据技术有限公司 IO processing method and device
CN113031872A (en) * 2021-03-26 2021-06-25 山东英信计算机技术有限公司 Data writing method of storage system and related device
CN113645150B (en) * 2021-06-11 2023-06-27 天翼云科技有限公司 Transmission rate control method, apparatus, electronic device, and readable storage medium
CN115378879A (en) * 2022-08-22 2022-11-22 Oppo广东移动通信有限公司 Data control method and related device
CN115543761B (en) * 2022-11-28 2023-04-14 苏州浪潮智能科技有限公司 Method and device for supporting IOPS burst, electronic equipment and readable storage medium

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101005453A (en) * 2006-12-26 2007-07-25 华为技术有限公司 Method and device for refreshing token bucket in flow limiting technology
WO2010051275A1 (en) * 2008-10-31 2010-05-06 Verizon Patent And Licensing Inc. System and method for measuring interface utilization using policers
CN104111800A (en) * 2013-04-18 2014-10-22 阿里巴巴集团控股有限公司 Virtual disk IO port scheduling method and scheduling device
CN105653631A (en) * 2015-12-25 2016-06-08 北京奇虎科技有限公司 Database management method and apparatus
CN105939286A (en) * 2016-03-28 2016-09-14 杭州迪普科技有限公司 Token bucket management method and device
CN106462601A (en) * 2014-03-31 2017-02-22 亚马逊科技公司 Atomic writes for multiple-extent operations

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101159675B (en) * 2007-11-06 2010-06-02 中兴通讯股份有限公司 Method of implementing improvement of user service quality in IP multimedia subsystem
CN101820380B (en) * 2009-02-26 2012-09-12 高通创锐讯通讯科技(上海)有限公司 Token updating method of meter
US10078533B2 (en) * 2014-03-14 2018-09-18 Amazon Technologies, Inc. Coordinated admission control for network-accessible block storage
CN103929366B (en) * 2014-04-02 2017-07-07 华为技术有限公司 Flow control methods, device and equipment

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101005453A (en) * 2006-12-26 2007-07-25 华为技术有限公司 Method and device for refreshing token bucket in flow limiting technology
WO2010051275A1 (en) * 2008-10-31 2010-05-06 Verizon Patent And Licensing Inc. System and method for measuring interface utilization using policers
CN104111800A (en) * 2013-04-18 2014-10-22 阿里巴巴集团控股有限公司 Virtual disk IO port scheduling method and scheduling device
CN106462601A (en) * 2014-03-31 2017-02-22 亚马逊科技公司 Atomic writes for multiple-extent operations
CN105653631A (en) * 2015-12-25 2016-06-08 北京奇虎科技有限公司 Database management method and apparatus
CN105939286A (en) * 2016-03-28 2016-09-14 杭州迪普科技有限公司 Token bucket management method and device

Also Published As

Publication number Publication date
CN107276827A (en) 2017-10-20

Similar Documents

Publication Publication Date Title
CN107276827B (en) Method and device for realizing Qos in distributed storage system
US10572285B2 (en) Method and apparatus for elastically scaling virtual machine cluster
US8239564B2 (en) Dynamic throttling based on network conditions
US20200154265A1 (en) Sim card status determination method and sim card status determination device
CN110413396B (en) Resource scheduling method, device and equipment and readable storage medium
CN106464733B (en) The method and device of virtual resource in a kind of adjustment cloud computing
CN108696911B (en) Method and device for selecting data transmission mode of Internet of things
CN103888377A (en) Message cache method and device
CN107483401B (en) Multimedia data transmission method and equipment, storage medium and server thereof
CN110781145B (en) File system task scheduling method, device, equipment and readable storage medium
CN111399977A (en) Virtual machine migration method, device, equipment and medium
CN111142788A (en) Data migration method and device and computer readable storage medium
CN111694517A (en) Distributed data migration method and system and electronic equipment
CN108874324B (en) Access request processing method, device, equipment and readable storage medium
CN109471843A (en) A kind of metadata cache method, system and relevant apparatus
CN109308537A (en) Website recommendation method and device
CN113238861A (en) Task execution method and device
CN105224541B (en) Uniqueness control method, information storage means and the device of data
CN111510761B (en) First frame equalization current limiting method and device, computer equipment and readable storage medium
CN111176570B (en) Thick backup roll creating method, device, equipment and medium
CN103096133A (en) Obtaining method and device of data
CN112148202B (en) Training sample reading method and device
CN104850431A (en) Stabilizing treatment method and device based on FOTA (Firmware Over-The-Air) upgrading
CN113703678B (en) Method, device, equipment and medium for re-splitting storage bucket index
CN115185456A (en) Cluster capacity shrinkage risk prompting method, device, equipment and medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant