CN114116796A - Distributed cache system for preventing cache treading - Google Patents

Distributed cache system for preventing cache treading Download PDF

Info

Publication number
CN114116796A
CN114116796A CN202111287708.6A CN202111287708A CN114116796A CN 114116796 A CN114116796 A CN 114116796A CN 202111287708 A CN202111287708 A CN 202111287708A CN 114116796 A CN114116796 A CN 114116796A
Authority
CN
China
Prior art keywords
cache
key
commitment
distributed
count
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.)
Pending
Application number
CN202111287708.6A
Other languages
Chinese (zh)
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.)
Shanghai Yunxi Technology Co ltd
Original Assignee
Inspur Cloud Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Inspur Cloud Information Technology Co Ltd filed Critical Inspur Cloud Information Technology Co Ltd
Priority to CN202111287708.6A priority Critical patent/CN114116796A/en
Publication of CN114116796A publication Critical patent/CN114116796A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2455Query execution
    • G06F16/24552Database cache 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/08Addressing or allocation; Relocation in hierarchically structured memory systems, e.g. virtual memory systems
    • G06F12/0802Addressing of a memory level in which the access to the desired data or data block requires associative addressing means, e.g. caches
    • G06F12/0806Multiuser, multiprocessor or multiprocessing cache systems
    • G06F12/0808Multiuser, multiprocessor or multiprocessing cache systems with cache invalidating means
    • 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/08Addressing or allocation; Relocation in hierarchically structured memory systems, e.g. virtual memory systems
    • G06F12/0802Addressing of a memory level in which the access to the desired data or data block requires associative addressing means, e.g. caches
    • G06F12/0806Multiuser, multiprocessor or multiprocessing cache systems
    • G06F12/0842Multiuser, multiprocessor or multiprocessing cache systems for multiprocessing or multitasking
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2453Query optimisation
    • G06F16/24532Query optimisation of parallel queries
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1097Protocols in which an application is distributed across nodes in the network for distributed storage of data in networks, e.g. transport arrangements for network file system [NFS], storage area networks [SAN] or network attached storage [NAS]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/22Parsing or analysis of headers

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Databases & Information Systems (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computational Linguistics (AREA)
  • Data Mining & Analysis (AREA)
  • Computer Security & Cryptography (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention discloses a distributed cache system for preventing cache treading, and belongs to the technical field of cloud storage systems. The distributed cache system for preventing cache treading comprises a protocol analyzer, a cache processor, a key counter, a control configuration item, a current limiter and a protocol generator, wherein the protocol analyzer, the cache processor and the protocol generator are components of the distributed cache system, and the key counter, the control configuration item and the current limiter are components for solving the problem of cache treading increase. The distributed cache system for preventing cache treading can effectively avoid the problem of cache treading generated when the cache in the distributed cache system is not stored in advance or fails suddenly, and has good popularization and application values.

Description

Distributed cache system for preventing cache treading
Technical Field
The invention relates to the technical field of cloud storage systems, and particularly provides a distributed cache system for preventing cache treading.
Background
In the field of computers, a cache is a software/hardware component for temporarily storing data so that future requests can be responded to more quickly, and the data stored in the cache can be the result of previous calculations or data in any other storage facility. The distributed cache is an extension of a traditional cache used locally and independently, and can be deployed across multiple servers to extend the capacity and data transmission capability of the cache. The distributed cache is mainly used for temporarily storing application data or session data of the web server. A business scenario for high-concurrency mass-reading requests is widely applied by internet companies in recent years.
Bond: the cache system discussed in the invention is a key value cache, the key is the unique identifier for storing data, the cache client stores or accesses the data in the cache through the key, and the key of each data is different and unique.
The value: the content corresponding to the key in the cache is a copy of the content of the data in the cache.
Hit: data requests are queried from the cache and return the required data, otherwise, a miss.
And (4) timeout: the time for the existence of the cache data reaches the maximum survival time set in the system for allowing the existence of the cache data.
Elimination: meaning that the caching system discards some cached data (overwritten by new data) according to certain policies.
And (3) failure: the data in the cache is eliminated because the preset timeout time is reached or eliminated according to the preset elimination strategy after the storage space of the cache system reaches the upper limit.
Penetration: the phenomenon that data inquired by an inquiry request does not hit a cache and directly inquires a persistence layer instead is pointed out.
Breakdown: refers to the phenomenon that a large number of query requests directly request the database at the moment of cache failure.
Avalanche: the phenomenon that data in a cache fails in a large scale, so that a large number of cache client processes break down the cache, and the database is over-stressed or even down is caused.
Cascading system failure refers to the situation where, in a system having multiple associated components, the failure of one or a portion of the components can recursively cause successive failures of other components. Cache stamping (cachestampede) is a cascading system failure that occurs in large-load concurrent computing systems with caching mechanisms.
Disclosure of Invention
The technical task of the present invention is to provide a buffer treading prevention distributed cache system which can effectively avoid the buffer treading problem generated when the buffer is not stored in advance or fails suddenly in the distributed cache system.
In order to achieve the purpose, the invention provides the following technical scheme:
a distributed cache system for preventing cache treading comprises a protocol parser, a cache processor, a key counter, a control configuration item, a current limiter and a protocol generator, wherein the protocol parser, the cache processor and the protocol generator are components of the distributed cache system, and the key counter, the control configuration item and the current limiter are components for solving the problem of increased cache treading.
Preferably, the protocol analyzer is responsible for receiving and analyzing the request message of the cache client, and obtaining the key value to be stored or the data key to be queried.
Preferably, the cache processor is configured to write or query a key value according to a user request.
Preferably, a key counter is used to count keys requested by the user but not present in the cache.
Preferably, the key counter is responsible for recording, in the event of a cache miss, the number of times of miss requests of the cache key, which is key value data having an integer number, and is used by the current limiter for the current limiting condition determination as a count entry.
The key counter creates a count entry for the cache key when a key first misses, and adds 1 to it, and directly adds 1 to it when this key misses again (if Redis it can be conveniently implemented in one step by invoking the incr command, i.e., incrkeyme _ key _ count1, where keyame is the name of the missed key and _ key _ count is the suffix of the key counter count entry).
After the value of the data key is inquired by the cache client which receives the miss and is written into the cache, if the cache client inquires again and hits, the key counting entry in the key counter is cleared, thereby achieving the purposes of recycling the memory resource and avoiding the unlimited occupation of the memory by the counter area. If no cache client can write the data key value, the key counter clears the key entry according to the maximum request count set in the control configuration item.
Preferably, the control configuration items are divided into cache system configuration items and client configuration items, and the cache system configuration items comprise maximum key count values, peak value request data and maximum database concurrency data; the client configuration items include a commitment limit and a maximum number of commitment retries.
The maximum key-counter-max-count is used for count control of the key counter count entry. For example, when key-counter-max-count is 100, the key counter will automatically clear the count entry for a key on the 101 st miss.
The peak-request-count (peak-request-count) used for calculating the commitment value of the current limiter can be generally estimated by the daily peak user number of the application system.
The maximum concurrency number (max-concurrency) of the database and the single maximum concurrency number which can be borne by the database system can be set, and a numerical value slightly smaller than the real maximum concurrency can be set for ensuring the safe and stable operation of the database system and is also used for calculating the commitment value by the current limiter.
A commit-limit (commit-limit) and a maximum committed-retry (max-commit-retry) for the cache client to calculate how much time to initiate a retry after a certain request is missed by a time hash function, and the maximum committed-retry is used to control the retry. When max-premium-retry is 0, it indicates no retry, and when 3, it indicates that the cache client will initiate 3 retries at most when receiving the premium response, if the required data is not obtained after 3 retries, it is considered that the database is failed, the client that released the miss request before committing cannot successfully refresh the cache, and at this time, the attempt should be abandoned, and the processing is overtime according to the database connection.
Preferably, the current limiter compares the key count with a count threshold set by the configuration, and classifies the non-existent keys according to the comparison result.
Preferably, the flow restrictor is used for flow restriction control, when the cache misses, the flow restrictor compares the count entry missed in the key counter with the commitment threshold in the control configuration item, if the value of the count entry is greater than the commitment threshold, the commitment is calculated and returned, otherwise, the miss is directly returned.
Wherein the commitment value may be determined by the following hash function:
p=H(n) (1)
where n is the count entry value, i.e., the number of miss requests, and h (n) is a hash function of the count entry value, including but not limited to hash functions commonly used in computer science.
Preferably, the protocol generator is configured to encapsulate the return data into a TCP packet according to a specific caching protocol and send the TCP packet to the caching client.
The distributed cache system for preventing cache treading expands a commitment agreement on the basis of the traditional cache system. Taking the RESP protocol as an example, when the cache misses and the current request is determined by the current limiter to need to return a commitment, the protocol message is as follows:
+ premium 7\ r \ n, which indicates that the client receiving this commitment is the 7 th caching client receiving the commitment.
The cache client expands the commitment processing and retry strategy, and after the client receives the commitment protocol, the time length of the retry request waiting is calculated according to the commitment value and the commitment limit in the configuration item, and the formula is as follows:
Tw=Lp-p*tn (2)
wherein T iswThe time that the caching client needs to wait for a retry is expressed in milliseconds (ms), which is referred to as committed latency. L ispAs a commitment limit, the commitment limit is the maximum response time that a client can accept, in milliseconds (ms). p is a commitment value, tnIs the average response time, p x t, of a single data query of the databasenReferred to as the commitment time. When the commitment time is less than the commitment limit, TwPositive number, indicating acceptance of commitment, the cache client will be at TwRetrying the request to inquire the cache after time; when the commitment time is greater than the commitment limit, TwA negative number indicates that the commitment is not acceptable, the cache client will give up retries, and no longer request the database, and directly throw out the timeout exception (the timeout may be processed according to the database connection, or a null value or a default value may be directly returned to the requested data). Client can be profitableThe method is realized in the form of lib dependent class library of applications such as C/C + + and Java.
Distributed cache system to prevent cache stepping, query scenario at cache hit (i.e. key present and not invalid): the protocol analyzer analyzes the request message of the cache client to obtain a request key, the cache processor queries to obtain data, and the data is packaged by the protocol generator to return a response to the cache client.
Query scenario on cache miss (key not present) or invalidation (key expired or deselected): the protocol analyzer analyzes the request message of the cache client to obtain a request key, the cache processor inquires the miss cache and stores the request key into a counter, and the current limiter compares the request times in the counter with a set miss time threshold in the extended configuration: if the request times are less than the threshold value, directly returning the miss to the protocol generator, if the request times are more than the threshold value, returning a commitment protocol to the protocol generator, and after encapsulating the TCP message, returning a response to the cache client-side by the protocol generator.
When a plurality of cache clients request data from the system at the same time, if the data key value does not exist, only a few (less than the threshold value set by the extended configuration) cache clients receive missed return messages, other cache clients recover a commitment protocol, the cache clients receiving the commitment protocol calculate a retry time through a time hash function according to the commitment value, and the time and the times of requesting retry inquiry cache are controlled by combining a request retry strategy set by the cache clients, so that active current limiting under a huge concurrency scene is realized, and the occurrence of cache trampling is effectively avoided.
Compared with the prior art, the distributed cache system for preventing cache treading has the following outstanding beneficial effects: the distributed cache system for preventing cache treading expands a commitment protocol between the cache system and the cache client, and utilizes the time hash function to carry out time hash and retry on a large amount of requests in a short time, so that the problem of cache treading generated when the cache in the distributed cache system is not prestored or suddenly fails can be effectively avoided, and the distributed cache system has good popularization and application values.
Drawings
FIG. 1 is a key counter operating schematic diagram of a distributed cache system for cache tread prevention according to the present invention;
FIG. 2 is a schematic diagram of the flow restrictor activity of the cache tread prevention distributed cache system of the present invention;
fig. 3 is a schematic diagram of the activities of the client of the distributed cache system for preventing cache treading according to the present invention.
Detailed Description
The distributed cache system for preventing cache treading according to the present invention will be described in further detail with reference to the accompanying drawings and embodiments.
Examples
As shown in fig. 1, the distributed cache system for preventing cache treading of the present invention includes a protocol parser, a cache processor, a key counter, a control configuration item, a current limiter and a protocol generator, wherein the protocol parser, the cache processor and the protocol generator are components of the distributed cache system, and the key counter, the control configuration item and the current limiter are components for solving the problem of cache treading increase.
The protocol analyzer is responsible for receiving and analyzing the request message of the cache client and obtaining the key value to be stored or the data key to be inquired.
Writing a scene: the protocol analyzer analyzes the request message of the cache client to obtain a request key and a value, the cache processor stores the key value into the memory and sends a success signal to the protocol generator, and the protocol generator packages the success signal into a TCP message and then returns a response to the cache client.
As shown in fig. 1, the cache processor is configured to write or query a key value according to a user request. The key counter is used to count keys requested by the user but not present in the cache. The key counter is responsible for recording the number of times of miss requests of the cache key when the cache misses, the number of times is key value data with integer numbers, and the number of times is a counting entry and is used for current limiting condition judgment by the current limiter.
The key counter creates a count entry for the cache key when a key first misses, and adds 1 to it, and directly adds 1 to it when this key misses again (if Redis it can be conveniently implemented in one step by invoking the incr command, i.e., incrkeyme _ key _ count1, where keyame is the name of the missed key and _ key _ count is the suffix of the key counter count entry).
After the value of the data key is inquired by the cache client which receives the miss and is written into the cache, if the cache client inquires again and hits, the key counting entry in the key counter is cleared, thereby achieving the purposes of recycling the memory resource and avoiding the unlimited occupation of the memory by the counter area. If no cache client can write the data key value, the key counter clears the key entry according to the maximum request count set in the control configuration item.
The control configuration items are divided into cache system configuration items and client configuration items, and the cache system configuration items comprise maximum key count values, peak value request numbers and maximum database concurrency numbers; the client configuration items include a commitment limit and a maximum number of commitment retries.
The maximum key-counter-max-count is used for count control of the key counter count entry. For example, when key-counter-max-count is 100, the key counter will automatically clear the count entry for a key on the 101 st miss.
The peak-request-count (peak-request-count) used for calculating the commitment value of the current limiter can be generally estimated by the daily peak user number of the application system.
The maximum concurrency number (max-concurrency) of the database and the single maximum concurrency number which can be borne by the database system can be set, and a numerical value slightly smaller than the real maximum concurrency can be set for ensuring the safe and stable operation of the database system and is also used for calculating the commitment value by the current limiter.
A commit-limit (commit-limit) and a maximum committed-retry (max-commit-retry) for the cache client to calculate how much time to initiate a retry after a certain request is missed by a time hash function, and the maximum committed-retry is used to control the retry. When max-premium-retry is 0, it indicates no retry, and when 3, it indicates that the cache client will initiate 3 retries at most when receiving the premium response, if the required data is not obtained after 3 retries, it is considered that the database is failed, the client that released the miss request before committing cannot successfully refresh the cache, and at this time, the attempt should be abandoned, and the processing is overtime according to the database connection.
As shown in fig. 2, the current limiter compares the key count with a count threshold set by the configuration, and classifies the non-existent keys according to the comparison result. The flow restrictor is used for flow restriction control, when the cache misses, the flow restrictor compares the count entry which misses in the key counter with the commitment threshold value in the control configuration item, if the value of the count entry is larger than the commitment threshold value, the commitment is calculated and returned, otherwise, the commitment is directly returned.
Wherein the commitment value may be determined by the following hash function:
p=H(n) (1)
where n is the count entry value, i.e., the number of miss requests, and h (n) is a hash function of the count entry value, including but not limited to hash functions commonly used in computer science.
Taking the Facebook case as an example, there are currently over 24.5 billion active users per month around the globe of Facebook. But a general global application is to use a multi-region deployment, each region is burdened with a part of the load, taking the U.S. with the most users as an example, the U.S. currently has a population of over 3.2 billion, and 70% of them are Facebook users, i.e. around 2 billion. Temporarily, assuming that Facebook has 20 regions in the whole U.S., about 2000 million active users per month in a single region are estimated online according to 10% of users at the same time, the instantaneous concurrency of the single region is 200 million, a single-node MySQL database can generally bear 1000 concurrences at the maximum, the bearing capacity can be increased to about 5 times at most after a read-write separation or clustering technology is used, namely 5000 concurrences are carried out, the instantaneous request is 400 times of the bearing capacity of the database, namely 400 concurrent requests are needed to complete all queries, the problem is converted into the use of a hash function, the frequency of 200 million concurrent database query requests is reduced to 50ms once, and 400 concurrent requests are needed in total.
Assuming that the average query time of a single data query by index is 50 milliseconds (ms), 20000 milliseconds (ms) are needed in 400 rounds, i.e. a total of 50ms x 400 ms 20000ms is needed for 200 ten thousand requests, and assuming that the user-acceptable limit response time is 5 seconds(s), i.e. 5000ms, is equivalent to only meeting 100 rounds of retries, and the remaining 300 rounds of retries need to be blown.
Ideally, the transmission delay of the network inside the cluster is negligible, and the influence of refreshing the count entry value when the key counter reaches the limit value is not considered, the hash function h (p) can be determined simply by using the following formula:
Figure BDA0003333515260000071
where N is the value of the count entry, i.e., the current number of requests that miss the cache, NsTo assume a single extreme concurrency load capability of a database cluster at cache breakthrough, 5000 in this example,
Figure BDA0003333515260000072
in order to perform the rounding-down operation,
Figure BDA0003333515260000073
indicating a database concurrent batch to which a miss request corresponds. For example, when n is 1 to 4999,
Figure BDA0003333515260000074
the value is 0, and the formula (3) shows that the commitment value of the 1 st to 4999 th miss requests is 0, namely, the current limiter returns a miss to the 1 st to 4999 th requests, allows the requests to directly access the database query data and updates the cache; and requests with n of 5000-9999 will retry to request cache in the same batch.
Considering now that the key counter in the cache performs a clear operation, i.e., a recount, when the maximum key count value is reached, the maximum key count value k is introduced in equation (3), and the total number of requests N (500, 000 in this example), when k < N,
Figure BDA0003333515260000075
a counter indicating how many groups the key counter refresh will divide the requests into, i.e. how many requests correspond toThe number entry values are the same, e.g. k is 5000,
Figure BDA0003333515260000076
is 100, indicating that every 100 requests in 500,000 requests have the same count entry value, then
Figure BDA0003333515260000077
Representing how many sets of same count entry value requests can be processed one database concurrently, equation (3) can be evolved to equation (4):
Figure BDA0003333515260000078
according to the nature of the formula, the formula (5) can be arranged:
Figure BDA0003333515260000079
when k ≧ N, H (N) degenerates to equation (3), i.e., H (N) is a piecewise function of the maximum key-count value k:
Figure BDA00033335152600000710
the daily activity peak concurrency number N in the formula (6) and the maximum concurrency number N supported by the database system oncesNamely, 4.3 nodes control configuration item the peak-request-count and the database maximum concurrency (max-concurrency).
Meanwhile, the maximum key count value k of the key counter is reasonably set, so that multi-batch miss response can be triggered, the client can be ensured to try to read the database for multiple times, and the data needing to be inquired is refreshed into the cache.
The protocol generator is used for packaging the return data into a TCP message according to a specific cache protocol and sending the TCP message to the cache client. The distributed cache system for preventing cache treading expands a commitment agreement on the basis of the traditional cache system. Taking the RESP protocol as an example, when the cache misses and the current request is determined by the current limiter to need to return a commitment, the protocol message is as follows:
+ premium 7\ r \ n, which indicates that the client receiving this commitment is the 7 th caching client receiving the commitment.
The cache client expands the commitment processing and retry strategy, and after the client receives the commitment protocol, the time length of the retry request waiting is calculated according to the commitment value and the commitment limit in the configuration item, and the formula is as follows:
Tw=Lp-p*tn (2)
wherein T iswThe time that the caching client needs to wait for a retry is expressed in milliseconds (ms), which is referred to as committed latency. L ispAs a commitment limit, the commitment limit is the maximum response time that a client can accept, in milliseconds (ms). p is a commitment value, tnIs the average response time, p x t, of a single data query of the databasenReferred to as the commitment time. When the commitment time is less than the commitment limit, TwPositive number, indicating acceptance of commitment, the cache client will be at TwRetrying the request to inquire the cache after time; when the commitment time is greater than the commitment limit, TwA negative number, indicating that the commitment is not acceptable, the caching client will give up retries and no longer request the database, and directly throw the timeout exception (which may be handled as a timeout for the database connection, or may return a null value or default value directly for the requested data), as shown in fig. 3. The client can be realized in the form of lib dependent class library of applications such as C/C + + and Java.
Distributed cache system to prevent cache stepping, query scenario at cache hit (i.e. key present and not invalid): the protocol analyzer analyzes the request message of the cache client to obtain a request key, the cache processor queries to obtain data, and the data is packaged by the protocol generator to return a response to the cache client.
Query scenario on cache miss (key not present) or invalidation (key expired or deselected): the protocol analyzer analyzes the request message of the cache client to obtain a request key, the cache processor inquires the miss cache and stores the request key into a counter, and the current limiter compares the request times in the counter with a set miss time threshold in the extended configuration: if the request times are less than the threshold value, directly returning the miss to the protocol generator, if the request times are more than the threshold value, returning a commitment protocol to the protocol generator, and after encapsulating the TCP message, returning a response to the cache client-side by the protocol generator.
When a plurality of cache clients request data from the system at the same time, if the data key value does not exist, only a few (less than the threshold value set by the extended configuration) cache clients receive missed return messages, other cache clients recover a commitment protocol, the cache clients receiving the commitment protocol calculate a retry time through a time hash function according to the commitment value, and the time and the times of requesting retry inquiry cache are controlled by combining a request retry strategy set by the cache clients, so that active current limiting under a huge concurrency scene is realized, and the occurrence of cache trampling is effectively avoided.
The above-described embodiments are merely preferred embodiments of the present invention, and general changes and substitutions by those skilled in the art within the technical scope of the present invention are included in the protection scope of the present invention.

Claims (9)

1. A distributed cache system for preventing cache treading is characterized in that: the distributed cache system comprises a protocol analyzer, a cache processor, a key counter, a control configuration item, a current limiter and a protocol generator, wherein the protocol analyzer, the cache processor and the protocol generator are components of the distributed cache system, and the key counter, the control configuration item and the current limiter are components for solving the problem of buffer stepping increase.
2. The cache tread preventive distributed cache system of claim 1, wherein: the protocol analyzer is responsible for receiving and analyzing the request message of the cache client and obtaining the key value to be stored or the data key to be inquired.
3. The cache tread preventive distributed cache system of claim 2, wherein: the cache processor is used for writing or inquiring key values according to user requests.
4. The cache tread preventive distributed cache system of claim 3, wherein: the key counter is used to count keys requested by the user but not present in the cache.
5. The cache tread preventive distributed cache system of claim 4, wherein: the key counter is responsible for recording the number of times of miss requests of the cache key when the cache misses, the number of times is key value data with integer numbers, and the number of times is a counting entry and is used for current limiting condition judgment by the current limiter.
6. The cache tread preventive distributed cache system of claim 5, wherein: the control configuration items are divided into cache system configuration items and client configuration items, and the cache system configuration items comprise maximum key count values, peak value request numbers and maximum database concurrency numbers; the client configuration items include a commitment limit and a maximum number of commitment retries.
7. The cache tread preventive distributed cache system of claim 6, wherein: the current limiter compares the key count with a count threshold set by configuration, and classifies the non-existing keys according to the comparison result.
8. The cache tread preventive distributed cache system of claim 7, wherein: the flow restrictor is used for flow restriction control, when the cache misses, the flow restrictor compares the count entry which misses in the key counter with the commitment threshold value in the control configuration item, if the value of the count entry is larger than the commitment threshold value, the commitment is calculated and returned, otherwise, the commitment is directly returned.
9. The cache tread preventive distributed cache system of claim 8, wherein: the protocol generator is used for packaging the return data into a TCP message according to a specific cache protocol and sending the TCP message to the cache client.
CN202111287708.6A 2021-11-02 2021-11-02 Distributed cache system for preventing cache treading Pending CN114116796A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111287708.6A CN114116796A (en) 2021-11-02 2021-11-02 Distributed cache system for preventing cache treading

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111287708.6A CN114116796A (en) 2021-11-02 2021-11-02 Distributed cache system for preventing cache treading

Publications (1)

Publication Number Publication Date
CN114116796A true CN114116796A (en) 2022-03-01

Family

ID=80380295

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111287708.6A Pending CN114116796A (en) 2021-11-02 2021-11-02 Distributed cache system for preventing cache treading

Country Status (1)

Country Link
CN (1) CN114116796A (en)

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090157972A1 (en) * 2007-12-18 2009-06-18 Marcy Evelyn Byers Hash Optimization System and Method
CN106815287A (en) * 2016-12-06 2017-06-09 中国银联股份有限公司 A kind of buffer memory management method and device
CN107124466A (en) * 2017-05-23 2017-09-01 努比亚技术有限公司 One kind prevents caching penetrating method and device, computer-readable recording medium
CN109729108A (en) * 2017-10-27 2019-05-07 阿里巴巴集团控股有限公司 A kind of method, associated server and system for preventing caching from puncturing
CN110109956A (en) * 2019-03-21 2019-08-09 福建天泉教育科技有限公司 A kind of method and terminal for preventing caching from penetrating
US10657064B1 (en) * 2019-01-31 2020-05-19 Salesforce.com. inc. Extending usages of cached data objects beyond cache expiration periods
CN111339148A (en) * 2020-03-13 2020-06-26 深圳前海环融联易信息科技服务有限公司 Method and device for preventing cache breakdown service, computer equipment and storage medium
CN111813792A (en) * 2020-06-22 2020-10-23 上海悦易网络信息技术有限公司 Method and equipment for updating cache data in distributed cache system

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090157972A1 (en) * 2007-12-18 2009-06-18 Marcy Evelyn Byers Hash Optimization System and Method
CN106815287A (en) * 2016-12-06 2017-06-09 中国银联股份有限公司 A kind of buffer memory management method and device
CN107124466A (en) * 2017-05-23 2017-09-01 努比亚技术有限公司 One kind prevents caching penetrating method and device, computer-readable recording medium
CN109729108A (en) * 2017-10-27 2019-05-07 阿里巴巴集团控股有限公司 A kind of method, associated server and system for preventing caching from puncturing
US10657064B1 (en) * 2019-01-31 2020-05-19 Salesforce.com. inc. Extending usages of cached data objects beyond cache expiration periods
CN110109956A (en) * 2019-03-21 2019-08-09 福建天泉教育科技有限公司 A kind of method and terminal for preventing caching from penetrating
CN111339148A (en) * 2020-03-13 2020-06-26 深圳前海环融联易信息科技服务有限公司 Method and device for preventing cache breakdown service, computer equipment and storage medium
CN111813792A (en) * 2020-06-22 2020-10-23 上海悦易网络信息技术有限公司 Method and equipment for updating cache data in distributed cache system

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
ANDREA VATTANI等: "Optimal Probabilistic Cache Stampede Prevention", PROCEEDINGS OF THE VLDB ENDOWMENT, 30 December 2014 (2014-12-30) *
肖剑伟;: "高并发缓存机制的改进", 数码世界, no. 04, 20 April 2019 (2019-04-20) *

Similar Documents

Publication Publication Date Title
US7979509B1 (en) Clustered network acceleration devices having shared cache
US8280976B1 (en) Distributed adaptive network memory engine
US7676554B1 (en) Network acceleration device having persistent in-memory cache
US7840618B2 (en) Wide area networked file system
US7603483B2 (en) Method and system for class-based management of dynamic content in a networked environment
US8639742B2 (en) Refreshing cached documents and storing differential document content
US8239354B2 (en) System and method for managing small-size files in an aggregated file system
US8078574B1 (en) Network acceleration device cache supporting multiple historical versions of content
US9965515B2 (en) Method and device for cache management
CN107451853B (en) Method, device and system for real-time red packet distribution and storage medium
Yin et al. Engineering server-driven consistency for large scale dynamic web services
CN112084258A (en) Data synchronization method and device
US20190268442A1 (en) Systems and methods of rate limiting for a representational state transfer (rest) application programming interface (api)
CN107222567A (en) Method, device and the service cluster of processing data request
US10447623B2 (en) Data storage systems and methods using a real-time messaging system
US20130060810A1 (en) Smart database caching
CN112995046B (en) Content distribution network traffic management method and device
US9928174B1 (en) Consistent caching
US20010049727A1 (en) Method for effficient and scalable interaction in a client-server system in presence of bursty client requests
Vakali LRU-based algorithms for Web cache replacement
CN114116796A (en) Distributed cache system for preventing cache treading
EP1648138A1 (en) Method and system for caching directory services
Datta et al. Accelerating dynamic web content generation
CN114157482A (en) Service access control method, device, control equipment and storage medium
Kumar et al. Consistency-Latency Trade-Off of the LibRe Protocol: A Detailed Study

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
TA01 Transfer of patent application right
TA01 Transfer of patent application right

Effective date of registration: 20221216

Address after: Room 305-22, Building 2, No. 1158 Zhangdong Road and No. 1059 Dangui Road, China (Shanghai) Pilot Free Trade Zone, Pudong New Area, Shanghai, 200120

Applicant after: Shanghai Yunxi Technology Co.,Ltd.

Address before: 250100 No. 1036 Tidal Road, Jinan High-tech Zone, Shandong Province, S01 Building, Tidal Science Park

Applicant before: Inspur cloud Information Technology Co.,Ltd.