1. 14 May, 2012 2 commits
    • antirez's avatar
      Impovements for: Redis timer, hashes rehashing, keys collection. · a8a981a8
      antirez authored
      A previous commit introduced REDIS_HZ define that changes the frequency
      of calls to the serverCron() Redis function. This commit improves
      different related things:
      
      1) Software watchdog: now the minimal period can be set according to
      REDIS_HZ. The minimal period is two times the timer period, that is:
      
          (1000/REDIS_HZ)*2 milliseconds
      
      2) The incremental rehashing is now performed in the expires dictionary
      as well.
      
      3) The activeExpireCycle() function was improved in different ways:
      
      - Now it checks if it already used too much time using microseconds
        instead of milliseconds for better precision.
      - The time limit is now calculated correctly, in the previous version
        the division was performed before of the multiplication resulting in
        a timelimit of 0 if HZ was big enough.
      - Databases with less than 1% of buckets fill in the hash table are
        skipped, because getting random keys is too expensive in this
        condition.
      
      4) tryResizeHashTables() is now called at every timer call, we need to
         match the number of calls we do to the expired keys colleciton cycle.
      
      5) REDIS_HZ was raised to 100.
      a8a981a8
    • antirez's avatar
      Redis timer interrupt frequency configurable as REDIS_HZ. · f7f2b261
      antirez authored
      Redis uses a function called serverCron() that is very similar to the
      timer interrupt of an operating system. This function is used to handle
      a number of asynchronous things, like active expired keys collection,
      clients timeouts, update of statistics, things related to the cluster
      and replication, triggering of BGSAVE and AOF rewrite process, and so
      forth.
      
      In the past the timer was called 1 time per second. At some point it was
      raised to 10 times per second, but it still was fixed and could not be
      changed even at compile time, because different functions called from
      serverCron() assumed a given fixed frequency.
      
      This commmit makes the frequency configurable, so that it is simpler to
      pick a good tradeoff between overhead of this function (that is usually
      very small) and the responsiveness of Redis during a few critical
      circumstances where a lot of work is done inside the timer.
      
      An example of such a critical condition is mass-expire of a lot of keys
      in the same second. Up to a given percentage of CPU time is used to
      perform expired keys collection per expire cylce. Now changing the
      REDIS_HZ macro it is possible to do less work but more times per second
      in order to block the server for less time.
      
      If this patch will work well in our tests it will enter Redis 2.6-final.
      f7f2b261
  2. 12 May, 2012 2 commits
    • antirez's avatar
    • antirez's avatar
      More incremental active expired keys collection process. · 3a401464
      antirez authored
      If a large amonut of keys are all expiring about at the same time, the
      "active" expired keys collection cycle used to block as far as the
      percentage of already expired keys was >= 25% of the total population of
      keys with an expire set.
      
      This could block the server even for many seconds in order to reclaim
      memory ASAP. The new algorithm uses at max a small amount of
      milliseconds per cycle, even if this means reclaiming the memory less
      promptly it also means a more responsive server.
      3a401464
  3. 02 May, 2012 1 commit
  4. 27 Apr, 2012 1 commit
    • antirez's avatar
      Don't use an alternative stack for SIGSEGV & co. · a28ab2a9
      antirez authored
      This commit reverts most of c5757662, in
      order to use back main stack for signal handling.
      
      The main reason is that otherwise it is completely pointless that we do
      a lot of efforts to print the stack trace on crash, and the content of
      the stack and registers as well. Using an alternate stack broken this
      feature completely.
      a28ab2a9
  5. 19 Apr, 2012 1 commit
  6. 18 Apr, 2012 1 commit
  7. 13 Apr, 2012 3 commits
  8. 10 Apr, 2012 2 commits
  9. 08 Apr, 2012 1 commit
  10. 06 Apr, 2012 1 commit
  11. 05 Apr, 2012 1 commit
  12. 04 Apr, 2012 4 commits
  13. 03 Apr, 2012 1 commit
  14. 30 Mar, 2012 1 commit
  15. 28 Mar, 2012 3 commits
  16. 27 Mar, 2012 1 commit
  17. 25 Mar, 2012 1 commit
    • antirez's avatar
      New INFO field aof_delayed_fsync introduced. · 81f32c7b
      antirez authored
      This new field counts all the times Redis is configured with AOF enabled and
      fsync policy 'everysec', but the previous fsync performed by the
      background thread was not able to complete within two seconds, forcing
      Redis to perform a write against the AOF file while the fsync is still
      in progress (likely a blocking operation).
      81f32c7b
  18. 24 Mar, 2012 1 commit
  19. 22 Mar, 2012 3 commits
    • antirez's avatar
      Correctly create shared.oomerr as an sds string. · 3f7ad833
      antirez authored
      3f7ad833
    • antirez's avatar
      DEBUG should not be flagged as w otherwise we can not call DEBUG DIGEST and... · 38bb4522
      antirez authored
      DEBUG should not be flagged as w otherwise we can not call DEBUG DIGEST and other commands against read only slaves.
      38bb4522
    • antirez's avatar
      Support for read-only slaves. Semantical fixes. · 05406168
      antirez authored
      This commit introduces support for read only slaves via redis.conf and CONFIG GET/SET commands. Also various semantical fixes are implemented here:
      
      1) MULTI/EXEC with only read commands now work where the server is into a state where writes (or commands increasing memory usage) are not allowed. Before this patch everything inside a transaction would fail in this conditions.
      
      2) Scripts just calling read-only commands will work against read only
      slaves, when the server is out of memory, or when persistence is into an
      error condition. Before the patch EVAL always failed in this condition.
      05406168
  20. 19 Mar, 2012 1 commit
  21. 18 Mar, 2012 3 commits
  22. 15 Mar, 2012 1 commit
    • antirez's avatar
      Fix for issue #391. · f1eaf572
      antirez authored
      Use a simple protocol between clientsCron() and helper functions to
      understand if the client is still valind and clientsCron() should
      continue processing or if the client was freed and we should continue
      with the next one.
      f1eaf572
  23. 14 Mar, 2012 2 commits
  24. 13 Mar, 2012 1 commit
  25. 10 Mar, 2012 1 commit