(what’s new in)
Redis 2.2
October 27th 2010
Pieter Noordhuis
Redis 2.2 October 27 th 2010 Pieter Noordhuis Who am I? Live in - - PowerPoint PPT Presentation
(whats new in) Redis 2.2 October 27 th 2010 Pieter Noordhuis Who am I? Live in Groningen, NL Redis contributor since March Backed by VMware So, whats new? Memory efficiency Throughput improvements Improved EXPIRE
(what’s new in)
October 27th 2010
Pieter Noordhuis
VMware
(lists) typedef struct listNode { struct listNode *prev; struct listNode *next; void *value; } listNode;
(lists)
typedef struct listNode { struct listNode *prev; struct listNode *next; void *value; } listNode; typedef struct listNode { struct listNode *prev; struct listNode *next; void *value; } listNode; typedef struct listNode { struct listNode *prev; struct listNode *next; void *value; } listNode;(lists)
typedef struct listNode { struct listNode *prev; struct listNode *next; void *value; } listNode; typedef struct listNode { struct listNode *prev; struct listNode *next; void *value; } listNode; typedef struct listNode { struct listNode *prev; struct listNode *next; void *value; } listNode;LPUSH RPUSH O(1)
(lists)
0% 25% 50% 75% 100% 64 128 192 256 320 384 448 512
Linked list memory efficiency by payload size
Payload size (bytes)
Value header Value Value header Value Value header Value List header
larger payload. What is the gain of ziplists?
0x 2x 4x 6x 8x 10x 32 64 96 128 160 192 224 256
Ziplist memory gain by payload size
Payload size (bytes)
5000 10000 15000 20000
Time to LPUSH (32 byte payload) by list size
Time List size ziplist linked list
list-max-ziplist-entries (default: 1024) list-max-ziplist-value (default: 32)
(sets)
typedef struct dictEntry { void *key; void *val; struct dictEntry *next; } dictEntry;
Slot 0 value Slot 1 Slot 2 value value Slot 3 value
(think user IDs)
(sets)
guarantee O(1) lookup
Integer Intset header Integer Integer Integer Integer Integer
0x 5x 10x 15x 20x 5000 10000 15000 20000
Intset (32-bit signed integer range) memory gain by set size
Set size
5000 10000 15000 20000
Time to SADD 32-bit integer by set size
Time hash table intset
set-max-intset-entries (default: 4096)
(misc.)
↓General keyspace overhead (VM enabled) ↓Sorted set metadata (~20%)
process(request);
write(fd,response);
(response)
(response)
12500 25000 37500 50000 200 400 600 800 1000
LRANGE by response length
rps 2.0 2.2
(request)
3750 7500 11250 15000 100 200 300 400
MSET throughput by argument count
2.0 2.2
(new behavior)
(new behavior)
redis> SADD online:<timestamp> 15 (integer) 1 redis> EXPIRE online:<timestamp> 600 (integer) 1 redis> SADD online:<timestamp> 23 (integer) 1 redis> SADD online:<timestamp> 27 (integer) 1 redis> SMEMBERS online:<timestamp>
(purge policies)
a decoupled protocol parser