1. 10 Jan, 2018 1 commit
  2. 28 Nov, 2017 1 commit
  3. 27 Nov, 2017 2 commits
    • zhaozhao.zz's avatar
      LFU: do some changes about LFU to find hotkeys · 583c3147
      zhaozhao.zz authored
      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
    • zhaozhao.zz's avatar
      LFU: change lfu* parameters to int · 53cea972
      zhaozhao.zz authored
      53cea972
  4. 23 Jun, 2017 1 commit
    • antirez's avatar
      Issue #4027: unify comment and modify return value in freeMemoryIfNeeded(). · c9097393
      antirez authored
      It looks safer to return C_OK from freeMemoryIfNeeded() when clients are
      paused because returning C_ERR may prevent success of writes. It is
      possible that there is no difference in practice since clients cannot
      execute writes while clients are paused, but it looks more correct this
      way, at least conceptually.
      
      Related to PR #4028.
      c9097393
  5. 01 Jun, 2017 1 commit
  6. 09 May, 2017 1 commit
  7. 21 Feb, 2017 1 commit
    • antirez's avatar
      freeMemoryIfNeeded(): improve code and lazyfree handling. · cd90389b
      antirez authored
      1. Refactor memory overhead computation into a function.
      2. Every 10 keys evicted, check if memory usage already reached
         the target value directly, since we otherwise don't count all
         the memory reclaimed by the background thread right now.
      cd90389b
  8. 20 Jul, 2016 2 commits
  9. 18 Jul, 2016 3 commits
  10. 15 Jul, 2016 1 commit
  11. 13 Jul, 2016 1 commit
    • antirez's avatar
      LRU: Make cross-database choices for eviction. · e423f76e
      antirez authored
      The LRU eviction code used to make local choices: for each DB visited it
      selected the best key to evict. This was repeated for each DB. However
      this means that there could be DBs with very frequently accessed keys
      that are targeted by the LRU algorithm while there were other DBs with
      many better candidates to expire.
      
      This commit attempts to fix this problem for the LRU policy. However the
      TTL policy is still not fixed by this commit. The TTL policy will be
      fixed in a successive commit.
      
      This is an initial (partial because of TTL policy) fix for issue #2647.
      e423f76e
  12. 12 Jul, 2016 3 commits
  13. 11 Jul, 2016 1 commit
    • antirez's avatar
      Remove useless memmove() from freeMemoryIfNeeded(). · 382991f8
      antirez authored
      We start from the end of the pool to the initial item, zero-ing
      every entry we use or every ghost entry, there is nothing to memmove
      since to the right everything should be already set to NULL.
      382991f8
  14. 06 Jul, 2016 1 commit