• Z
    LFU: do some changes about LFU to find hotkeys · 583c3147
    zhaozhao.zz 提交于
    Firstly, use access time to replace the decreas time of LFU.
    For function LFUDecrAndReturn,
    it should only try to get decremented counter,
    not update LFU fields, we will update it in an explicit way.
    And we will times halve the counter according to the times of
    elapsed time than server.lfu_decay_time.
    Everytime a key is accessed, we should update the LFU
    including update access time, and increment the counter after
    call function LFUDecrAndReturn.
    If a key is overwritten, the LFU should be also updated.
    Then we can use `OBJECT freq` command to get a key's frequence,
    and LFUDecrAndReturn should be called in `OBJECT freq` command
    in case of the key has not been accessed for a long time,
    because we update the access time only when the key is read or
    overwritten.
    583c3147
server.h 88.8 KB