What should I do if I want to regularly expire the expiration key of redis?

Alibaba cloud Q & A 2022-02-13 08:24:48 阅读数:98

want regularly expire expiration key

If you want to Redis The expiration key is used for timed expiration processing , What to do ?




Take the answer 1:

Each set expiration time of key All need to create a timer , It will be cleared immediately after the expiration time . This strategy can immediately clear expired data , It's very memory friendly ; But it will take up a lot of CPU Resources to process overdue data , This affects the response time and throughput of the cache .


copyright:author[Alibaba cloud Q & A],Please bring the original link to reprint, thank you. https://en.javamana.com/2022/02/202202130824464523.html