1. 15 1月, 2013 1 次提交
    • A
      CLIENT GETNAME and CLIENT SETNAME introduced. · 1971740f
      antirez 提交于
      Sometimes it is much simpler to debug complex Redis installations if it
      is possible to assign clients a name that is displayed in the CLIENT
      LIST output.
      
      This is the case, for example, for "leaked" connections. The ability to
      provide a name to the client makes it quite trivial to understand what
      is the part of the code implementing the client not releasing the
      resources appropriately.
      
      Behavior:
      
          CLIENT SETNAME: set a name for the client, or remove the current
                          name if an empty name is set.
          CLIENT GETNAME: get the current name, or a nil.
          CLIENT LIST: now displays the client name if any.
      
      Thanks to Mark Gravell for pushing this idea forward.
      1971740f
  2. 15 12月, 2012 1 次提交
    • A
      serverCron() frequency is now a runtime parameter (was REDIS_HZ). · f1481d4a
      antirez 提交于
      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
  3. 03 12月, 2012 1 次提交
    • A
      Blocking POP: use a dictionary to store keys clinet side. · 2f87cf8b
      antirez 提交于
      To store the keys we block for during a blocking pop operation, in the
      case the client is blocked for more data to arrive, we used a simple
      linear array of redis objects, in the blockingState structure:
      
          robj **keys;
          int count;
      
      However in order to fix issue #801 we also use a dictionary in order to
      avoid to end in the blocked clients queue for the same key multiple
      times with the same client.
      
      The dictionary was only temporary, just to avoid duplicates, but since
      we create / destroy it there is no point in doing this duplicated work,
      so this commit simply use a dictionary as the main structure to store
      the keys we are blocked for. So instead of the previous fields we now
      just have:
      
          dict *keys;
      
      This simplifies the code and reduces the work done by the server during
      a blocking POP operation.
      2f87cf8b
  4. 29 11月, 2012 1 次提交
    • A
      Introduced the Build ID in INFO and --version output. · 2f62c966
      antirez 提交于
      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
  5. 22 11月, 2012 2 次提交
    • A
      EVALSHA is now case insensitive. · 95f68f7b
      antirez 提交于
      EVALSHA used to crash if the SHA1 was not lowercase (Issue #783).
      Fixed using a case insensitive dictionary type for the sha -> script
      map used for replication of scripts.
      95f68f7b
    • A
      Safer handling of MULTI/EXEC on errors. · 3d139127
      antirez 提交于
      After the transcation starts with a MULIT, the previous behavior was to
      return an error on problems such as maxmemory limit reached. But still
      to execute the transaction with the subset of queued commands on EXEC.
      
      While it is true that the client was able to check for errors
      distinguish QUEUED by an error reply, MULTI/EXEC in most client
      implementations uses pipelining for speed, so all the commands and EXEC
      are sent without caring about replies.
      
      With this change:
      
      1) EXEC fails if at least one command was not queued because of an
      error. The EXECABORT error is used.
      2) A generic error is always reported on EXEC.
      3) The client DISCARDs the MULTI state after a failed EXEC, otherwise
      pipelining multiple transactions would be basically impossible:
      After a failed EXEC the next transaction would be simply queued as
      the tail of the previous transaction.
      3d139127
  6. 12 11月, 2012 1 次提交
    • A
      MIGRATE TCP connections caching. · e23d281e
      antirez 提交于
      By caching TCP connections used by MIGRATE to chat with other Redis
      instances a 5x performance improvement was measured with
      redis-benchmark against small keys.
      
      This can dramatically speedup cluster resharding and other processes
      where an high load of MIGRATE commands are used.
      e23d281e
  7. 09 11月, 2012 1 次提交
  8. 02 11月, 2012 1 次提交
  9. 01 11月, 2012 1 次提交
  10. 16 10月, 2012 1 次提交
    • A
      Fix MULTI / EXEC rendering in MONITOR output. · a1b1c1ea
      antirez 提交于
      Before of this commit it used to be like this:
      
      MULTI
      EXEC
      ... actual commands of the transaction ...
      
      Because after all that is the natural order of things. Transaction
      commands are queued and executed *only after* EXEC is called.
      
      However this makes debugging with MONITOR a mess, so the code was
      modified to provide a coherent output.
      
      What happens is that MULTI is rendered in the MONITOR output as far as
      possible, instead EXEC is propagated only after the transaction is
      executed, or even in the case it fails because of WATCH, so in this case
      you'll simply see:
      
      MULTI
      EXEC
      
      An empty transaction.
      a1b1c1ea
  11. 17 9月, 2012 1 次提交
    • A
      A reimplementation of blocking operation internals. · 7eb850ef
      antirez 提交于
      Redis provides support for blocking operations such as BLPOP or BRPOP.
      This operations are identical to normal LPOP and RPOP operations as long
      as there are elements in the target list, but if the list is empty they
      block waiting for new data to arrive to the list.
      
      All the clients blocked waiting for th same list are served in a FIFO
      way, so the first that blocked is the first to be served when there is
      more data pushed by another client into the list.
      
      The previous implementation of blocking operations was conceived to
      serve clients in the context of push operations. For for instance:
      
      1) There is a client "A" blocked on list "foo".
      2) The client "B" performs `LPUSH foo somevalue`.
      3) The client "A" is served in the context of the "B" LPUSH,
      synchronously.
      
      Processing things in a synchronous way was useful as if "A" pushes a
      value that is served by "B", from the point of view of the database is a
      NOP (no operation) thing, that is, nothing is replicated, nothing is
      written in the AOF file, and so forth.
      
      However later we implemented two things:
      
      1) Variadic LPUSH that could add multiple values to a list in the
      context of a single call.
      2) BRPOPLPUSH that was a version of BRPOP that also provided a "PUSH"
      side effect when receiving data.
      
      This forced us to make the synchronous implementation more complex. If
      client "B" is waiting for data, and "A" pushes three elemnents in a
      single call, we needed to propagate an LPUSH with a missing argument
      in the AOF and replication link. We also needed to make sure to
      replicate the LPUSH side of BRPOPLPUSH, but only if in turn did not
      happened to serve another blocking client into another list ;)
      
      This were complex but with a few of mutually recursive functions
      everything worked as expected... until one day we introduced scripting
      in Redis.
      
      Scripting + synchronous blocking operations = Issue #614.
      
      Basically you can't "rewrite" a script to have just a partial effect on
      the replicas and AOF file if the script happened to serve a few blocked
      clients.
      
      The solution to all this problems, implemented by this commit, is to
      change the way we serve blocked clients. Instead of serving the blocked
      clients synchronously, in the context of the command performing the PUSH
      operation, it is now an asynchronous and iterative process:
      
      1) If a key that has clients blocked waiting for data is the subject of
      a list push operation, We simply mark keys as "ready" and put it into a
      queue.
      2) Every command pushing stuff on lists, as a variadic LPUSH, a script,
      or whatever it is, is replicated verbatim without any rewriting.
      3) Every time a Redis command, a MULTI/EXEC block, or a script,
      completed its execution, we run the list of keys ready to serve blocked
      clients (as more data arrived), and process this list serving the
      blocked clients.
      4) As a result of "3" maybe more keys are ready again for other clients
      (as a result of BRPOPLPUSH we may have push operations), so we iterate
      back to step "3" if it's needed.
      
      The new code has a much simpler semantics, and a simpler to understand
      implementation, with the disadvantage of not being able to "optmize out"
      a PUSH+BPOP as a No OP.
      
      This commit will be tested with care before the final merge, more tests
      will be added likely.
      7eb850ef
  12. 05 9月, 2012 1 次提交
    • A
      Scripting: Force SORT BY constant determinism inside SORT itself. · 36741b2c
      antirez 提交于
      SORT is able to return (faster than when ordering) unordered output if
      the "BY" clause is used with a constant value. However we try to play
      well with scripting requirements of determinism providing always sorted
      outputs when SORT (and other similar commands) are called by Lua
      scripts.
      
      However we used the general mechanism in place in scripting in order to
      reorder SORT output, that is, if the command has the "S" flag set, the
      Lua scripting engine will take an additional step when converting a
      multi bulk reply to Lua value, calling a Lua sorting function.
      
      This is suboptimal as we can do it faster inside SORT itself.
      This is also broken as issue #545 shows us: basically when SORT is used
      with a constant BY, and additionally also GET is used, the Lua scripting
      engine was trying to order the output as a flat array, while it was
      actually a list of key-value pairs.
      
      What we do know is to recognized if the caller of SORT is the Lua client
      (since we can check this using the REDIS_LUA_CLIENT flag). If so, and if
      a "don't sort" condition is triggered by the BY option with a constant
      string, we force the lexicographical sorting.
      
      This commit fixes this bug and improves the performance, and at the same
      time simplifies the implementation. This does not mean I'm smart today,
      it means I was stupid when I committed the original implementation ;)
      36741b2c
  13. 02 9月, 2012 1 次提交
    • A
      Send an async PING before starting replication with master. · bb66fc31
      antirez 提交于
      During the first synchronization step of the replication process, a Redis
      slave connects with the master in a non blocking way. However once the
      connection is established the replication continues sending the REPLCONF
      command, and sometimes the AUTH command if needed. Those commands are
      send in a partially blocking way (blocking with timeout in the order of
      seconds).
      
      Because it is common for a blocked master to accept connections even if
      it is actually not able to reply to the slave requests, it was easy for
      a slave to block if the master had serious issues, but was still able to
      accept connections in the listening socket.
      
      For this reason we now send an asynchronous PING request just after the
      non blocking connection ended in a successful way, and wait for the
      reply before to continue with the replication process. It is very
      unlikely that a master replying to PING can't reply to the other
      commands.
      
      This solution was proposed by Didier Spezia (Thanks!) so that we don't
      need to turn all the replication process into a non blocking affair, but
      still the probability of a slave blocked is minimal even in the event of
      a failing master.
      
      Also we now use getsockopt(SO_ERROR) in order to check errors ASAP
      in the event handler, instead of waiting for actual I/O to return an
      error.
      
      This commit fixes issue #632.
      bb66fc31
  14. 28 8月, 2012 2 次提交
    • A
      Sentinel: Redis-side support for slave priority. · 169a44cb
      antirez 提交于
      A Redis slave can now be configured with a priority, that is an integer
      number that is shown in INFO output and can be get and set using the
      redis.conf file or the CONFIG GET/SET command.
      
      This field is used by Sentinel during slave election. A slave with lower
      priority is preferred. A slave with priority zero is never elected (and
      is considered to be impossible to elect even if it is the only slave
      available).
      
      A next commit will add support in the Sentinel side as well.
      169a44cb
    • A
      Incrementally flush RDB on disk while loading it from a master. · 784b9308
      antirez 提交于
      This fixes issue #539.
      
      Basically if there is enough free memory the OS may buffer the RDB file
      that the slave transfers on disk from the master. The file may
      actually be flused on disk at once by the operating system when it gets
      closed by Redis, causing the close system call to block for a long time.
      
      This patch is a modified version of one provided by yoav-steinberg of
      @garantiadata (the original version was posted in the issue #539
      comments), and tries to flush the OS buffers incrementally (every 8 MB
      of loaded data).
      784b9308
  15. 23 7月, 2012 1 次提交
  16. 22 7月, 2012 1 次提交
    • A
      Allow Pub/Sub in contexts where other commands are blocked. · 5d73073f
      antirez 提交于
      Redis loading data from disk, and a Redis slave disconnected from its
      master with serve-stale-data disabled, are two conditions where
      commands are normally refused by Redis, returning an error.
      
      However there is no reason to disable Pub/Sub commands as well, given
      that this layer does not interact with the dataset. To allow Pub/Sub in
      as many contexts as possible is especially interesting now that Redis
      Sentinel uses Pub/Sub of a Redis master as a communication channel
      between Sentinels.
      
      This commit allows Pub/Sub to be used in the above two contexts where
      it was previously denied.
      5d73073f
  17. 18 7月, 2012 1 次提交
    • S
      New in INFO: aof_last_bgrewrite_status · 48553a29
      Saj Goonatilleke 提交于
      Behaves like rdb_last_bgsave_status -- even down to reporting 'ok' when
      no rewrite has been done yet.  (You might want to check that
      aof_last_rewrite_time_sec is not -1.)
      48553a29
  18. 05 7月, 2012 1 次提交
    • S
      Bug fix: slaves being pinged every second · 9edfe635
      Saj Goonatilleke 提交于
      REDIS_REPL_PING_SLAVE_PERIOD controls how often the master should
      transmit a heartbeat (PING) to its slaves.  This period, which defaults
      to 10, is measured in seconds.
      
      Redis 2.4 masters used to ping their slaves every ten seconds, just like
      it says on the tin.
      
      The Redis 2.6 masters I have been experimenting with, on the other hand,
      ping their slaves *every second*.  (master_last_io_seconds_ago never
      approaches 10.)  I think the ping period was inadvertently slashed to
      one-tenth of its nominal value around the time REDIS_HZ was introduced.
      This commit reintroduces correct ping schedule behaviour.
      9edfe635
  19. 27 6月, 2012 1 次提交
    • A
      REPLCONF internal command introduced. · 3a328978
      antirez 提交于
      The REPLCONF command is an internal command (not designed to be directly
      used by normal clients) that allows a slave to set some replication
      related state in the master before issuing SYNC to start the
      replication.
      
      The initial motivation for this command, and the only reason currently
      it is used by the implementation, is to let the slave instance
      communicate its listening port to the slave, so that the master can
      show all the slaves with their listening ports in the "replication"
      section of the INFO output.
      
      This allows clients to auto discover and query all the slaves attached
      into a master.
      
      Currently only a single option of the REPLCONF command is supported, and
      it is called "listening-port", so the slave now starts the replication
      process with something like the following chat:
      
          REPLCONF listening-prot 6380
          SYNC
      
      Note that this works even if the master is an older version of Redis and
      does not understand REPLCONF, because the slave ignores the REPLCONF
      error.
      
      In the future REPLCONF can be used for partial replication and other
      replication related features where there is the need to exchange
      information between master and slave.
      
      NOTE: This commit also fixes a bug: the INFO outout already carried
      information about slaves, but the port was broken, and was obtained
      with getpeername(2), so it was actually just the ephemeral port used
      by the slave to connect to the master as a client.
      3a328978
  20. 21 6月, 2012 1 次提交
    • A
      Fixed a timing attack on AUTH (Issue #560). · 31a1439b
      antirez 提交于
      The way we compared the authentication password using strcmp() allowed
      an attacker to gain information about the password using a well known
      class of attacks called "timing attacks".
      
      The bug appears to be practically not exploitable in most modern systems
      running Redis since even using multiple bytes of differences in the
      input at a time instead of one the difference in running time in in the
      order of 10 nanoseconds, making it hard to exploit even on LAN. However
      attacks always get better so we are providing a fix ASAP.
      
      The new implementation uses two fixed length buffers and a constant time
      comparison function, with the goal of:
      
      1) Completely avoid leaking information about the content of the
      password, since the comparison is always performed between 512
      characters and without conditionals.
      2) Partially avoid leaking information about the length of the
      password.
      
      About "2" we still have a stage in the code where the real password and
      the user provided password are copied in the static buffers, we also run
      two strlen() operations against the two inputs, so the running time
      of the comparison is a fixed amount plus a time proportional to
      LENGTH(A)+LENGTH(B). This means that the absolute time of the operation
      performed is still related to the length of the password in some way,
      but there is no way to change the input in order to get a difference in
      the execution time in the comparison that is not just proportional to
      the string provided by the user (because the password length is fixed).
      
      Thus in practical terms the user should try to discover LENGTH(PASSWORD)
      looking at the whole execution time of the AUTH command and trying to
      guess a proportionality between the whole execution time and the
      password length: this appears to be mostly unfeasible in the real world.
      
      Also protecting from this attack is not very useful in the case of Redis
      as a brute force attack is anyway feasible if the password is too short,
      while with a long password makes it not an issue that the attacker knows
      the length.
      31a1439b
  21. 12 6月, 2012 1 次提交
    • A
      Dump ziplist hex value on failed assertion. · ee789e15
      antirez 提交于
      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
  22. 25 5月, 2012 1 次提交
    • A
      Four new persistence fields in INFO. A few renamed. · 33e1db36
      antirez 提交于
      The 'persistence' section of INFO output now contains additional four
      fields related to RDB and AOF persistence:
      
       rdb_last_bgsave_time_sec       Duration of latest BGSAVE in sec.
       rdb_current_bgsave_time_sec    Duration of current BGSAVE in sec.
       aof_last_rewrite_time_sec      Duration of latest AOF rewrite in sec.
       aof_current_rewrite_time_sec   Duration of current AOF rewrite in sec.
      
      The 'current' fields are set to -1 if a BGSAVE / AOF rewrite is not in
      progress. The 'last' fileds are set to -1 if no previous BGSAVE / AOF
      rewrites were performed.
      
      Additionally a few fields in the persistence section were renamed for
      consistency:
      
       changes_since_last_save -> rdb_changes_since_last_save
       bgsave_in_progress -> rdb_bgsave_in_progress
       last_save_time -> rdb_last_save_time
       last_bgsave_status -> rdb_last_bgsave_status
       bgrewriteaof_in_progress -> aof_rewrite_in_progress
       bgrewriteaof_scheduled -> aof_rewrite_scheduled
      
      After the renaming, fields in the persistence section start with rdb_ or
      aof_ prefix depending on the persistence method they describe.
      The field 'loading' and related fields are not prefixed because they are
      unique for both the persistence methods.
      33e1db36
  23. 24 5月, 2012 2 次提交
    • A
      New commands: BITOP and BITCOUNT. · 0bd6d68e
      antirez 提交于
      The motivation for this new commands is to be search in the usage of
      Redis for real time statistics. See the article "Fast real time metrics
      using Redis".
      
      http://blog.getspool.com/2011/11/29/fast-easy-realtime-metrics-using-redis-bitmaps/
      
      In general Redis strings when used as bitmaps using the SETBIT/GETBIT
      command provide a very space-efficient and fast way to store statistics.
      For instance in a web application with users, every user can be
      associated with a key that shows every day in which the user visited the
      web service. This information can be really valuable to extract user
      behaviour information.
      
      With Redis bitmaps doing this is very simple just saying that a given
      day is 0 (the data the service was put online) and all the next days are
      1, 2, 3, and so forth. So with SETBIT it is possible to set the bit
      corresponding to the current day every time the user visits the site.
      
      It is possible to take the count of the bit sets on the run, this is
      extremely easy using a Lua script. However a fast bit count native
      operation can be useful, especially if it can operate on ranges, or when
      the string is small like in the case of days (even if you consider many
      years it is still extremely little data).
      
      For this reason BITOP was introduced. The command counts the number of
      bits set to 1 in a string, with optional range:
      
      BITCOUNT key [start end]
      
      The start/end parameters are similar to GETRANGE. If omitted the whole
      string is tested.
      
      Population counting is more useful when bit-level operations like AND,
      OR and XOR are avaialble. For instance I can test multiple users to see
      the number of days three users visited the site at the same time. To do
      this we can take the AND of all the bitmaps, and then count the set bits.
      
      For this reason the BITOP command was introduced:
      
      BITOP [AND|OR|XOR|NOT] dest_key src_key1 src_key2 src_key3 ... src_keyN
      
      In the special case of NOT (that inverts the bits) only one source key
      can be passed.
      
      The judicious use of BITCOUNT and BITOP combined can lead to interesting
      use cases with very space efficient representation of data.
      
      The implementation provided is still not tested and optimized for speed,
      next commits will introduce unit tests. Later the implementation will be
      profiled to see if it is possible to gain an important amount of speed
      without making the code much more complex.
      0bd6d68e
    • A
      Allow an AOF rewrite buffer > 2GB (Fix for issue #504). · 47ca4b6e
      antirez 提交于
      During the AOF rewrite process, the parent process needs to accumulate
      the new writes in an in-memory buffer: when the child will terminate the
      AOF rewriting process this buffer (that ist the difference between the
      dataset when the rewrite was started, and the current dataset) is
      flushed to the new AOF file.
      
      We used to implement this buffer using an sds.c string, but sds.c has a
      2GB limit. Sometimes the dataset can be big enough, the amount of writes
      so high, and the rewrite process slow enough that we overflow the 2GB
      limit, causing a crash, documented on github by issue #504.
      
      In order to prevent this from happening, this commit introduces a new
      system to accumulate writes, implemented by a linked list of blocks of
      10 MB each, so that we also avoid paying the reallocation cost.
      
      Note that theoretically modern operating systems may implement realloc()
      simply as a remaping of the old pages, thus with very good performances,
      see for instance the mremap() syscall on Linux. However this is not
      always true, and jemalloc by default avoids doing this because there are
      issues with the current implementation of mremap().
      
      For this reason we are using a linked list of blocks instead of a single
      block that gets reallocated again and again.
      
      The changes in this commit lacks testing, that will be performed before
      merging into the unstable branch. This fix will not enter 2.4 because it
      is too invasive. However 2.4 will log a warning when the AOF rewrite
      buffer is near to the 2GB limit.
      47ca4b6e
  24. 14 5月, 2012 1 次提交
    • A
      Impovements for: Redis timer, hashes rehashing, keys collection. · 61daf891
      antirez 提交于
      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
  25. 13 5月, 2012 1 次提交
    • A
      Redis timer interrupt frequency configurable as REDIS_HZ. · 94343492
      antirez 提交于
      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.
      94343492
  26. 12 5月, 2012 1 次提交
    • A
      More incremental active expired keys collection process. · 1dcc95d0
      antirez 提交于
      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.
      1dcc95d0
  27. 03 5月, 2012 1 次提交
  28. 22 4月, 2012 1 次提交
    • A
      Limit memory used by big SLOWLOG entries. · d3701d27
      antirez 提交于
      Two limits are added:
      
      1) Up to SLOWLOG_ENTRY_MAX_ARGV arguments are logged.
      2) Up to SLOWLOG_ENTRY_MAX_STRING bytes per argument are logged.
      3) slowlog-max-len is set to 128 by default (was 1024).
      
      The number of remaining arguments / bytes is logged in the entry
      so that the user can understand better the nature of the logged command.
      d3701d27
  29. 13 4月, 2012 2 次提交
    • A
      Stop access to global vars. Not configurable. · 6663653f
      antirez 提交于
      After considering the interaction between ability to delcare globals in
      scripts using the 'global' function, and the complexities related to
      hanlding replication and AOF in a sane way with globals AND ability to
      turn protection On and Off, we reconsidered the design. The new design
      makes clear that there is only one good way to write Redis scripts, that
      is not using globals. In the rare cases state must be retained across
      calls a Redis key can be used.
      6663653f
    • A
      Scripting: globals protection can now be switched on/off. · 37b29ef2
      antirez 提交于
      37b29ef2
  30. 10 4月, 2012 1 次提交
  31. 09 4月, 2012 1 次提交
  32. 07 4月, 2012 1 次提交
  33. 02 4月, 2012 2 次提交
  34. 31 3月, 2012 1 次提交
  35. 30 3月, 2012 1 次提交