1. 31 Jul, 2018 1 commit
  2. 22 Jul, 2018 1 commit
  3. 16 Jul, 2018 2 commits
    • antirez's avatar
      Hopefully improve commenting of #5126. · f9c84d6d
      antirez authored
      Reading the PR gave me the opportunity to better specify what the code
      was doing in places where I was not immediately sure about what was
      going on. Moreover I documented the structure in server.h so that people
      reading the header file will immediately understand what the structure
      is useful for.
      f9c84d6d
    • Oran Agra's avatar
      slave buffers were wasteful and incorrectly counted causing eviction · bf680b6f
      Oran Agra authored
      A) slave buffers didn't count internal fragmentation and sds unused space,
         this caused them to induce eviction although we didn't mean for it.
      
      B) slave buffers were consuming about twice the memory of what they actually needed.
      - this was mainly due to sdsMakeRoomFor growing to twice as much as needed each time
        but networking.c not storing more than 16k (partially fixed recently in 237a38737).
      - besides it wasn't able to store half of the new string into one buffer and the
        other half into the next (so the above mentioned fix helped mainly for small items).
      - lastly, the sds buffers had up to 30% internal fragmentation that was wasted,
        consumed but not used.
      
      C) inefficient performance due to starting from a small string and reallocing many times.
      
      what i changed:
      - creating dedicated buffers for reply list, counting their size with zmalloc_size
      - when creating a new reply node from, preallocate it to at least 16k.
      - when appending a new reply to the buffer, first fill all the unused space of the
        previous node before starting a new one.
      
      other changes:
      - expose mem_not_counted_for_evict info field for the benefit of the test suite
      - add a test to make sure slave buffers are counted correctly and that they don't cause eviction
      bf680b6f
  4. 09 Jul, 2018 1 commit
  5. 04 Jul, 2018 1 commit
  6. 03 Jul, 2018 2 commits
  7. 02 Jul, 2018 1 commit
  8. 01 Jul, 2018 1 commit
  9. 28 Jun, 2018 1 commit
  10. 27 Jun, 2018 1 commit
  11. 20 Jun, 2018 1 commit
    • Guy Benoish's avatar
      Enhance RESTORE with RDBv9 new features · b5197f1f
      Guy Benoish authored
      RESTORE now supports:
      1. Setting LRU/LFU
      2. Absolute-time TTL
      
      Other related changes:
      1. RDB loading will not override LRU bits when RDB file
         does not contain the LRU opcode.
      2. RDB loading will not set LRU/LFU bits if the server's
         maxmemory-policy does not match.
      b5197f1f
  12. 19 Jun, 2018 1 commit
    • Oran Agra's avatar
      add malloc_usable_size for libc malloc · 482785ac
      Oran Agra authored
      this reduces the extra 8 bytes we save before each pointer.
      but more importantly maybe, it makes the valgrind runs to be more similiar
      to our normal runs.
      
      note: the change in malloc_stats struct in server.h is to eliminate an name conflict.
      structs that are not typedefed are resolved from a separate name space.
      482785ac
  13. 18 Jun, 2018 1 commit
  14. 07 Jun, 2018 2 commits
  15. 11 May, 2018 2 commits
    • antirez's avatar
      ZPOP: change sync ZPOP to have a count argument instead of N keys. · 56bbab23
      antirez authored
      Usually blocking operations make a lot of sense with multiple keys so
      that we can listen to multiple queues (or whatever the app models) with
      a single connection. However in the synchronous case it is more useful
      to be able to ask for N elements. This is a change that I also wanted to
      perform soon or later in the blocking list variant, but here it is more
      natural since there is no reply type difference.
      56bbab23
    • antirez's avatar
      ZPOP: renaming to have explicit MIN/MAX score idea. · 6efb6c1e
      antirez authored
      This commit also adds a top comment about a subtle behavior of mixing
      blocking operations of different types in the same key.
      6efb6c1e
  16. 30 Apr, 2018 1 commit
    • Itamar Haber's avatar
      Adds memory information about the script's cache to INFO · 49890c8e
      Itamar Haber authored
      Implementation notes: as INFO is "already broken", I didn't want to break it further. Instead of computing the server.lua_script dict size on every call, I'm keeping a running sum of the body's length and dict overheads.
      
      This implementation is naive as it **does not** take into consideration dict rehashing, but that inaccuracy pays off in speed ;)
      
      Demo time:
      
      ```bash
      $ redis-cli info memory | grep "script"
      used_memory_scripts:96
      used_memory_scripts_human:96B
      number_of_cached_scripts:0
      $ redis-cli eval "" 0 ; redis-cli info memory | grep "script"
      (nil)
      used_memory_scripts:120
      used_memory_scripts_human:120B
      number_of_cached_scripts:1
      $ redis-cli script flush ; redis-cli info memory | grep "script"
      OK
      used_memory_scripts:96
      used_memory_scripts_human:96B
      number_of_cached_scripts:0
      $ redis-cli eval "return('Hello, Script Cache :)')" 0 ; redis-cli info memory | grep "script"
      "Hello, Script Cache :)"
      used_memory_scripts:152
      used_memory_scripts_human:152B
      number_of_cached_scripts:1
      $ redis-cli eval "return redis.sha1hex(\"return('Hello, Script Cache :)')\")" 0 ; redis-cli info memory | grep "script"
      "1be72729d43da5114929c1260a749073732dc822"
      used_memory_scripts:232
      used_memory_scripts_human:232B
      number_of_cached_scripts:2
       19:03:54 redis [lua_scripts-in-info-memory L ✚…⚑] $ redis-cli evalsha 1be72729d43da5114929c1260a749073732dc822 0
      "Hello, Script Cache :)"
      ```
      49890c8e
  17. 29 Apr, 2018 1 commit
  18. 19 Apr, 2018 1 commit
  19. 18 Apr, 2018 1 commit
  20. 11 Apr, 2018 1 commit
  21. 09 Apr, 2018 1 commit
  22. 05 Apr, 2018 1 commit
  23. 30 Mar, 2018 1 commit
  24. 29 Mar, 2018 1 commit
  25. 25 Mar, 2018 1 commit
    • antirez's avatar
      AOF: enable RDB-preamble rewriting by default. · 28d28ef3
      antirez authored
      There are too many advantages in doing this, RDB is faster to persist,
      more compact, much faster to load back. The main issues here are that
      the code is less tested because this was not the old default (so we are
      enabling it for the new 5.0 release), and that the AOF is no longer a
      trivially parsable format from now on. However the non-preamble mode
      will be supported in the future as well, if new data types will be
      added.
      28d28ef3
  26. 19 Mar, 2018 1 commit
  27. 15 Mar, 2018 7 commits
  28. 14 Mar, 2018 1 commit
    • antirez's avatar
      Cluster: ability to prevent slaves from failing over their masters. · 432bf477
      antirez authored
      This commit, in some parts derived from PR #3041 which is no longer
      possible to merge (because the user deleted the original branch),
      implements the ability of slaves to have a special configuration
      preventing that they try to start a failover when the master is failing.
      
      There are multiple reasons for wanting this, and the feautre was
      requested in issue #3021 time ago.
      
      The differences between this patch and the original PR are the
      following:
      
      1. The flag is saved/loaded on the nodes configuration.
      2. The 'myself' node is now flag-aware, the flag is updated as needed
         when the configuration is changed via CONFIG SET.
      3. The flag name uses NOFAILOVER instead of NO_FAILOVER to be consistent
         with existing NOADDR.
      4. The redis.conf documentation was rewritten.
      
      Thanks to @deep011 for the original patch.
      432bf477
  29. 12 Mar, 2018 2 commits
    • Oran Agra's avatar
      Adding real allocator fragmentation to INFO and MEMORY command + active defrag test · 806736cd
      Oran Agra authored
      other fixes / improvements:
      - LUA script memory isn't taken from zmalloc (taken from libc malloc)
        so it can cause high fragmentation ratio to be displayed (which is false)
      - there was a problem with "fragmentation" info being calculated from
        RSS and used_memory sampled at different times (now sampling them together)
      
      other details:
      - adding a few more allocator info fields to INFO and MEMORY commands
      - improve defrag test to measure defrag latency of big keys
      - increasing the accuracy of the defrag test (by looking at real grag info)
        this way we can use an even lower threshold and still avoid false positives
      - keep the old (total) "fragmentation" field unchanged, but add new ones for spcific things
      - add these the MEMORY DOCTOR command
      - deduct LUA memory from the rss in case of non jemalloc allocator (one for which we don't "allocator active/used")
      - reduce sampling rate of the rss and allocator info
      806736cd
    • Oran Agra's avatar
      active defrag v2 · be1b4aa9
      Oran Agra authored
      - big keys are not defragged in one go from within the dict scan
        instead they are scanned in parts after the main dict hash bucket is done.
      - add latency monitor sample for defrag
      - change default active-defrag-cycle-min to induce lower latency
      - make active defrag start a new scan right away if needed, so it's easier
        (for the test suite) to detect when it's done
      - make active defrag quick the current cycle after each db / big key
      - defrag  some non key long term global allocations
      - some refactoring for smaller functions and more reusable code
      - during dict rehashing, one scan iteration of the dict, can end up scanning
        one bucket in the smaller dict and many many buckets in the larger dict.
        so waiting for 16 scan iterations before checking the time, may be much too long.
      be1b4aa9