CN113467720B - Load balancing method and device, readable storage medium and electronic equipment - Google Patents

Load balancing method and device, readable storage medium and electronic equipment Download PDF

Info

Publication number
CN113467720B
CN113467720B CN202110733246.XA CN202110733246A CN113467720B CN 113467720 B CN113467720 B CN 113467720B CN 202110733246 A CN202110733246 A CN 202110733246A CN 113467720 B CN113467720 B CN 113467720B
Authority
CN
China
Prior art keywords
token
write bandwidth
host
available block
preset
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
CN202110733246.XA
Other languages
Chinese (zh)
Other versions
CN113467720A (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.)
Chengdu Baiwei Storage Technology Co ltd
Original Assignee
Chengdu Baiwei Storage 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 Chengdu Baiwei Storage Technology Co ltd filed Critical Chengdu Baiwei Storage Technology Co ltd
Priority to CN202110733246.XA priority Critical patent/CN113467720B/en
Publication of CN113467720A publication Critical patent/CN113467720A/en
Application granted granted Critical
Publication of CN113467720B publication Critical patent/CN113467720B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0602Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
    • G06F3/0604Improving or facilitating administration, e.g. storage management
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • G06F12/0223User address space allocation, e.g. contiguous or non contiguous base addressing
    • G06F12/023Free address space management
    • G06F12/0253Garbage collection, i.e. reclamation of unreferenced memory
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0629Configuration or reconfiguration of storage systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0655Vertical data movement, i.e. input-output transfer; data movement between one or more hosts and one or more storage devices
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0668Interfaces specially adapted for storage systems adopting a particular infrastructure
    • G06F3/067Distributed or networked storage systems, e.g. storage area networks [SAN], network attached storage [NAS]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5083Techniques for rebalancing the load in a distributed system
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2212/00Indexing scheme relating to accessing, addressing or allocation within memory systems or architectures
    • G06F2212/72Details relating to flash memory management
    • G06F2212/7205Cleaning, compaction, garbage collection, erase control

Abstract

The invention discloses a load balancing method, a load balancing device, a readable storage medium and electronic equipment, wherein the number of currently available block strips corresponding to a host is obtained; determining a current limiting write bandwidth according to the number of the current available block stripes and a preset minimum write bandwidth; and sending a token to the host according to a preset period based on the current limiting write bandwidth, and executing data writing operation according to the token, wherein the current limiting write bandwidth is determined by the number of the current available block stripes and the preset minimum write bandwidth, and can change along with the change of the number of the current available block stripes.

Description

Load balancing method and device, readable storage medium and electronic equipment
Technical Field
The present invention relates to the field of solid state hard drives, and in particular, to a method and apparatus for load balancing, a readable storage medium, and an electronic device.
Background
In the current development of mainstream enterprise-level SSD (Solid State Drive, solid state disk) firmware, there are two main problems, namely, how to ensure that the maximum delay of a read-write request does not exceed a preset threshold under the condition of starting a GC (gateway collection) scene, and how to balance the data writing rate and the space release rate of a host, i.e. avoid the situation of space exhaustion, which are important and difficult in firmware development.
For these problems, most vendors currently only prefer to guarantee the space first time release, but the maximum write latency and performance under GC scenario are considered less.
Disclosure of Invention
The technical problems to be solved by the invention are as follows: provided are a load balancing method, a load balancing device, a readable storage medium, and an electronic device, capable of reducing maximum write latency while balancing a write rate and a space release rate of a host.
In order to solve the technical problems, the invention adopts a technical scheme that:
a method of load balancing, comprising:
acquiring the number of current available block strips corresponding to a host;
determining a current limiting write bandwidth according to the number of the current available block stripes and a preset minimum write bandwidth;
and sending a token to the host according to a preset period based on the current limiting write bandwidth, and executing data write operation according to the token.
In order to solve the technical problems, the invention adopts another technical scheme that:
an apparatus for load balancing, comprising:
the acquisition module is used for acquiring the number of the current available block strips corresponding to the host;
the current limiting write bandwidth determining module is used for determining the current limiting write bandwidth according to the number of the current available block stripes and a preset minimum write bandwidth;
and the load balancing module is used for sending a token to the host according to a preset period based on the current limiting write bandwidth and executing data write operation according to the token.
In order to solve the technical problems, the invention adopts another technical scheme that:
a computer readable storage medium having stored thereon a computer program which when executed by a processor performs the steps of a method of load balancing as described above.
In order to solve the technical problems, the invention adopts another technical scheme that:
an electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the steps of a method of load balancing as described above when the computer program is executed.
The invention has the beneficial effects that: the method comprises the steps of obtaining the number of current available block strips of a host, determining the current limiting write bandwidth according to the number of the current available block strips and the preset minimum write bandwidth, sending a token to the host based on the current limiting write bandwidth period, and executing data write operation according to the token, wherein the method is not only capable of guaranteeing space first time release, but also capable of determining the current limiting write bandwidth through the number of the current available block strips and the preset minimum write bandwidth, the current limiting write bandwidth can change along with the change of the number of the current available block strips, real-time control is carried out on the write rate of the host based on a token mechanism of the current limiting write bandwidth usage period, the write rate and the space release rate of the host are balanced, and meanwhile, the maximum write delay can be reduced to the greatest extent by periodically sending the token to the host, generation of timeout requests is reduced, and the host performance is stabilized.
Drawings
FIG. 1 is a flow chart of steps of a method for load balancing according to an embodiment of the present invention;
fig. 2 is a schematic structural diagram of a load balancing device according to an embodiment of the present invention;
fig. 3 is a schematic structural diagram of an electronic device according to an embodiment of the present invention;
FIG. 4 is a flow chart of triggering load balancing based on a write request in a method of load balancing according to an embodiment of the present invention;
fig. 5 is a flowchart of a method for load balancing in accordance with an embodiment of the present invention.
Detailed Description
In order to describe the technical contents, the achieved objects and effects of the present invention in detail, the following description will be made with reference to the embodiments in conjunction with the accompanying drawings.
Referring to fig. 1, an embodiment of the present invention provides a method for load balancing, including:
acquiring the number of current available block strips corresponding to a host;
determining a current limiting write bandwidth according to the number of the current available block stripes and a preset minimum write bandwidth;
and sending a token to the host according to a preset period based on the current limiting write bandwidth, and executing data write operation according to the token.
From the above description, the beneficial effects of the invention are as follows: the method comprises the steps of obtaining the number of current available block strips of a host, determining the current limiting write bandwidth according to the number of the current available block strips and the preset minimum write bandwidth, sending a token to the host based on the current limiting write bandwidth period, and executing data write operation according to the token, wherein the method is not only capable of guaranteeing space first time release, but also capable of determining the current limiting write bandwidth through the number of the current available block strips and the preset minimum write bandwidth, the current limiting write bandwidth can change along with the change of the number of the current available block strips, real-time control is carried out on the write rate of the host based on a token mechanism of the current limiting write bandwidth usage period, the write rate and the space release rate of the host are balanced, and meanwhile, the maximum write delay can be reduced to the greatest extent by periodically sending the token to the host, generation of timeout requests is reduced, and the host performance is stabilized.
Further, the obtaining the number of current available block stripes corresponding to the host, and determining the current limiting write bandwidth according to the number of current available block stripes and the preset minimum write bandwidth includes:
receiving a write request of a host;
determining the number of the current available block stripes corresponding to the host according to the write request;
determining a current limiting write bandwidth according to the number of the current available block stripes and a preset minimum write bandwidth;
the method further comprises the steps of:
receiving write completion information corresponding to the write request;
and updating the number of the current available block stripes corresponding to the host according to the writing completion information, and returning to execute the writing request step of the receiving host.
According to the above description, since the GC space release rates under different service models are different, the fixed single current-limiting write bandwidth cannot meet the release requirements under different scenarios, when a write request of a host is received, the current available block stripe number is determined, the current-limiting write bandwidth is determined according to the current-limiting write bandwidth, the host can be subsequently subjected to flow control according to the current-limiting write bandwidth, and when the current available block stripe number is updated again after the write is completed, the write rate and the space release rate of the dynamic balance host are realized, load balancing can be realized under different scenarios, and the flexibility of load balancing is improved.
Further, the obtaining the number of current available block stripes corresponding to the host, and determining the current limiting write bandwidth according to the number of current available block stripes and the preset minimum write bandwidth includes:
acquiring the number of current available block strips corresponding to a host at preset time intervals;
determining a current limiting write bandwidth according to the number of the current available block stripes and a preset minimum write bandwidth;
the performing a data write operation from the token includes:
receiving a write request of a host, and executing data writing operation according to the write request and the token;
after the data writing operation is performed according to the token, the method comprises the following steps:
receiving write completion information corresponding to the write request;
and updating the number of the current available block stripes corresponding to the host according to the writing completion information, and returning to the step of executing the preset time at each interval to acquire the number of the current available block stripes corresponding to the host.
According to the description, besides load balancing after the write request is received, the number of the current available block stripes is also obtained at regular time before the write request is received, the current limiting write bandwidth is updated in real time, and the comprehensiveness of load balancing is improved.
Further, the determining the current limiting write bandwidth according to the number of the current available block stripes and a preset minimum write bandwidth includes:
calculating the number B of the current available block stripes and a preset minimum write bandwidth A, and determining a current limiting write bandwidth C:
C=A×(B-1)。
as can be seen from the above description, because the writing rate and the space release rate of the host may be mismatched during space reclamation, the number of available block stripes is smaller and smaller, the current limiting writing bandwidth is calculated through the number of the current available block stripes and the preset minimum writing bandwidth, the current limiting writing bandwidth is reduced along with the reduction of the number of the available block stripes, the writing rate and the space release rate of the host are finally promoted to be balanced, and the number of the available block stripes is reduced by one, if the number of the current available block stripes is 1, the current limiting writing bandwidth is 0, so that the situation that space is consumed during writing is avoided.
Further, the sending the token to the host according to the preset period based on the current limited write bandwidth includes:
calculating according to the current limiting write bandwidth and the preset data size corresponding to each token to obtain the total token number corresponding to the current limiting write bandwidth;
determining the number of tokens to be sent corresponding to each preset period according to the total number of tokens and the preset period;
and sending the tokens to the host according to the number of the tokens to be sent and the preset period.
As can be seen from the above description, each token corresponds to a preset data size, the number of tokens to be transmitted in each preset period is determined based on the current limited write bandwidth, and the tokens are transmitted in the last period, that is, the host can only write the data sizes corresponding to all the tokens in the period in each period, so that the write rate of the host can be well controlled, and the method of transmitting the tokens in the period is used, so that the generation of timeout requests can be reduced to the greatest extent, the generation of fluctuation is reduced, and the performance of the host is facilitated to be stabilized.
Further, the calculating according to the current limiting write bandwidth and the preset data size corresponding to each token, to obtain the total token number corresponding to the current limiting write bandwidth includes:
the total token number T is:
T=C÷D;
wherein D represents the preset data size corresponding to each token;
the determining the number of tokens to be sent corresponding to each preset period according to the total number of tokens and the preset period includes:
the number t of tokens to be sent corresponding to each preset period is as follows:
t=T÷(C÷S);
wherein S represents the preset period.
As can be seen from the above description, the total number of tokens is calculated according to the current write bandwidth and the preset data size corresponding to each token, which is favorable for controlling the writing rate of the host according to the use token, so that the writing rate and the space release rate of the host are balanced, the number of tokens to be transmitted corresponding to each preset period is calculated, and then the token period is transmitted to the host, so that the maximum writing time delay can be reduced to the greatest extent, the generation of timeout requests is reduced, and the performance of the host is ensured.
Further, the performing a data write operation according to the token includes:
and judging whether the token exists, if so, executing data writing operation by using the token, otherwise, waiting for receiving the token, and returning to execute the step of judging whether the token exists.
As can be seen from the above description, the token can be used for writing data only when the token exists, otherwise the token is waited to be received, and the data writing rate is effectively controlled by periodically sending the token for writing data.
Referring to fig. 2, another embodiment of the present invention provides a load balancing apparatus, including:
the acquisition module is used for acquiring the number of the current available block strips corresponding to the host;
the current limiting write bandwidth determining module is used for determining the current limiting write bandwidth according to the number of the current available block stripes and a preset minimum write bandwidth;
and the load balancing module is used for sending a token to the host according to a preset period based on the current limiting write bandwidth and executing data write operation according to the token.
Another embodiment of the present invention provides a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, performs the steps of a method of load balancing as described above.
Referring to fig. 3, another embodiment of the present invention provides an electronic device, including a memory, a processor, and a computer program stored in the memory and capable of running on the processor, where the processor implements the steps of the above-mentioned method for load balancing when executing the computer program.
The method, the device, the readable storage medium and the electronic device for load balancing according to the present invention can be applied to any type of SSD (Solid State Drive, solid state disk), such as flash memory based SSD, DRAM (dynamic random access memory ) based SSD and 3D XPoint based SSD, and are described in the following embodiments:
example 1
Referring to fig. 1 and 4, a load balancing method of the present embodiment includes:
s1, obtaining the number of current available block strips corresponding to a host;
specifically, as shown in fig. 4, a write request of a host is received;
determining the number of currently available block (block) stripes corresponding to the host according to the write request;
s2, determining a current limiting write bandwidth according to the number of the current available block strips and a preset minimum write bandwidth;
specifically, as shown in fig. 4, the number B of currently available block stripes is calculated with a preset minimum write bandwidth a, and a current limiting write bandwidth C is determined:
C=A×(B-1);
assuming that the preset minimum write bandwidth is 5MB/s (megabytes/s), the number of currently available block stripes is 11, then the current limited write bandwidth is 50MB/s;
s3, sending a token to the host according to a preset period based on the current limiting write bandwidth, and executing data write operation according to the token;
s31, calculating according to the current limiting write bandwidth and the preset data size corresponding to each token to obtain the total token number corresponding to the current limiting write bandwidth;
the total token number T is:
T=C÷D;
wherein D represents the preset data size corresponding to each token;
the preset data size corresponding to each token can be flexibly set according to actual conditions;
specifically, assuming that the preset data size corresponding to each token is 4KB (kilobytes), and the current limited write bandwidth is 50MB/s, i.e. 51200KB/s (50 mb=50×1024 kb=51200 KB), then the total number of tokens is 12800;
s32, determining the number of tokens to be transmitted corresponding to each preset period according to the total number of tokens and the preset period;
specifically, the number t of tokens to be sent corresponding to each preset period is:
t=T÷(C÷S);
wherein S represents the preset period;
the preset period can be flexibly set according to actual conditions;
specifically, assuming that 4ms (milliseconds) is a preset period, the total number of tokens is 12800, the current limiting write bandwidth is 50MB/s, and since 1s=1000 ms, the number of tokens to be sent corresponding to each preset period is 51 (12800/1000/4));
s33, sending tokens to the host according to the number of the tokens to be sent and the preset period;
specifically, as described above, 51 tokens are sent to the host every 4 ms;
s34, judging whether the token exists, if so, executing data writing operation by using the token, otherwise, waiting for receiving the token, and returning to execute the step of judging whether the token exists;
in an alternative embodiment, determining whether the number of tokens is sufficient to complete the data write operation, if so, executing the data write operation using the tokens, if not, waiting for receipt of the tokens, and returning to execute the step of determining whether the number of tokens is sufficient to complete the data write operation;
s4, receiving write completion information corresponding to the write request;
s5, updating the number of the current available block stripes corresponding to the host according to the writing completion information, and returning to execute the step S1;
specifically, the number of currently available block stripes before the host performs the data write operation is 11, the current limited write bandwidth is 50MB/s, and assuming that the number of currently available block stripes is updated to 10 after the host performs the data write operation, the current limited write bandwidth is 45MB/s;
the current limited write bandwidth is reduced along with the reduction of the number of the current available block stripes, so that the dynamic adjustment of load balance is realized, the data writing rate and the space recovery rate of a host can be finally promoted to be balanced, and meanwhile, the current limited write bandwidth is calculated in a mode that the number of the current available block stripes is reduced by 1, so that space exhaustion is not caused, because when the number of the current available block stripes is 1, the current limited write bandwidth is 0.
Example two
Referring to fig. 1 and 5, another way of triggering and obtaining the number of currently available block stripes corresponding to the host is provided in this embodiment, specifically:
s1, acquiring the number of current available block strips corresponding to a host at intervals of preset time;
the preset time can be flexibly set according to actual conditions;
s2, determining a current limiting write bandwidth according to the number of the current available block strips and a preset minimum write bandwidth;
specifically, as shown in fig. 5, the number B of currently available block stripes is calculated with a preset minimum write bandwidth a, and a current limiting write bandwidth C is determined:
C=A×(B-1);
s3, sending a token to the host according to a preset period based on the current limiting write bandwidth;
specifically, as shown in fig. 5, according to the current write bandwidth and the preset data size corresponding to each token, obtaining the total token number corresponding to the current limiting write bandwidth;
the total token number T is:
T=C÷D;
wherein D represents the preset data size corresponding to each token;
determining the number of tokens to be sent corresponding to each preset period according to the total number of tokens and the preset period;
the number t of tokens to be sent corresponding to each preset period is as follows:
t=T÷(C÷S);
wherein S represents the preset period;
as shown in fig. 5, according to the number of tokens to be sent, sending the tokens to the host according to the preset period;
s4, receiving a write request of a host, and executing data writing operation according to the write request and the token;
specifically, as shown in fig. 5, whether the token exists or not is judged, if yes, the token is used for executing data writing operation, if not, the token is waited for being received, and the step of judging whether the token exists or not is executed in a returning mode;
s5, receiving write completion information corresponding to the write request;
s6, updating the number of the current available block stripes corresponding to the host according to the writing completion information, and returning to execute the step S1.
Example III
Referring to fig. 2, a load balancing apparatus includes:
the acquisition module is used for acquiring the number of the current available block strips corresponding to the host;
the current limiting write bandwidth determining module is used for determining the current limiting write bandwidth according to the number of the current available block stripes and a preset minimum write bandwidth;
and the load balancing module is used for sending a token to the host according to a preset period based on the current limiting write bandwidth and executing data write operation according to the token.
Example IV
A computer readable storage medium having stored thereon a computer program which, when executed by a processor, performs the steps of the method of load balancing in embodiment one or embodiment two.
Example five
Referring to fig. 3, an electronic device includes a memory, a processor, and a computer program stored on the memory and executable on the processor, where the processor implements the steps of the method of load balancing in the first or second embodiments when the computer program is executed.
In summary, according to the method, the device, the readable storage medium and the electronic equipment for balancing the load provided by the invention, the number of the current available block stripes corresponding to the host is obtained, the current limiting write bandwidth is determined according to the number of the current available block stripes and the preset minimum write bandwidth, and then the calculation is performed according to the current limiting write bandwidth and the preset data size corresponding to each token, so as to obtain the total token number corresponding to the current limiting write bandwidth; determining the number of tokens to be sent corresponding to each preset period according to the total number of tokens and the preset period; according to the method, the token is sent to the host according to the number of tokens to be sent according to a preset period, and data writing operation is carried out according to the token, because the current limited write bandwidth can change along with the change of the number of currently available block stripes, the writing rate of the host can be controlled in real time based on a token mechanism of the current limited write bandwidth using period, the writing rate and the space release rate of the host can be dynamically balanced, load balancing can be realized under different scenes, the flexibility of the load balancing is improved, when the current limited write bandwidth is calculated, the situation that space is not exhausted during writing is guaranteed through a method of subtracting one from the number of available block stripes, meanwhile, the maximum write delay can be reduced to the greatest extent through periodically sending the token to the host, the generation of timeout requests is reduced, and the method is beneficial to stabilizing the performance of the host.
In the foregoing embodiments provided by the present application, it should be understood that the disclosed method, apparatus, computer readable storage medium and electronic device may be implemented in other manners. For example, the apparatus embodiments described above are merely illustrative, and for example, the division of the modules is merely a logical function division, and there may be additional divisions when actually implemented, for example, multiple components or modules may be combined or integrated into another apparatus, or some features may be omitted or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed with respect to each other may be an indirect coupling or communication connection via some interfaces, devices or components or modules, which may be in electrical, mechanical, or other forms.
The components illustrated as separate components may or may not be physically separate, and components shown as components may or may not be physical modules, i.e., may be located in one place, or may be distributed over multiple network modules. Some or all of the components may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional module in each embodiment of the present invention may be integrated into one processing module, or each component may exist alone physically, or two or more modules may be integrated into one module. The integrated modules may be implemented in hardware or in software functional modules.
The integrated modules, if implemented in the form of software functional modules and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention may be embodied essentially or in part or all of the technical solution or in part in the form of a software product stored in a storage medium, including instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
It should be noted that, for the sake of simplicity of description, the foregoing method embodiments are all expressed as a series of combinations of actions, but it should be understood by those skilled in the art that the present invention is not limited by the order of actions described, as some steps may be performed in other order or simultaneously in accordance with the present invention. Further, those skilled in the art will appreciate that the embodiments described in the specification are all preferred embodiments, and that the acts and modules referred to are not necessarily all required for the present invention.
In the foregoing embodiments, the descriptions of the embodiments are emphasized, and for parts of one embodiment that are not described in detail, reference may be made to the related descriptions of other embodiments.
The foregoing description is only illustrative of the present invention and is not intended to limit the scope of the invention, and all equivalent changes made by the specification and drawings of the present invention, or direct or indirect application in the relevant art, are included in the scope of the present invention.

Claims (7)

1. A method of load balancing, comprising:
acquiring the number of current available block strips corresponding to a host;
determining a current limiting write bandwidth according to the number of the current available block stripes and a preset minimum write bandwidth;
transmitting a token to the host according to a preset period based on the current limiting write bandwidth, and executing data write operation according to the token;
the determining the current limiting write bandwidth according to the number of the current available block stripes and the preset minimum write bandwidth comprises the following steps:
calculating the number B of the current available block stripes and a preset minimum write bandwidth A, and determining a current limiting write bandwidth C:
C=A×(B-1);
the sending the token to the host according to the preset period based on the current limiting write bandwidth comprises the following steps:
calculating according to the current limiting write bandwidth and the preset data size corresponding to each token to obtain the total token number corresponding to the current limiting write bandwidth;
determining the number of tokens to be sent corresponding to each preset period according to the total number of tokens and the preset period;
transmitting tokens to the host according to the number of tokens to be transmitted and the preset period;
the step of calculating according to the current limiting write bandwidth and the preset data size corresponding to each token, and the step of obtaining the total token number corresponding to the current limiting write bandwidth comprises the following steps:
the total token number T is:
T=C÷D;
wherein D represents the preset data size corresponding to each token;
the determining the number of tokens to be sent corresponding to each preset period according to the total number of tokens and the preset period includes:
the number t of tokens to be sent corresponding to each preset period is as follows:
t=T÷(C÷S);
wherein S represents the preset period.
2. The method of claim 1, wherein the obtaining the number of currently available block stripes corresponding to the host, and determining the current limited write bandwidth according to the number of currently available block stripes and a preset minimum write bandwidth comprises:
receiving a write request of a host;
determining the number of the current available block stripes corresponding to the host according to the write request;
determining a current limiting write bandwidth according to the number of the current available block stripes and a preset minimum write bandwidth;
the method further comprises the steps of:
receiving write completion information corresponding to the write request;
and updating the number of the current available block stripes corresponding to the host according to the writing completion information, and returning to execute the writing request step of the receiving host.
3. The method of claim 1, wherein the obtaining the number of currently available block stripes corresponding to the host, and determining the current limited write bandwidth according to the number of currently available block stripes and a preset minimum write bandwidth comprises:
acquiring the number of current available block strips corresponding to a host at preset time intervals;
determining a current limiting write bandwidth according to the number of the current available block stripes and a preset minimum write bandwidth;
the performing a data write operation from the token includes:
receiving a write request of a host, and executing data writing operation according to the write request and the token;
after the data writing operation is performed according to the token, the method comprises the following steps:
receiving write completion information corresponding to the write request;
and updating the number of the current available block stripes corresponding to the host according to the writing completion information, and returning to the step of executing the preset time at each interval to acquire the number of the current available block stripes corresponding to the host.
4. A method of load balancing according to any one of claims 1-3, wherein said performing data write operations from said token comprises:
and judging whether the token exists, if so, executing data writing operation by using the token, otherwise, waiting for receiving the token, and returning to execute the step of judging whether the token exists.
5. An apparatus for load balancing, comprising:
the acquisition module is used for acquiring the number of the current available block strips corresponding to the host;
the current limiting write bandwidth determining module is used for determining the current limiting write bandwidth according to the number of the current available block stripes and a preset minimum write bandwidth;
the load balancing module is used for sending a token to the host according to a preset period based on the current limiting write bandwidth and executing data write operation according to the token;
the determining the current limiting write bandwidth according to the number of the current available block stripes and the preset minimum write bandwidth comprises the following steps:
calculating the number B of the current available block stripes and a preset minimum write bandwidth A, and determining a current limiting write bandwidth C:
C=A×(B-1);
the sending the token to the host according to the preset period based on the current limiting write bandwidth comprises the following steps:
calculating according to the current limiting write bandwidth and the preset data size corresponding to each token to obtain the total token number corresponding to the current limiting write bandwidth;
determining the number of tokens to be sent corresponding to each preset period according to the total number of tokens and the preset period;
transmitting tokens to the host according to the number of tokens to be transmitted and the preset period;
the step of calculating according to the current limiting write bandwidth and the preset data size corresponding to each token, and the step of obtaining the total token number corresponding to the current limiting write bandwidth comprises the following steps:
the total token number T is:
T=C÷D;
wherein D represents the preset data size corresponding to each token;
the determining the number of tokens to be sent corresponding to each preset period according to the total number of tokens and the preset period includes:
the number t of tokens to be sent corresponding to each preset period is as follows:
t=T÷(C÷S);
wherein S represents the preset period.
6. A computer readable storage medium, on which a computer program is stored, characterized in that the computer program, when being executed by a processor, implements the steps of a method of load balancing according to any one of claims 1 to 4.
7. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the processor implements the steps of a method of load balancing according to any of claims 1 to 4 when the computer program is executed.
CN202110733246.XA 2021-06-29 2021-06-29 Load balancing method and device, readable storage medium and electronic equipment Active CN113467720B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110733246.XA CN113467720B (en) 2021-06-29 2021-06-29 Load balancing method and device, readable storage medium and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110733246.XA CN113467720B (en) 2021-06-29 2021-06-29 Load balancing method and device, readable storage medium and electronic equipment

Publications (2)

Publication Number Publication Date
CN113467720A CN113467720A (en) 2021-10-01
CN113467720B true CN113467720B (en) 2023-05-23

Family

ID=77874194

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110733246.XA Active CN113467720B (en) 2021-06-29 2021-06-29 Load balancing method and device, readable storage medium and electronic equipment

Country Status (1)

Country Link
CN (1) CN113467720B (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110275670A (en) * 2018-03-16 2019-09-24 华为技术有限公司 Method, apparatus, storage equipment and the storage medium of data flow in control storage equipment
CN110308875A (en) * 2019-06-27 2019-10-08 深信服科技股份有限公司 Data read-write method, device, equipment and computer readable storage medium
CN111865819A (en) * 2020-06-24 2020-10-30 苏州浪潮智能科技有限公司 Multi-site synchronous data bandwidth control method, device and equipment for distributed system

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8984216B2 (en) * 2010-09-09 2015-03-17 Fusion-Io, Llc Apparatus, system, and method for managing lifetime of a storage device
US9081504B2 (en) * 2011-12-29 2015-07-14 Lenovo Enterprise Solutions (Singapore) Pte. Ltd. Write bandwidth management for flash devices
US10965613B2 (en) * 2019-01-10 2021-03-30 Vmware, Inc. Multi-pipe bandwidth control in hosted systems

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110275670A (en) * 2018-03-16 2019-09-24 华为技术有限公司 Method, apparatus, storage equipment and the storage medium of data flow in control storage equipment
CN110308875A (en) * 2019-06-27 2019-10-08 深信服科技股份有限公司 Data read-write method, device, equipment and computer readable storage medium
CN111865819A (en) * 2020-06-24 2020-10-30 苏州浪潮智能科技有限公司 Multi-site synchronous data bandwidth control method, device and equipment for distributed system

Also Published As

Publication number Publication date
CN113467720A (en) 2021-10-01

Similar Documents

Publication Publication Date Title
US7912951B2 (en) Quality of service management
US8892716B2 (en) Quality of service management using host specific values
JP6495327B2 (en) Fine-grained bandwidth provisioning in memory controllers
US10116746B2 (en) Data storage method and network interface card
JP2013509658A (en) Allocation of storage memory based on future usage estimates
US11379836B2 (en) Methods and systems for recording data based on plurality of blockchain networks
EP4020153A1 (en) Cache space management method and device
CN108874324B (en) Access request processing method, device, equipment and readable storage medium
CN111176569A (en) Flow quota method, device, system and equipment and readable storage medium
CN113645150B (en) Transmission rate control method, apparatus, electronic device, and readable storage medium
EP3312727A1 (en) Differential data backup method and device
CN113467720B (en) Load balancing method and device, readable storage medium and electronic equipment
CN107491455B (en) Reading method and device in distributed system
US20180173639A1 (en) Memory access method, apparatus, and system
CN104850431A (en) Stabilizing treatment method and device based on FOTA (Firmware Over-The-Air) upgrading
CN113377278A (en) Solid state disk, garbage recycling and controlling method, equipment, system and storage medium
CN112039727A (en) Data transmission method and device, electronic equipment and storage medium
CN113765504B (en) Universal dynamic delay jitter elimination method, device, terminal and storage medium
CN114328548B (en) Dual-storage-pool data elimination speed control method, system, terminal and storage medium
CN109603153B (en) Virtual event processing method and device, electronic equipment and storage medium
CN109032522B (en) Data reading method of solid state disk and solid state disk
CN106095697B (en) A kind of methods, devices and systems of data write storage
CN113434263B (en) Virtual machine data caching method and computer-readable storage medium
US11249650B1 (en) Data prefetch method in dynamically adjustable amount
WO2023116438A1 (en) Data access method and apparatus, and device

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