CN111367471A - Speed limiting method, device, equipment and medium for write-in cache - Google Patents
Speed limiting method, device, equipment and medium for write-in cache Download PDFInfo
- Publication number
- CN111367471A CN111367471A CN202010125171.2A CN202010125171A CN111367471A CN 111367471 A CN111367471 A CN 111367471A CN 202010125171 A CN202010125171 A CN 202010125171A CN 111367471 A CN111367471 A CN 111367471A
- Authority
- CN
- China
- Prior art keywords
- current
- cache space
- speed
- write
- cache
- 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.)
- Granted
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input 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/06—Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
- G06F3/0601—Interfaces specially adapted for storage systems
- G06F3/0602—Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
- G06F3/061—Improving I/O performance
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input 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/06—Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
- G06F3/0601—Interfaces specially adapted for storage systems
- G06F3/0628—Interfaces specially adapted for storage systems making use of a particular technique
- G06F3/0655—Vertical data movement, i.e. input-output transfer; data movement between one or more hosts and one or more storage devices
- G06F3/0656—Data buffering arrangements
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Human Computer Interaction (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Memory System Of A Hierarchy Structure (AREA)
Abstract
The invention discloses a speed limiting method for writing in a cache, which comprises the following steps: counting the current residual cache space and calculating the current write-back speed; judging whether the current residual cache space is smaller than a preset target cache space or not; if so, determining the current limit speed according to the current write-back speed, the current residual cache space and the preset minimum residual cache space, and writing the cache space according to the current limit speed; wherein the minimum remaining cache space is less than the target cache space; and when the current residual cache space is equal to the minimum residual cache space, determining that the current limiting speed is zero. It can be seen that the present invention ensures that the remaining buffer space is not less than TS 1; and, through dynamic control write-in speed, exert the caching performance as fully as possible, the buffer memory resource is fully utilized. In addition, the invention provides a speed limiting device, equipment and a storage medium for writing in the cache, which correspond to the method.
Description
Technical Field
The present invention relates to the field of storage technologies, and in particular, to a method, an apparatus, a device, and a medium for limiting a write speed of a cache.
Background
The caching technology generally uses low-capacity high-performance equipment to match with low-performance high-capacity equipment, so as to achieve the purpose of improving the running performance of the program. When data is written, the data is firstly written into a cache and then written back to a low-performance large-capacity device under certain regulation, so that the cache space can be released to become a space in which the data can be written again.
In the prior art, when performing write-in and write-back operations on a cache, a threshold is usually set, and after the usage amount of the cache space reaches the threshold, the write-in speed of write-in data is limited, so that the write-in operation of the write-in data is completed at a smaller fixed speed, thereby avoiding the situation that the cache space is completely full of write-in data as much as possible.
Although the prior art limits the speed of the write operation, the occupied condition of the cache space is relieved to a certain extent. However, since the write-back speed is uncertain, the write-back speed is likely to be lower than the fixed speed, and therefore it cannot be ensured that the cache space is not occupied even if the writing is completed according to the fixed speed; and, after the usage amount of the cache space reaches the threshold, the write-in operation is completed at a fixed speed, so that the cache performance cannot be fully exerted, and resource waste is caused.
Disclosure of Invention
The invention aims to provide a method, a device, equipment and a medium for limiting the speed of a write cache. When the current residual cache space is equal to the minimum residual cache space, the current limiting speed is zero, namely, the writing operation is stopped, so that the residual cache space is ensured not to be smaller than TS1, and the cache space is ensured not to be fully occupied all the time; and the present invention determines the current limit speed according to the current write-back speed and the current residual cache space, the current limit speed dynamically changes along with the difference between the current write-back speed and the current residual cache space, the cache performance is fully exerted as much as possible by dynamically controlling the write-in speed while the cache space is ensured not to be occupied, and the cache resources are fully utilized.
To solve the above technical problem, the present invention provides a method for limiting speed of write cache, comprising:
counting the current residual cache space and calculating the current write-back speed;
judging whether the current residual cache space is smaller than a preset target cache space or not;
if so, determining the current limit speed according to the current write-back speed, the current residual cache space and a preset minimum residual cache space, and writing the cache space according to the current limit speed; wherein the minimum remaining cache space is less than the target cache space; and when the current residual cache space is equal to the minimum residual cache space, determining that the current limiting speed is zero.
Preferably, the determining the current limit speed to perform the write operation on the cache space according to the current limit speed according to the current write-back speed, the current remaining cache space and the preset minimum remaining cache space specifically includes:
according to XS ═ DS × ((LS-TS1)/TS1), determining the current limiting speed to write the cache space according to the current limiting speed;
wherein XS is a current limit speed, DS is a current write-back speed, LS is a current remaining cache space, and TS1 is a preset minimum remaining cache space.
Preferably, the calculating the current write-back speed specifically includes:
calculating the average value of the write-back speed in a preset time period adjacent to the current moment by adopting a weighted moving average line algorithm;
and taking the average value as the current write-back speed.
Preferably, the method further comprises the following steps:
and updating the target cache space and the minimum residual cache space according to the received updating information.
Preferably, the method further comprises the following steps:
and generating a log for recording the current residual cache space, the current write-back speed and the current limit speed.
Preferably, the method further comprises the following steps:
judging whether the current residual cache space is smaller than the minimum residual cache space or not according to the log;
if so, stopping the writing operation and carrying out alarm prompt in the log.
Preferably, the method further comprises the following steps:
and informing the operation and maintenance personnel to process the abnormal conditions prompted in the log according to the pre-stored contact information of the operation and maintenance personnel.
In order to solve the above technical problem, the present invention further provides a speed limiter for writing in a cache, including:
the statistical module is used for counting the current residual cache space and calculating the current write-back speed;
the judging module is used for judging whether the current residual cache space is smaller than a preset target cache space or not; if yes, entering a determining module;
the determining module is used for determining the current limiting speed according to the current write-back speed, the current remaining cache space and the preset minimum remaining cache space so as to write the cache space according to the current limiting speed; wherein the minimum remaining cache space is less than the target cache space; and when the current residual cache space is equal to the minimum residual cache space, determining that the current limiting speed is zero.
In order to solve the above technical problem, the present invention further provides a speed limiting device written in a cache, comprising a memory for storing a computer program;
a processor for implementing the steps of the method for limiting the speed of writing to the cache according to any one of the above embodiments when the computer program is executed.
In order to solve the above technical problem, the present invention further provides a computer-readable storage medium, wherein a computer program is stored on the computer-readable storage medium, and when being executed by a processor, the computer program implements the steps of the method for limiting speed of write-in cache according to any one of the above.
The invention provides a speed limiting method for writing in a cache, which comprises the following steps: counting the current residual cache space and calculating the current write-back speed; judging whether the current residual cache space is smaller than a preset target cache space or not; if so, determining the current limit speed according to the current write-back speed, the current residual cache space and the preset minimum residual cache space, and writing the cache space according to the current limit speed; wherein the minimum remaining cache space is less than the target cache space; and when the current residual cache space is equal to the minimum residual cache space, determining that the current limiting speed is zero. Therefore, when the current remaining cache space is equal to the minimum remaining cache space, the current limiting speed is zero, that is, the writing operation is stopped, so that the remaining cache space is ensured not to be smaller than the TS1, and the cache space is ensured not to be occupied all the time; and the present invention determines the current limit speed according to the current write-back speed and the current residual cache space, the current limit speed dynamically changes along with the difference between the current write-back speed and the current residual cache space, the cache performance is fully exerted as much as possible by dynamically controlling the write-in speed while the cache space is ensured not to be occupied, and the cache resources are fully utilized.
In addition, the speed limiting device, the equipment and the storage medium written into the cache correspond to the method, and the same beneficial effects are achieved.
Drawings
In order to illustrate the embodiments of the present invention more clearly, the drawings that are needed in the embodiments will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and that other drawings can be obtained by those skilled in the art without inventive effort.
Fig. 1 is a flowchart of a speed limiting method for write cache according to an embodiment of the present invention;
FIG. 2 is a flowchart of another write cache throttling method according to an embodiment of the present invention;
FIG. 3 is a block diagram of a speed limiter for write cache according to an embodiment of the present invention;
fig. 4 is a structural diagram of a speed limiting device for write caching according to an embodiment of the present invention.
Detailed Description
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 only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments of the present invention without any creative work belong to the protection scope of the present invention.
The core of the invention is to provide a speed limiting method, a device, equipment and a medium for writing in cache. When the current residual cache space is equal to the minimum residual cache space, the current limiting speed is zero, namely, the writing operation is stopped, so that the residual cache space is ensured not to be smaller than TS1, and the cache space is ensured not to be fully occupied all the time; and the present invention determines the current limit speed according to the current write-back speed and the current residual cache space, the current limit speed dynamically changes along with the difference between the current write-back speed and the current residual cache space, the cache performance is fully exerted as much as possible by dynamically controlling the write-in speed while the cache space is ensured not to be occupied, and the cache resources are fully utilized.
In order that those skilled in the art will better understand the disclosure, the invention will be described in further detail with reference to the accompanying drawings and specific embodiments.
Fig. 1 is a flowchart of a speed limiting method for write cache according to an embodiment of the present invention; as shown in fig. 1, a method for limiting speed of write cache according to an embodiment of the present invention includes steps S101 to S103:
step S101: counting the current residual cache space and calculating the current write-back speed;
in one embodiment, the counting of the current remaining cache space is specifically performed at equal time intervals. For example, the current remaining buffer space is counted once every 1s interval. Those skilled in the art may set the time interval for counting the current remaining buffer space according to the actual application situation, which is not limited in the embodiment of the present invention.
Specifically, when the current write-back speed is calculated, the monitored write-back speed at the current time may be used as the current write-back speed. Furthermore, a weighted moving average line algorithm can be adopted to calculate the average value of the write-back speed in a preset time period adjacent to the current moment; the average value is taken as the current write-back speed. For example, the average value of the write back speeds within 5s from the current time is calculated as the current write back speed. Therefore, the method avoids the influence on the determination of the current limit speed after the current limit speed is influenced because the current write-back speed calculated by the method is inaccurate due to the fact that the write-back speed fluctuates sharply in a short time.
It can be understood that the speed limiting method for write-in cache according to the embodiment of the present invention further includes monitoring and recording write-back speed in real time, and when the current write-back speed is calculated by using a weighted moving average line algorithm, data of all write-back speeds in a preset time period adjacent to the current time can be obtained according to the recorded content.
Step S102: judging whether the current residual cache space is smaller than a preset target cache space or not; if yes, go to step S103;
step S103: determining a current limit speed according to the current write-back speed, the current residual cache space and a preset minimum residual cache space so as to write the cache space according to the current limit speed; wherein the minimum remaining cache space is less than the target cache space; and when the current residual cache space is equal to the minimum residual cache space, determining that the current limiting speed is zero.
In the implementation, in order to effectively prevent the cache space from being full without affecting the write and write back operations as much as possible, the target cache space may be set in advance. And when the current residual cache space is larger than or equal to the target cache space, the speed of writing the data into the cache is not limited. And when the current residual cache space is smaller than the preset target cache space, limiting the writing speed.
In one embodiment, the current limit speed is determined according to the current write-back speed, the current remaining cache space and the preset minimum remaining cache space. Those skilled in the art will appreciate that the minimum remaining cache space is less than the target cache space.
Specifically, according to the current write-back speed, the current remaining cache space and the preset minimum remaining cache space, determining the current limit speed to perform the write operation on the cache space according to the current limit speed specifically includes:
according to XS ═ DS × ((LS-TS1)/TS1), determining a current limiting speed to write the cache space according to the current limiting speed;
wherein XS is a current limit speed, DS is a current write-back speed, LS is a current remaining cache space, and TS1 is a preset minimum remaining cache space.
When the write operation needs speed limiting, the current limit speed can be determined according to XS (DS × ((LS-TS1)/TS 1). As known by the formula, the current limit speed can be different according to the difference between the current write-back speed and the current residual cache space, so that the current limit speed is dynamically changed.
In one embodiment, the set minimum remaining cache space is less than the target cache space. In particular, the target cache space may be twice the minimum remaining cache space. For cache spaces with different capacities, the target cache space and the minimum remaining cache space can be set according to a certain proportion of the total cache capacity; the target buffer space and the minimum remaining buffer space may also be set to fixed values for buffer spaces of different capacities. Those skilled in the art can determine the target cache space and the preset minimum remaining cache space according to the actual application situation, and the present invention is not limited.
The invention provides a speed limiting method for writing in a cache, which comprises the following steps: counting the current residual cache space and calculating the current write-back speed; judging whether the current residual cache space is smaller than a preset target cache space or not; if so, determining the current limit speed according to the current write-back speed, the current residual cache space and the preset minimum residual cache space, and writing the cache space according to the current limit speed; wherein the minimum remaining cache space is less than the target cache space; and when the current residual cache space is equal to the minimum residual cache space, determining that the current limiting speed is zero. Therefore, when the current remaining cache space is equal to the minimum remaining cache space, the current limiting speed is zero, that is, the writing operation is stopped, so that the remaining cache space is ensured not to be smaller than the TS1, and the cache space is ensured not to be occupied all the time; and the present invention determines the current limit speed according to the current write-back speed and the current residual cache space, the current limit speed dynamically changes along with the difference between the current write-back speed and the current residual cache space, the cache performance is fully exerted as much as possible by dynamically controlling the write-in speed while the cache space is ensured not to be occupied, and the cache resources are fully utilized.
FIG. 2 is a flowchart of another write cache throttling method according to an embodiment of the present invention; as shown in fig. 2, the method for limiting speed of write cache according to the embodiment of the present invention further includes step S104;
step S104: and updating the target cache space and the minimum residual cache space according to the received updating information.
In a particular embodiment, the set values of the target buffer space and the minimum remaining buffer space may be updated for the total capacity of the buffer spaces and the particular use case. Specifically, when the update information is received, the target cache space and the minimum remaining cache space are updated according to the contents of the update target, the update numerical value and the like contained in the update information, so that the flexibility and universality of the write-in cache speed limiting method provided by the invention are improved, and the requirements of users are better met.
FIG. 2 is a flowchart of another write cache throttling method according to an embodiment of the present invention; as shown in fig. 2, the method for limiting speed of write cache according to the embodiment of the present invention further includes step S105;
step S105: and generating a log for recording the current residual cache space, the current write-back speed and the current limit speed.
In one embodiment, a log may be generated to record the current remaining space, the current write back speed, and the current qualification speed. Therefore, operation and maintenance personnel can know the use condition of the current cache space and the states of write-back and write-in operation by acquiring the content recorded in the log, and can control the write-in and write-back operation in time according to the content of the log. Meanwhile, when the write cache operation is abnormal, the reason of the abnormality can be found through the content recorded in the log.
FIG. 2 is a flowchart of another write cache throttling method according to an embodiment of the present invention; as shown in fig. 2, the method for limiting speed of write cache according to the embodiment of the present invention further includes steps S106 to S107;
step S106: judging whether the current residual cache space is smaller than the minimum residual cache space or not according to the log; if yes, go to step S107;
step S107: and stopping writing operation and carrying out alarm prompt in the log.
In one embodiment, the current cache space is compared with the minimum remaining cache space according to the content recorded in the log, and as can be seen from the above description, the speed is limited by the write operation according to the current limited speed obtained by calculation, and the remaining cache space in practical application should be greater than or equal to the minimum remaining cache space; and when the current cache space is found to be smaller than the minimum residual cache space, indicating that an abnormal condition occurs. In order to prevent the buffer space from being full, the writing operation can be stopped in time, and the log is subjected to alarm prompt.
FIG. 2 is a flowchart of another write cache throttling method according to an embodiment of the present invention; as shown in fig. 2, the method for limiting speed of write cache according to the embodiment of the present invention further includes step S108;
step S108: and informing the operation and maintenance personnel to process the abnormal conditions prompted in the log according to the pre-stored contact information of the operation and maintenance personnel.
In one embodiment, when an abnormal situation is found, the operation and maintenance personnel can be notified according to the pre-stored contact information of the operation and maintenance personnel. Specifically, the pre-stored contact information may be a telephone number or a mailbox of the operation and maintenance staff. Therefore, after receiving the notification, the operation and maintenance personnel can process the abnormal condition in time. The operation and maintenance personnel do not need to monitor the service condition of the cache space all the time, convenience is provided for the operation and maintenance personnel, and the normal use of the cache space is ensured.
The invention also provides a speed limiting device written into the cache and a corresponding embodiment of the speed limiting device written into the cache. It should be noted that the present invention describes the embodiments from two perspectives, one is based on the functional module, and the other is based on the hardware.
FIG. 3 is a block diagram of a speed limiter for write cache according to an embodiment of the present invention; as shown in fig. 3, a speed limiter for write cache according to an embodiment of the present invention includes:
the statistical module 10 is used for counting the current residual cache space and calculating the current write-back speed;
the judging module 11 is configured to judge whether the current remaining cache space is smaller than a preset target cache space; if yes, entering a determining module 12;
the determining module 12 is configured to determine a current limiting speed according to the current write-back speed, the current remaining cache space, and a preset minimum remaining cache space, so as to perform a write operation on the cache space according to the current limiting speed; wherein the minimum remaining cache space is less than the target cache space; and when the current residual cache space is equal to the minimum residual cache space, determining that the current limiting speed is zero.
In an embodiment, the apparatus for limiting speed of a write cache according to an embodiment of the present invention further includes:
and the updating module is used for updating the target cache space and the minimum residual cache space according to the received updating information.
In an embodiment, the apparatus for limiting speed of a write cache according to an embodiment of the present invention further includes:
and the generating module is used for generating a log for recording the current residual cache space, the current write-back speed and the current limit speed.
In an embodiment, the apparatus for limiting speed of a write cache according to an embodiment of the present invention further includes:
the alarm module is used for judging whether the current residual cache space is smaller than the minimum residual cache space or not according to the log; if so, stopping the writing operation and giving an alarm prompt in the log.
In an embodiment, the apparatus for limiting speed of a write cache according to an embodiment of the present invention further includes:
and the notification module is used for notifying the operation and maintenance personnel to process the abnormal condition prompted in the log according to the pre-stored contact information of the operation and maintenance personnel.
Since the embodiments of this section correspond to the embodiments of the method section, reference is made to the description of the embodiments of the method section for the embodiments of this section, and details are not repeated here.
The invention provides a speed limiting device for writing in a cache, which comprises: counting the current residual cache space and calculating the current write-back speed; judging whether the current residual cache space is smaller than a preset target cache space or not; if so, determining the current limit speed according to the current write-back speed, the current residual cache space and the preset minimum residual cache space, and writing the cache space according to the current limit speed; wherein the minimum remaining cache space is less than the target cache space; and when the current residual cache space is equal to the minimum residual cache space, determining that the current limiting speed is zero. Therefore, when the current remaining cache space is equal to the minimum remaining cache space, the current limiting speed is zero, that is, the writing operation is stopped, so that the remaining cache space is ensured not to be smaller than the TS1, and the cache space is ensured not to be occupied all the time; and the present invention determines the current limit speed according to the current write-back speed and the current residual cache space, the current limit speed dynamically changes along with the difference between the current write-back speed and the current residual cache space, the cache performance is fully exerted as much as possible by dynamically controlling the write-in speed while the cache space is ensured not to be occupied, and the cache resources are fully utilized.
Fig. 4 is a structural diagram of a speed limiting device for write caching according to an embodiment of the present invention. As shown in fig. 4, a speed limiting device for write cache according to an embodiment of the present invention includes a memory 20 for storing a computer program;
a processor 21, configured to implement the steps of the method for limiting the speed of writing to the cache according to any one of the above embodiments when executing the computer program.
The processor 21 may include one or more processing cores, such as a 4-core processor, an 8-core processor, and the like. The processor 21 may be implemented in at least one hardware form of a DSP (Digital Signal Processing), an FPGA (Field-Programmable Gate Array), and a PLA (Programmable Logic Array). The processor 21 may also include a main processor and a coprocessor, where the main processor is a processor for processing data in an awake state, and is also called a Central Processing Unit (CPU); a coprocessor is a low power processor for processing data in a standby state. In some embodiments, the processor 21 may be integrated with a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content required to be displayed on the display screen. In some embodiments, the processor 21 may further include an AI (Artificial Intelligence) processor for processing a calculation operation related to machine learning.
The memory 20 may include one or more computer-readable storage media, which may be non-transitory. Memory 20 may also include high speed random access memory, as well as non-volatile memory, such as one or more magnetic disk storage devices, flash memory storage devices. In this embodiment, the memory 20 is at least used for storing the following computer program 201, wherein after being loaded and executed by the processor 21, the computer program can implement relevant steps in the speed limiting method for writing to the cache disclosed in any of the foregoing embodiments. In addition, the resources stored in the memory 20 may also include an operating system 202, data 203, and the like, and the storage manner may be a transient storage manner or a permanent storage manner. Operating system 202 may include, among others, Windows, Unix, Linux, and the like.
In some embodiments, the rate-limiting device for writing to the cache may further include an input/output interface 22, a communication interface 23, a power supply 24, and a communication bus 25.
Those skilled in the art will appreciate that the architecture shown in FIG. 4 does not constitute a limitation of the rate limiting device of the write cache and may include more or fewer components than those shown.
Since the embodiments of this section correspond to the embodiments of the method section, reference is made to the description of the embodiments of the method section for the embodiments of this section, and details are not repeated here. In some embodiments of the invention, the processor and memory may be connected by a bus or other means.
The speed limiting device written into the cache provided by the invention can realize the following method: counting the current residual cache space and calculating the current write-back speed; judging whether the current residual cache space is smaller than a preset target cache space or not; if so, determining the current limit speed according to the current write-back speed, the current residual cache space and the preset minimum residual cache space, and writing the cache space according to the current limit speed; wherein the minimum remaining cache space is less than the target cache space; and when the current residual cache space is equal to the minimum residual cache space, determining that the current limiting speed is zero. Therefore, when the current remaining cache space is equal to the minimum remaining cache space, the current limiting speed is zero, that is, the writing operation is stopped, so that the remaining cache space is ensured not to be smaller than the TS1, and the cache space is ensured not to be occupied all the time; and the present invention determines the current limit speed according to the current write-back speed and the current residual cache space, the current limit speed dynamically changes along with the difference between the current write-back speed and the current residual cache space, the cache performance is fully exerted as much as possible by dynamically controlling the write-in speed while the cache space is ensured not to be occupied, and the cache resources are fully utilized.
Finally, the invention also provides a corresponding embodiment of the computer readable storage medium. The computer-readable storage medium has stored thereon a computer program which, when being executed by a processor, carries out the steps as set forth in the above-mentioned method embodiments.
It is to be understood that if the method in the above embodiments is implemented in the form of software functional units and sold or used as a stand-alone product, it can be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and performs all or part of the steps of the methods according to the embodiments of the present invention, or all or part of the technical solution. And the aforementioned storage medium includes: various media capable of storing program codes, such as a usb disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk.
The method, apparatus, device and medium for limiting the write cache according to the present invention are described in detail above. The embodiments are described in a progressive manner in the specification, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments are referred to each other. The device disclosed by the embodiment corresponds to the method disclosed by the embodiment, so that the description is simple, and the relevant points can be referred to the method part for description. It should be noted that, for those skilled in the art, it is possible to make various improvements and modifications to the present invention without departing from the principle of the present invention, and those improvements and modifications also fall within the scope of the claims of the present invention.
It is further noted that, in the present specification, relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, 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.
Claims (10)
1. A method for throttling a write cache, comprising:
counting the current residual cache space and calculating the current write-back speed;
judging whether the current residual cache space is smaller than a preset target cache space or not;
if so, determining the current limit speed according to the current write-back speed, the current residual cache space and a preset minimum residual cache space, and writing the cache space according to the current limit speed; wherein the minimum remaining cache space is less than the target cache space; and when the current residual cache space is equal to the minimum residual cache space, determining that the current limiting speed is zero.
2. The method for limiting speed of write-in cache according to claim 1, wherein the determining a current limit speed to perform a write-in operation on the cache space according to the current limit speed according to the current write-back speed, the current remaining cache space and a preset minimum remaining cache space specifically comprises:
according to XS ═ DS × ((LS-TS1)/TS1), determining the current limiting speed to write the cache space according to the current limiting speed;
wherein XS is a current limit speed, DS is a current write-back speed, LS is a current remaining cache space, and TS1 is a preset minimum remaining cache space.
3. The method for throttling write cache according to claim 1, wherein the calculating the current write-back speed specifically comprises:
calculating the average value of the write-back speed in a preset time period adjacent to the current moment by adopting a weighted moving average line algorithm;
and taking the average value as the current write-back speed.
4. The method for throttling write buffers as claimed in claim 1, further comprising:
and updating the target cache space and the minimum residual cache space according to the received updating information.
5. The method for throttling write buffers as claimed in claim 1, further comprising:
and generating a log for recording the current residual cache space, the current write-back speed and the current limit speed.
6. The method for throttling write buffers as claimed in claim 5, further comprising:
judging whether the current residual cache space is smaller than the minimum residual cache space or not according to the log;
if so, stopping the writing operation and carrying out alarm prompt in the log.
7. The method for throttling write buffers as claimed in claim 6, further comprising:
and informing the operation and maintenance personnel to process the abnormal conditions prompted in the log according to the pre-stored contact information of the operation and maintenance personnel.
8. A device for throttling write buffers, comprising:
the statistical module is used for counting the current residual cache space and calculating the current write-back speed;
the judging module is used for judging whether the current residual cache space is smaller than a preset target cache space or not; if yes, entering a determining module;
the determining module is used for determining the current limiting speed according to the current write-back speed, the current remaining cache space and the preset minimum remaining cache space so as to write the cache space according to the current limiting speed; wherein the minimum remaining cache space is less than the target cache space; and when the current residual cache space is equal to the minimum residual cache space, determining that the current limiting speed is zero.
9. The speed limiting device for writing in the cache is characterized by comprising a memory, a cache and a cache controller, wherein the memory is used for storing a computer program;
a processor for implementing the steps of the method for throttling write buffers according to any of claims 1 to 7 when executing said computer program.
10. A computer-readable storage medium, having stored thereon a computer program which, when being executed by a processor, carries out the steps of the method for throttling write buffers according to any of claims 1 to 7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010125171.2A CN111367471B (en) | 2020-02-27 | 2020-02-27 | Speed limiting method, device, equipment and medium for write-in cache |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010125171.2A CN111367471B (en) | 2020-02-27 | 2020-02-27 | Speed limiting method, device, equipment and medium for write-in cache |
Publications (2)
Publication Number | Publication Date |
---|---|
CN111367471A true CN111367471A (en) | 2020-07-03 |
CN111367471B CN111367471B (en) | 2022-04-01 |
Family
ID=71208249
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202010125171.2A Active CN111367471B (en) | 2020-02-27 | 2020-02-27 | Speed limiting method, device, equipment and medium for write-in cache |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN111367471B (en) |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112732189A (en) * | 2021-01-07 | 2021-04-30 | Oppo广东移动通信有限公司 | Data storage method and device, storage medium and electronic equipment |
CN112748878A (en) * | 2020-12-30 | 2021-05-04 | 华录光存储研究院(大连)有限公司 | Data writing speed determination method and device and computer equipment |
CN118214820A (en) * | 2024-05-20 | 2024-06-18 | 山东云海国创云计算装备产业创新中心有限公司 | Image data processing method, product, equipment and medium |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1859318A (en) * | 2005-12-30 | 2006-11-08 | 华为技术有限公司 | News transmission system and its news buffering device and method |
TW200825708A (en) * | 2006-12-07 | 2008-06-16 | Inventec Corp | Method for pre-warning the insufficiency of storage space of network storage system |
CN108073349A (en) * | 2016-11-08 | 2018-05-25 | 北京国双科技有限公司 | The transmission method and device of data |
CN109857337A (en) * | 2018-12-10 | 2019-06-07 | 浪潮(北京)电子信息产业有限公司 | A kind of writing speed control method, system, device and readable storage medium storing program for executing |
US10452553B1 (en) * | 2017-10-16 | 2019-10-22 | Veritas Technologies Llc | Systems and methods for distributing cache space |
-
2020
- 2020-02-27 CN CN202010125171.2A patent/CN111367471B/en active Active
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1859318A (en) * | 2005-12-30 | 2006-11-08 | 华为技术有限公司 | News transmission system and its news buffering device and method |
TW200825708A (en) * | 2006-12-07 | 2008-06-16 | Inventec Corp | Method for pre-warning the insufficiency of storage space of network storage system |
CN108073349A (en) * | 2016-11-08 | 2018-05-25 | 北京国双科技有限公司 | The transmission method and device of data |
US10452553B1 (en) * | 2017-10-16 | 2019-10-22 | Veritas Technologies Llc | Systems and methods for distributing cache space |
CN109857337A (en) * | 2018-12-10 | 2019-06-07 | 浪潮(北京)电子信息产业有限公司 | A kind of writing speed control method, system, device and readable storage medium storing program for executing |
Cited By (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112748878A (en) * | 2020-12-30 | 2021-05-04 | 华录光存储研究院(大连)有限公司 | Data writing speed determination method and device and computer equipment |
CN112732189A (en) * | 2021-01-07 | 2021-04-30 | Oppo广东移动通信有限公司 | Data storage method and device, storage medium and electronic equipment |
CN112732189B (en) * | 2021-01-07 | 2024-05-10 | Oppo广东移动通信有限公司 | Data storage method and device, storage medium and electronic equipment |
CN118214820A (en) * | 2024-05-20 | 2024-06-18 | 山东云海国创云计算装备产业创新中心有限公司 | Image data processing method, product, equipment and medium |
CN118214820B (en) * | 2024-05-20 | 2024-08-09 | 山东云海国创云计算装备产业创新中心有限公司 | Image data processing method, product, equipment and medium |
Also Published As
Publication number | Publication date |
---|---|
CN111367471B (en) | 2022-04-01 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN111367471B (en) | Speed limiting method, device, equipment and medium for write-in cache | |
US11301029B2 (en) | Method, apparatus, and system for allocating power to graphics processing unit | |
US8402232B2 (en) | Memory utilization tracking | |
US8516462B2 (en) | Method and apparatus for managing a stack | |
CN114443429B (en) | Alarm event processing method and device and computer readable storage medium | |
CN110515917B (en) | Method, device and medium for controlling reconstruction speed | |
CN108572898A (en) | A kind of method, apparatus of control interface, equipment and storage medium | |
CN107544755A (en) | The control method and device of a kind of reading and writing data | |
CN108958891B (en) | Virtual machine memory allocation method, device and terminal | |
CN115576505A (en) | Data storage method, device and equipment and readable storage medium | |
CN109766248A (en) | System failure signal acquiring method, device, server and readable storage medium storing program for executing | |
CN113468617A (en) | Method, equipment and storage medium for power failure protection of equipment | |
CN111124818B (en) | Monitoring method, device and equipment for Expander | |
CN111953569A (en) | State information reporting method, device, equipment and medium | |
CN110795276A (en) | Storage medium repairing method, computer equipment and storage medium | |
CN112905119B (en) | Data write-in control method, device and equipment of distributed storage system | |
CN115543677A (en) | Correctable error processing method, device and equipment and readable storage medium | |
CN106775473A (en) | The awakening method and device of a kind of hard disk | |
CN108897661A (en) | A kind of threshold setting method and relevant apparatus | |
CN115185456A (en) | Cluster capacity shrinkage risk prompting method, device, equipment and medium | |
CN113467703B (en) | Storage medium management method, device and equipment | |
CN111124754A (en) | Data recovery method, device, equipment and medium | |
CN110069330A (en) | A kind of data destruction method based on system load, device and equipment | |
CN116400871B (en) | Defragmentation method, defragmentation device, storage medium and electronic device | |
CN111404741B (en) | Configuration method, configuration device and configuration equipment for data center machine room management network |
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 |