How does redis expire keys?

后端 未结 3 916
感情败类
感情败类 2020-12-13 08:37

How does Redis implement the expiration of keys? From here I learnt that Redis stores the time at which the key will expire, but how exactly is this implemented?

3条回答
  •  醉酒成梦
    2020-12-13 08:39

    For the Redis 6, from the release notes:

    The expiration cycle has been rewritten in Redis 6.0 to allow for much faster expirations that more closely match the time-to-live (TTL) property. Redis 6 expiration will no longer be based on random sampling but will take keys sorted by expire time in a radix tree

提交回复
热议问题