1. 08 8月, 2013 2 次提交
    • A
      redis-benchmark: changes to random arguments substitution. · 689829f2
      antirez 提交于
      Before this commit redis-benchmark supported random argumetns in the
      form of :rand:000000000000. In every string of that form, the zeros were
      replaced with a random number of 12 digits at every command invocation.
      
      However this was far from perfect as did not allowed to generate simply
      random numbers as arguments, there was always the :rand: prefix.
      
      Now instead every argument in the form __rand_int__ is replaced with a
      12 digits number. Note that "__rand_int__" is 12 characters itself.
      
      In order to implement the new semantic, it was needed to change a few
      thigns in the internals of redis-benchmark, as new clients are created
      cloning old clients, so without a stable prefix such as ":rand:" the old
      way of cloning the client was no longer able to understand, from the old
      command line, what was the position of the random strings to substitute.
      
      Now instead a client structure is passed as a reference for cloning, so
      that we can directly clone the offsets inside the command line.
      689829f2
    • A
      redis-benchmark: replace snprintf()+memcpy with faster code. · 4fe67cc1
      antirez 提交于
      This change was profiler-driven, but the actual effect is hard to
      measure in real-world redis benchmark runs.
      4fe67cc1
  2. 07 8月, 2013 5 次提交
  3. 06 8月, 2013 6 次提交
    • A
      Add per-db average TTL information in INFO output. · fa48b1fa
      antirez 提交于
      Example:
      
      db0:keys=221913,expires=221913,avg_ttl=655
      
      The algorithm uses a running average with only two samples (current and
      previous). Keys found to be expired are considered at TTL zero even if
      the actual TTL can be negative.
      
      The TTL is reported in milliseconds.
      fa48b1fa
    • A
      activeExpireCycle(): fix about fast cycle early start. · 31d0f341
      antirez 提交于
      We don't want to repeat a fast cycle too soon, the previous code was
      broken, we need to wait two times the period *since* the start of the
      previous cycle in order to avoid there is an even space between cycles:
      
      .-> start                   .-> second start
      |                           |
      +-------------+-------------+--------------+
      | first cycle |    pause    | second cycle |
      +-------------+-------------+--------------+
      
      The second and first start must be PERIOD*2 useconds apart hence the *2
      in the new code.
      31d0f341
    • A
      Some activeExpireCycle() refactoring. · 00c8cfef
      antirez 提交于
      00c8cfef
    • A
      Remove dead code and fix comments for new expire code. · 8686a703
      antirez 提交于
      8686a703
    • A
      Darft #2 for key collection algo: more improvements. · d54e373b
      antirez 提交于
      This commit makes the fast collection cycle time configurable, at
      the same time it does not allow to run a new fast collection cycle
      for the same amount of time as the max duration of the fast
      collection cycle.
      d54e373b
    • A
      Draft #1 of a new expired keys collection algorithm. · 500155b9
      antirez 提交于
      The main idea here is that when we are no longer to expire keys at the
      rate the are created, we can't block more in the normal expire cycle as
      this would result in too big latency spikes.
      
      For this reason the commit introduces a "fast" expire cycle that does
      not run for more than 1 millisecond but is called in the beforeSleep()
      hook of the event loop, so much more often, and with a frequency bound
      to the frequency of executed commnads.
      
      The fast expire cycle is only called when the standard expiration
      algorithm runs out of time, that is, consumed more than
      REDIS_EXPIRELOOKUPS_TIME_PERC of CPU in a given cycle without being able
      to take the number of already expired keys that are yet not collected
      to a number smaller than 25% of the number of keys.
      
      You can test this commit with different loads, but a simple way is to
      use the following:
      
      Extreme load with pipelining:
      
      redis-benchmark -r 100000000 -n 100000000  \
              -P 32 set ele:rand:000000000000 foo ex 2
      
      Remove the -P32 in order to avoid the pipelining for a more real-world
      load.
      
      In another terminal tab you can monitor the Redis behavior with:
      
      redis-cli -i 0.1 -r -1 info keyspace
      
      and
      
      redis-cli --latency-history
      
      Note: this commit will make Redis printing a lot of debug messages, it
      is not a good idea to use it in production.
      500155b9
  4. 31 7月, 2013 1 次提交
  5. 29 7月, 2013 1 次提交
  6. 28 7月, 2013 2 次提交
  7. 25 7月, 2013 2 次提交
  8. 24 7月, 2013 2 次提交
  9. 23 7月, 2013 1 次提交
  10. 19 7月, 2013 1 次提交
  11. 18 7月, 2013 4 次提交
  12. 17 7月, 2013 1 次提交
  13. 16 7月, 2013 3 次提交
    • A
      Fixed typo in rio.h, simgle -> single. · 2e449d42
      antirez 提交于
      2e449d42
    • Y
    • A
      Make sure that ZADD can accept the full range of double values. · 112e7636
      antirez 提交于
      This fixes issue #1194, that contains many details.
      
      However in short, it was possible for ZADD to not accept as score values
      that was however possible to obtain with multiple calls to ZINCRBY, like
      in the following example:
      
      redis 127.0.0.1:6379> zadd k 2.5e-308 m
      (integer) 1
      redis 127.0.0.1:6379> zincrby k -2.4e-308 m
      "9.9999999999999694e-310"
      redis 127.0.0.1:6379> zscore k m
      "9.9999999999999694e-310"
      redis 127.0.0.1:6379> zadd k 9.9999999999999694e-310 m1
      (error) ERR value is not a valid float
      
      The problem was due to strtod() returning ERANGE in the following case
      specified by POSIX:
      
      "If the correct value would cause an underflow, a value whose magnitude
      is no greater than the smallest normalized positive number in the return
      type shall be returned and errno set to [ERANGE].".
      
      Now instead the returned value is accepted even when ERANGE is returned
      as long as the return value of the function is not negative or positive
      HUGE_VAL or zero.
      112e7636
  14. 13 7月, 2013 1 次提交
  15. 12 7月, 2013 4 次提交
    • A
      Use the environment locale for strcoll() collation. · 98757b4a
      antirez 提交于
      98757b4a
    • A
      SORT ALPHA: use collation instead of binary comparison. · 18fabeb2
      antirez 提交于
      Note that we only do it when STORE is not used, otherwise we want an
      absolutely locale independent and binary safe sorting in order to ensure
      AOF / replication consistency.
      
      This is probably an unexpected behavior violating the least surprise
      rule, but there is currently no other simple / good alternative.
      18fabeb2
    • A
      Fixed compareStringObject() and introduced collateStringObject(). · d8fcbb66
      antirez 提交于
      compareStringObject was not always giving the same result when comparing
      two exact strings, but encoded as integers or as sds strings, since it
      switched to strcmp() when at least one of the strings were not sds
      encoded.
      
      For instance the two strings "123" and "123\x00456", where the first
      string was integer encoded, would result into the old implementation of
      compareStringObject() to return 0 as if the strings were equal, while
      instead the second string is "greater" than the first in a binary
      comparison.
      
      The same compasion, but with "123" encoded as sds string, would instead
      return a value < 0, as it is correct. It is not impossible that the
      above caused some obscure bug, since the comparison was not always
      deterministic, and compareStringObject() is used in the implementation
      of skiplists, hash tables, and so forth.
      
      At the same time, collateStringObject() was introduced by this commit, so
      that can be used by SORT command to return sorted strings usign
      collation instead of binary comparison. See next commit.
      d8fcbb66
    • J
      Wrap IPv6 in brackets in the prompt. · 1bcbb7a9
      Jan-Erik Rediger 提交于
      1bcbb7a9
  16. 11 7月, 2013 4 次提交