In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-31 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
Redis caches knowledge points:
First, cache penetration
Cache traversal refers to querying data that is not available in a cache or database. Because most cache strategies are loaded passively, and for the sake of fault tolerance, if the data cannot be found from the storage layer, the cache is not written. This will cause this non-existent data to query to the storage layer every time, losing the meaning of the cache. Users continue to make requests, when the traffic is large, it may form great pressure on DB, and it is also a big problem to use non-existing key to frequently attack applications.
Second, cache breakdown
Cache breakdown refers to a hot Key in the cache (such as a second kill product). When it expires at a certain point in time, there is a sharp increase in traffic at this point in time, and there are a large number of concurrent requests for this Key. Requests find that cache expiration will generally load data from the backend DB and set it back to the cache, but during this period of time when the data in the cache has not been fully loaded from the DB. Concurrency instantly causes a large number of requests to break down directly to the DB, creating great pressure on the DB.
Cache breakdown, also known as hot key problem, is the most classic of these three problems.
III. Cache avalanche
Cache avalanche means that a large number of data with the same expiration time are set in the cache to expire at the same time. At this moment, the number of visits increases sharply, and the cache is close to invalidation. All requests turn to DB,DB instantaneous pressure avalanche, or even downmachine. The difference between cache breakdown and cache breakdown is that cache breakdown refers to and check the same data, cache avalanche is that different data are expired, a lot of data can not be found in order to check the database.
For redis cache, we often use it in our program. Sometimes we change some functions. If we want to check the effect, we have to clear the original cache. Aiming at how to clean the cache in redis, the editor below will introduce two methods to you.
I'm not going to say much about the various configurations of redis. Let's run redis to see if it works.
When we clear the cache, we'd better turn off redis, open the installation path of redis, and find redis-cli.exe.
Double-click redis-cli.exe, pop up the dialog box of redis-cli, enter host and password
Execute the dbsize command in the dialog box above
Then execute the flushall command.
Actually, there is a more direct way to find the installation directory.
In fact, the cache of redis is mainly stored in the dump.rdb file. We just need to delete the file and restart it as needed.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.