1. 19 Jun, 2013 1 commit
    • antirez's avatar
      Fix logStackTrace() when logging to stdout. · 338cd483
      antirez authored
      When the semantics changed from logfile = NULL to logfile = "" to log
      into standard output, no proper change was made to logStackTrace() to
      make it able to work with the new setup.
      
      This commit fixes the issue.
      338cd483
  2. 04 Jun, 2013 1 commit
  3. 28 Mar, 2013 1 commit
  4. 27 Mar, 2013 1 commit
    • antirez's avatar
      DEBUG set-active-expire added. · 32a83c82
      antirez authored
      We need the ability to disable the activeExpireCycle() (active
      expired key collection) call for testing purposes.
      32a83c82
  5. 27 Feb, 2013 1 commit
  6. 13 Feb, 2013 1 commit
  7. 19 Jan, 2013 1 commit
  8. 09 Jan, 2013 1 commit
  9. 14 Dec, 2012 1 commit
    • antirez's avatar
      serverCron() frequency is now a runtime parameter (was REDIS_HZ). · f1481d4a
      antirez authored
      REDIS_HZ is the frequency our serverCron() function is called with.
      A more frequent call to this function results into less latency when the
      server is trying to handle very expansive background operations like
      mass expires of a lot of keys at the same time.
      
      Redis 2.4 used to have an HZ of 10. This was good enough with almost
      every setup, but the incremental key expiration algorithm was working a
      bit better under *extreme* pressure when HZ was set to 100 for Redis
      2.6.
      
      However for most users a latency spike of 30 milliseconds when million
      of keys are expiring at the same time is acceptable, on the other hand a
      default HZ of 100 in Redis 2.6 was causing idle instances to use some
      CPU time compared to Redis 2.4. The CPU usage was in the order of 0.3%
      for an idle instance, however this is a shame as more energy is consumed
      by the server, if not important resources.
      
      This commit introduces HZ as a runtime parameter, that can be queried by
      INFO or CONFIG GET, and can be modified with CONFIG SET. At the same
      time the default frequency is set back to 10.
      
      In this way we default to a sane value of 10, but allows users to
      easily switch to values up to 500 for near real-time applications if
      needed and if they are willing to pay this small CPU usage penalty.
      f1481d4a
  10. 29 Nov, 2012 2 commits
    • antirez's avatar
      Introduced the Build ID in INFO and --version output. · 2f62c966
      antirez authored
      The idea is to be able to identify a build in a unique way, so for
      instance after a bug report we can recognize that the build is the one
      of a popular Linux distribution and perform the debugging in the same
      environment.
      2f62c966
    • antirez's avatar
      On crash memory test rewrote so that it actaully works. · b1b602a9
      antirez authored
      1) We no longer test location by location, otherwise the CPU write cache
      completely makes our business useless.
      2) We still need a memory test that operates in steps from the first to
      the last location in order to never hit the cache, but that is still
      able to retain the memory content.
      
      This was tested using a Linux box containing a bad memory module with a
      zingle bit error (always zero).
      
      So the final solution does has an error propagation step that is:
      
      1) Invert bits at every location.
      2) Swap adiacent locations.
      3) Swap adiacent locations again.
      4) Invert bits at every location.
      5) Swap adiacent locations.
      6) Swap adiacent locations again.
      
      Before and after these steps, and after step 4, a CRC64 checksum is computed.
      If the three CRC64 checksums don't match, a memory error was detected.
      b1b602a9
  11. 28 Nov, 2012 1 commit
  12. 22 Nov, 2012 2 commits
  13. 21 Nov, 2012 1 commit
  14. 08 Nov, 2012 1 commit
  15. 24 Aug, 2012 1 commit
    • antirez's avatar
      Better Out of Memory handling. · 6fdc6354
      antirez authored
      The previous implementation of zmalloc.c was not able to handle out of
      memory in an application-specific way. It just logged an error on
      standard error, and aborted.
      
      The result was that in the case of an actual out of memory in Redis
      where malloc returned NULL (In Linux this actually happens under
      specific overcommit policy settings and/or with no or little swap
      configured) the error was not properly logged in the Redis log.
      
      This commit fixes this problem, fixing issue #509.
      Now the out of memory is properly reported in the Redis log and a stack
      trace is generated.
      
      The approach used is to provide a configurable out of memory handler
      to zmalloc (otherwise the default one logging the event on the
      standard output is used).
      6fdc6354
  16. 11 Jun, 2012 1 commit
    • antirez's avatar
      Dump ziplist hex value on failed assertion. · ee789e15
      antirez authored
      The ziplist -> hashtable conversion code is triggered every time an hash
      value must be promoted to a full hash table because the number or size of
      elements reached the threshold.
      
      If a problem in the ziplist causes the same field to be present
      multiple times, the assertion of successful addition of the element
      inside the hash table will fail, crashing server with a failed
      assertion, but providing little information about the problem.
      
      This code adds a new logging function to perform the hex dump of binary
      data, and makes sure that the ziplist -> hashtable conversion code uses
      this new logging facility to dump the content of the ziplist when the
      assertion fails.
      
      This change was originally made in order to investigate issue #547.
      ee789e15
  17. 13 May, 2012 1 commit
    • antirez's avatar
      Impovements for: Redis timer, hashes rehashing, keys collection. · 61daf891
      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.
      61daf891
  18. 26 Apr, 2012 1 commit
  19. 24 Apr, 2012 1 commit
    • antirez's avatar
      Fix and refactoring of code used to get registers on crash. · a66a4963
      antirez authored
      This fixes compilation on FreeBSD (and possibly other systems) by
      not using ucontext_t at all if HAVE_BACKTRACE is not defined.
      Also the ifdefs to get the registers are modified to explicitly test for the
      operating system in the first level, and the arch in the second level
      of nesting.
      a66a4963
  20. 02 Apr, 2012 1 commit
  21. 28 Mar, 2012 1 commit
  22. 27 Mar, 2012 4 commits
  23. 18 Mar, 2012 1 commit
  24. 21 Feb, 2012 1 commit
  25. 08 Feb, 2012 1 commit
  26. 21 Jan, 2012 1 commit
  27. 20 Jan, 2012 4 commits
  28. 12 Jan, 2012 1 commit
  29. 21 Dec, 2011 2 commits
  30. 20 Dec, 2011 1 commit
  31. 24 Nov, 2011 1 commit