php - Why is Memcached's flush_all designed to only delete keys but not values?
PHP中文网
PHP中文网 2017-06-12 09:20:27
0
1
593

Not deleting the value means that the value still occupies the memory space, and without the key, the existence of these values ​​cannot be accessed. What is the significance of this?

PHP中文网
PHP中文网

认证0级讲师

reply all(1)
迷茫

You can take a look at this article:

Lazy Expiration

Memcached does not internally monitor whether the record has expired. Instead, it checks the timestamp of the record when getting it to check whether the record has expired. This technique is called lazy expiration. Therefore, memcached does not consume CPU time on expiration monitoring.

flush_all only does one thing: marks all key values ​​as expired, but does not reclaim memory. Because there was no need to reclaim memory at that time. Only when the user accesses the same key value next time, memcached checks the key value. At this time, it is found that the key value has expired, and the memory corresponding to the key value is recycled. The purpose of this is to save CPU time to the maximum extent.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template