In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-06 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly introduces how to use lazy deletion Lazy free in Redis, which has a certain reference value, interested friends can refer to, I hope you can learn a lot after reading this article, let the editor take you to understand it.
Use laziness to delete Lazy free
When key expires or when the DEL delete command is used, Redis frees up the memory allocated by the object in addition to removing the object from the global hash table. When big key is encountered, freeing memory will cause the main thread to block.
To this end, Redis 4.0 introduces the UNLINK command, which frees the object memory operation into the bio background thread to execute. So as to effectively reduce the blocking of the main thread.
Redis 6. 0 goes a step further by introducing Lazy-free-related configurations. When the configuration is enabled, the "release object" operation is "executed asynchronously" within the key expiration and DEL commands.
Void delCommand (client * c) {delGenericCommand (CPE server.lazyfreeways lazyhands usernames);} void delGenericCommand (client * c, int lazy) {int numdel = 0, j; for (j = 1; j)
< c->Argc; jacks +) {expireIfNeeded (c-> db,c- > argv [j]); / / enable lazy free to delete int deleted = lazy asynchronously? DbAsyncDelete (c-> db,c- > argv [j]): dbSyncDelete (c-> db,c- > argv [j]);...}}
It is recommended that you upgrade to at least Redis 6 and turn on Lazy-free.
Thank you for reading this article carefully. I hope the article "how to use lazy Lazy free in Redis" shared by the editor will be helpful to everyone. At the same time, I also hope that you will support us and pay attention to the industry information channel. More related knowledge is waiting for you to learn!
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.