How does Redis primary key invalidation mechanism ensure Expire 0-1 millisecond error?
PHPz
PHPz 2017-05-31 10:31:26
0
1
1317

I have read many articles introducing the primary key failure mechanism, mainly by configuring the failure elimination strategy (LRU/TTL/RADMON for volatile and global keys) and failure strategy (negative method and positive method).

I have a question. When the official introduced the expire method of key (you can click here), it said that the delay of 0-1 millisecond can be achieved after version 2.6.
But when the invalidation policy is the most efficient (configuration: volatile-ttl), when all invalid keys are placed in the dict to handle timeout destruction, the execution of the invalidation policy is once every 1/10 second (100 milliseconds) , how can we achieve the official 0-1 millisecond? Did I understand it wrong somewhere?

Introduction to the failure mechanism:

  1. http://blog.nosqlfan.com/html...

  2. https://yq.aliyun.com/article...

Introduction expire:

  1. http://redis.cn/commands/expi...

PHPz
PHPz

学习是最好的投资!

reply all(1)
刘奇

It’s very simple, “expire”! = “delete”.

I estimate that the improvement in expiration accuracy is mainly due to the introduction of the pexpire command. The previously recorded ttl should only have second-level accuracy, so the expiration accuracy is the same.

Redis definitely has no way to guarantee that all expired keys will be deleted within 1ms, but it can guarantee that you will not seekeys that have expired for more than 1ms.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!