View rax_iterator_api.c
void somefunc(rax *mytree) {
raxIterator iter;
raxStart(&iter,mytree);
/* As seek operator you can use >, <, >=, <=, == */
raxSeek(&iter,(unsigned char*)"chromo",6,"<="); /* Seek key <= "chromo" */
while(raxNext(&iter,NULL,0,NULL)) { /* or raxPrev() */
printf("Current key: %.*s, val %p\n",
(int)iter.key_len, (char*)iter.key, iter.data);
}
View prng_bleagh.c
/* MacOS libc PRNG is garbage!
* Test this on MacOS 10.12.3 (may be the same with other versions)
* You'll see three times the same output.
* Cheers by @antirez. */
#include <stdio.h>
#include <stdlib.h>
int main(void) {
/* Note, 1000000, 1000001, 1000002 are not special.
View radtree.md

Radix tree ASCII printing.

[r] -> [ou]
           `-(o) [m] -> [au]
                         `-(a) [n] -> [eu]
                                       `-(e) []=0x0
                                       `-(u) [s] -> []=0x1
                         `-(u) "lus" -> []=0x2
           `-(u) [b] -> [ei]
View patch.diff
diff --git a/src/evict.c b/src/evict.c
index 802997c..24fb283 100644
--- a/src/evict.c
+++ b/src/evict.c
@@ -336,11 +336,34 @@ unsigned long LFUDecrAndReturn(robj *o) {
* server when there is data to add in order to make space if needed.
* --------------------------------------------------------------------------*/
+/* We don't want to count AOF buffers and slaves output buffers as
+ * used memory: the eviction should use mostly data size. This function
View 4.2-roadmap.md

Redis 4.2 roadmap

  1. Redis Cluster
  • Speed up key -> hashslot association. Now makes RBB loading 4x slower when there are many small keys.
  • Better multi data center story
  • redis-trib C coded and moved into redis-cli
  • Backup / Restore of Cluster
  • Non blocking MIGRATE (also consider not using 2X memory)
  • Faster resharding
  • Bug fixing and stress testing to bring it to next level of maturity
View listpack.md

Listpack specification

Version 1.0, 1 Feb 2017: Intial specification.

Version 1.1, 2 Feb 2017: Integer encoding simplified. Appendix A added.

Version 1.2, 3 Feb 2017: Better specify the meaning of the num-elements
                         field with value of 65535. The two 12 bits
                         positive/negative integers encodings were
View stresstest.rb
require 'redis'
Chars=('A'..'Z').to_a
def g(prefix)
choice = rand(9)
if (choice == 0)
# Values around this size stress the cascading update.
len = [252,250].shuffle.first
prefix += rand(1000000).to_s
string = prefix + ("A"*(len-prefix.length))
View stresstest.c
/* gcc ziplist-stresstest.c zmalloc.c ziplist.c util.c sha1.c sds.c -Wall -W -O2 -o zl-test -ggdb -g; ./zl-test.
*
* To run with gcov use -Wall on OSX use -fprofile-arcs -ftest-coverage. */
#include "ziplist.h"
#include "util.h"
#include <string.h>
#include <assert.h>
#include <stdlib.h>
#include <stdio.h>
View gist:779a83400dc5a4835a954123948629a4
redis_version:2.4.13
redis_git_sha1:00000000
redis_git_dirty:0
arch_bits:64
multiplexing_api:epoll
gcc_version:4.1.2
process_id:3751
uptime_in_seconds:95986904
uptime_in_days:1110
lru_clock:1439339
View start.txt
23697:C 20 Dec 08:39:49.630 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
23697:C 20 Dec 08:39:49.631 # Redis version=999.999.999, bits=64, commit=074383f8, modified=1, pid=23697, just started
23697:C 20 Dec 08:39:49.631 # Warning: no config file specified, using the default config. In order to specify a config file use ./redis-server /path/to/redis.conf
23697:M 20 Dec 08:39:49.632 * Increased maximum number of open files to 10032 (it was originally set to 4864).
23697:M 20 Dec 08:39:49.633 * Running mode=standalone, port=6379.
23697:M 20 Dec 08:39:49.633 # Server initialized
23697:M 20 Dec 08:39:49.633 * DB loaded from disk: 0.000 seconds
23697:M 20 Dec 08:39:49.633 * Ready to accept connections