SlideShare une entreprise Scribd logo
1  sur  88
Télécharger pour lire hors ligne
Redis Internal and RoadMap
from 2.8 to 3.2
charsyam@naver.com
Argenda
• Redis Management
• Data Structure in Redis
• Redis Roadmap
– From 2.8 to 3.2
Redis Management
REDIS
• Simple In-Memory Cache Server
• Support Collections, Replication, Persistent
– Collections(K/V, set, sorted set, hash)
– Replication(Master/Slave, support Chained replication)
– Persistent(RDB/AOF)
Single Threaded #1
• Redis is Single Threaded
– Can’t Process other commends during Processing a
Command
– Command to need long-time
• O(N) Commands with Large items.
– Keys, flushall, del
• Redis handles Lua Script as one command.
• MULTI/EXEC
– Process all commands at a time when exec command is reached.
Single Threaded #2
• It is better to execute multiple instance if you have
multi-cores
– Need more memory, but more reliable
• CPU 4 core, 32G Memory
Mem: 26G
Mem: 8G
Mem: 8G
Mem: 8G
Redis Event Loop #1
Client #1
Client #2
……
Client #N
Redis Event Loop
I/O Multiplexing
Process
Command
Packet #1
Packet #2
Redis Event Loop #2
• When command packet is complete, Redis process this
command.
– Redis is single threaded, so other code can’t be processed.
• In a loop, multiple command can be processed
sequentially.
– Like Reactor Pattern
How Slow?
Command Item Count Time
flashall 1,000,000 1000ms(1 second)
Quiz!!!
If you send “Keys *”
command in Production?
Persistent
• RDB/AOF
– RDB and AOF are not related.
– Just They are methods to support persistent
– Can use them together.
RDB #1
• Dump memory to disk with special format.
– Compressed(optional)
• When RDB is created?
– When It satisfied “SAVE” condition
– When slave send “SYNC” command(in replication)
– When user order “SAVE” or “BGSAVE” commands
• Caution!!!
– Don’t use default option.
• Most of Failure are related with Default Save Option
• It is too small to use in production.
• SAVE 900 1
• SAVE 60 10000 <- every 1 minute, redis can dump it’s memory
– If it is larger than “10G”
RDB #2
• Redis Uses fork system call to make RDB
– Redis can spend twice memory in creating RDB
– Command Service
• READ:WRITE = 8:2
– But Batch Job or Write-Back Service
• If you change all keys?
• Because of Copy on Write
Copy on Write
• When Parent Process fork
– At that time os doesn’t copy process memory in Read
Page
• Copy memory page when write is occurred.
Copy on Write #1
Process - Parent
Physical Memory
Page A
Page B
Page C
Copy on Write #2 – Fork(), but just Read
Process - Parent
Physical Memory
Page A
Page B
Page C
Process - Child
Copy on Write #2 – Fork(), After write
Process - Parent
Physical Memory
Page A
Page B
Page C
Copy of Page C
Process - Child
Copy on Write
• Redis can spend twice memory when all memory pages
are changed.
• If you redis uses swap memory area.
– You can experience extreme performance degradation
AOF #1
• Append Only File
• Save data as redis protocol format
• After event loop, save all write command to aof file
– It is cheaper than RDB, just write small data at a time.
• AOF File can be larger than memory size.
– It can rewrite aof file with conf
– AOF rewrite also uses fork system call()
AOF #2
• Binary Logs and WAL save the data before modifying
real data. But aof save data after data modifying
AOF Sample
*3rn
$3rn
Setrn
$3rn
Abcrn
$3rn
keyrn
RDB/AOF Tips #1
• If you need RDB/AOF.
– Using Master/Slave and apply it to slave node
– Using Multiple instance
• Allocating small memory to each instance
• 16GB/4 Core Machine
– 3 instances each instance use 3G or 4G
• Schedule RDB/AOF creation in maually
• Using Swap memory cause performance degradation
RDB/AOF Tips #2
• If you need using RDB in Master node.
– config set stop-writes-on-bgsave-error no
– Default is yes. And If it is yes, all write commands are prohibited
when creating RDB is failed.
• Disk or memory, or someone kill the process. There are many reasons.
MISCONF Redis is configured to save RDB snapshots, but is
currently not able to persist on disk. Commands that may
modify the data set are disabled. Please check Redis logs
for details about the error.”
Redis on AWS
AWS on PV. Using HVM
• If you use PV type Instance in Amazon AWS
– Amazon AWS uses XEN for virtualization
– PV type instance has performance degradation in XEN
• Depending on used memory size.
• It spend more then seconds.
• Just Use HVM type for REDIS 
PV vs HVM (m3.xlarge) - ms
Memory PV HVM
0 0.5 0.1
608MB 143 5
1.54G 352 13
2.31G 517 20
4.62G 1208 Not test
6.16G 1600 Not test
PV vs HVM
• In PV, fork need to copy page tables
– But it is slow
• So It depends on Page tables Size
fork
20x~30x
Slow in PV
Disable
THP option Also
Slow Disk IO
• EBS is slow Ephemeral Disk
• Frequent creating RDB is bad for performance.
Recommanded Redis Version
• After 2.8.13
– It uses Jemalloc 3.6.0
– Good at Memory fragmentation.
• Redis in AWS ElasticCache
– 2.8.19
Memory Fragmentation #1
• Redis depends on Memory Allocator(ex. Jemalloc)
– IN memcache, it uses slab allocator and using chunk
internally
– Redis just calls malloc and free when it need memory
allocation.
• It means you can’t avoid memory fragmentation.
Memory Fragmentation #2
• 2.6.16 and 2.8.6
– 2.4G Used memory, But rss is 12G
Redis Monitoring
name Host or Redis(info)
CPU Usage, Load Host
Network inbound,
outbound
Host
Current clients
max client config
Redis
keys count, commands count Redis
Used memory, RSS Redis
Disk size, io Host
Expired keys, Evicted keys Redis
Data Structure in Redis
Data Structure in Redis
• Support Redis Collections.
– K/V, list, set, sorted set, hash
• Sorted Set/Hash can use special Data Type for saving
Memory : ziplist
Data Types Default Data Type Data Type for speed
Sorted Set ziplist Skiplist
Hash ziplist Dict
Redis Dict – Redis Default Data Type
• Hash Table
typedef struct dict {
……
dictht ht[2];
……
}dict;
Redis Dict – Redis Default Data Type
• Hash Table
Redis Dict – Extend Hash Table #1
• Two Hash Table are in Dict.
• When need extending hash table
– Allocating new hash table in ht[1]
– After extending, change ht[0] and ht[1], and remove ht[1]
Redis Dict – Extend Hash Table #2
Redis Dict – Extend Hash Table #3
Redis Dict – Extend Hash Table #3
Question of Redis Dict?
• How to process commands during extending
– Redis is Single Threaded
– So If it takes long time. We can’t process others.
• How to search keys during extending?
– There are two hash tables
Don’t extend hash table at a time
• Extending Hash Table
– Making HT[1] as twice size of HT[0]
– Just move just one bucket in hash table
• New items only are added in HT[1]
• Searching Hash Table during Extending
– Search HT[0] and HT[1] also.
Redis Hash – Hash in Hash
Redis Sorted Set : Skiplist
• O(log(N))
• Using Level for searching speed.
Redis Sorted Set – Find Item #1
Redis Sorted Set – Find Item #2
Redis Sorted Set – Find Item #3
Redis Sorted Set – Find Item #4
For Saving memory
ziplist
Why ziplist?
• Hash and SkipList are Fast. But using much memory
• If items are small. Sequential search is also not slow.
– Redis uses only memory. So it is also fast.
Redis.conf
hash-max-ziplist-entries
hash-max-ziplist-value
zset-max-ziplist-entries
zset-max-ziplist-value
Ziplist 구조
zlbytes zltail zllen entry entry zlend
Ziplist Drawback
• It is for few items (not many)
• Sequential Search
– It will be slower, Items count are increased.
• It need memory resizing when item is added.
– And moving items for adding
Redis ROadmap
Redis 2.8
Redis 2.8
• Scan
• Partial Sync
Scan
Scan
• From 2.8.x
– Replacement for “KEY *”
• Iterating Hash table bucket
• Cursor is Index of Hash Table Bucket
Scan #1
Scan #2
Scan #3
Scan Tips
• Redis also scans Sorted Set, Hash, and Set in the
same way.
– Sorted set also uses dict as dereference.
• But how to scan ziplist?
– It dosen’t use hash tables.
– Just return all items, because it suppose that there are
few items.
– So, If there are too many items. It works like O(n)
command그
Partial Sync
Redis Replication
1. Slave send “Sync” command to Master
2. Master forks to make RDB File
3. After RDB creation, Master send RDB file to Slave
4. In 3 step, Redis master save commands that received
from client for replication
5. After sending RDB, Slave loads RDB file
6. Master send saving commands to slave
Problem of Redis Repliaction
• If connection is closed
– Even it is very short.
– Slave needs full sync.
– Disk IO is expensive
• Slave checks master status using polling
Partial Sync
• If connection is closed.
– But it is short, so change are in replication buffer.
– Avoiding full sync, just send commands in replication
buffer
Redis 3.0
Redis 3.0
• Redis Cluster
• Diskless Replication(Experimental)
Redis Cluster #1
• Minimum spec
– Master 3 nodes
– Slave 3 nodes
– It needs total 6 nodes for operation
Redis Cluster #2
• 16384 slots
• Don’t need sentinels.
• Using Redis-trib.rb to manage cluster.
– Only supporitng Manully slot migration
Redis Cluster operation #1
Redis Cluster operation #2
Redis Cluster operation #3
Redis Cluster operation #4
Redis Cluster operation #5
Redis Cluster Drawbacks
• Depending on Library
• Manual slot migration
Diskless Replication
• In replication, RDB file is created.
– But it spends disk IO
• Just send RDB data directly.
– Not creating RDB file in local.
– Removing time to save RDB
Redis 3.2
Redis 3.2
• Sds header Memory size Optimization
• GEO Command
Sds header Memory size Optimization #1
• Supporting variant sds header
• Adding classes for 24 bytes in Jemalloc
– Changed jemalloc code in Redis deps folder
Sds header Memory size Optimization #2
• Supporing variant sds header size.
String 길이 SDS 헤더 사이즈
8bit length 3 bytes
16bit length 5 bytes
32bit length 9 bytes
64 bit length 17 bytes
Sds header Memory size Optimization #3
There is no 24 bytes
Jemalloc increases memory 2^LG_QUANTUM
Change #define LG_QUANTUM 4 to
#define LG_QUANTUM 3
Sds header Memory size Optimization #4
• Changing memory size.
– Tested with 1M items
적용 메모리 사용량
original 115.57M
Just changing SDS size 92.69M
Jemalloc new classes 77.43M
GEO Command
GEO Command
• GEO 관련 커맨드 추가
– GEOADD
– GEOHASH
– GEOPOS
– GEODIST
– GEORADIUS
– GEORADIUSBYMEMBER
Thanks.

Contenu connexe

Tendances

Introduction to Redis
Introduction to RedisIntroduction to Redis
Introduction to RedisArnab Mitra
 
Caching solutions with Redis
Caching solutions   with RedisCaching solutions   with Redis
Caching solutions with RedisGeorge Platon
 
LizardFS-WhitePaper-Eng-v3.9.2-web
LizardFS-WhitePaper-Eng-v3.9.2-webLizardFS-WhitePaper-Eng-v3.9.2-web
LizardFS-WhitePaper-Eng-v3.9.2-webSzymon Haly
 
REDIS intro and how to use redis
REDIS intro and how to use redisREDIS intro and how to use redis
REDIS intro and how to use redisKris Jeong
 
Redis深入浅出
Redis深入浅出Redis深入浅出
Redis深入浅出iammutex
 
M|18 Writing Stored Procedures in the Real World
M|18 Writing Stored Procedures in the Real WorldM|18 Writing Stored Procedures in the Real World
M|18 Writing Stored Procedures in the Real WorldMariaDB plc
 
This is redis - feature and usecase
This is redis - feature and usecaseThis is redis - feature and usecase
This is redis - feature and usecaseKris Jeong
 
Control your service resources with systemd
 Control your service resources with systemd  Control your service resources with systemd
Control your service resources with systemd Marian Marinov
 
MySQL High Availability Sprint: Launch the Pacemaker
MySQL High Availability Sprint: Launch the PacemakerMySQL High Availability Sprint: Launch the Pacemaker
MySQL High Availability Sprint: Launch the Pacemakerhastexo
 
Keynote: Apache HBase at Yahoo! Scale
Keynote: Apache HBase at Yahoo! ScaleKeynote: Apache HBase at Yahoo! Scale
Keynote: Apache HBase at Yahoo! ScaleHBaseCon
 
Scaling Apache Pulsar to 10 Petabytes/Day
Scaling Apache Pulsar to 10 Petabytes/DayScaling Apache Pulsar to 10 Petabytes/Day
Scaling Apache Pulsar to 10 Petabytes/DayScyllaDB
 
Red Hat Gluster Storage Performance
Red Hat Gluster Storage PerformanceRed Hat Gluster Storage Performance
Red Hat Gluster Storage PerformanceRed_Hat_Storage
 
Frontera распределенный робот для обхода веба в больших объемах / Александр С...
Frontera распределенный робот для обхода веба в больших объемах / Александр С...Frontera распределенный робот для обхода веба в больших объемах / Александр С...
Frontera распределенный робот для обхода веба в больших объемах / Александр С...Ontico
 
Scylla Summit 2018: In-Memory Scylla - When Fast Storage is Not Fast Enough
Scylla Summit 2018: In-Memory Scylla - When Fast Storage is Not Fast EnoughScylla Summit 2018: In-Memory Scylla - When Fast Storage is Not Fast Enough
Scylla Summit 2018: In-Memory Scylla - When Fast Storage is Not Fast EnoughScyllaDB
 
Journey to Stability: Petabyte Ceph Cluster in OpenStack Cloud
Journey to Stability: Petabyte Ceph Cluster in OpenStack CloudJourney to Stability: Petabyte Ceph Cluster in OpenStack Cloud
Journey to Stability: Petabyte Ceph Cluster in OpenStack CloudPatrick McGarry
 
Build a High Available NFS Cluster Based on CephFS - Shangzhong Zhu
Build a High Available NFS Cluster Based on CephFS - Shangzhong ZhuBuild a High Available NFS Cluster Based on CephFS - Shangzhong Zhu
Build a High Available NFS Cluster Based on CephFS - Shangzhong ZhuCeph Community
 
Redis overview for Software Architecture Forum
Redis overview for Software Architecture ForumRedis overview for Software Architecture Forum
Redis overview for Software Architecture ForumChristopher Spring
 
HighLoad Solutions On MySQL / Xiaobin Lin (Alibaba)
HighLoad Solutions On MySQL / Xiaobin Lin (Alibaba)HighLoad Solutions On MySQL / Xiaobin Lin (Alibaba)
HighLoad Solutions On MySQL / Xiaobin Lin (Alibaba)Ontico
 

Tendances (20)

Introduction to Redis
Introduction to RedisIntroduction to Redis
Introduction to Redis
 
Caching solutions with Redis
Caching solutions   with RedisCaching solutions   with Redis
Caching solutions with Redis
 
LizardFS-WhitePaper-Eng-v3.9.2-web
LizardFS-WhitePaper-Eng-v3.9.2-webLizardFS-WhitePaper-Eng-v3.9.2-web
LizardFS-WhitePaper-Eng-v3.9.2-web
 
REDIS intro and how to use redis
REDIS intro and how to use redisREDIS intro and how to use redis
REDIS intro and how to use redis
 
Redis深入浅出
Redis深入浅出Redis深入浅出
Redis深入浅出
 
M|18 Writing Stored Procedures in the Real World
M|18 Writing Stored Procedures in the Real WorldM|18 Writing Stored Procedures in the Real World
M|18 Writing Stored Procedures in the Real World
 
This is redis - feature and usecase
This is redis - feature and usecaseThis is redis - feature and usecase
This is redis - feature and usecase
 
Control your service resources with systemd
 Control your service resources with systemd  Control your service resources with systemd
Control your service resources with systemd
 
MySQL High Availability Sprint: Launch the Pacemaker
MySQL High Availability Sprint: Launch the PacemakerMySQL High Availability Sprint: Launch the Pacemaker
MySQL High Availability Sprint: Launch the Pacemaker
 
Keynote: Apache HBase at Yahoo! Scale
Keynote: Apache HBase at Yahoo! ScaleKeynote: Apache HBase at Yahoo! Scale
Keynote: Apache HBase at Yahoo! Scale
 
Scaling Apache Pulsar to 10 Petabytes/Day
Scaling Apache Pulsar to 10 Petabytes/DayScaling Apache Pulsar to 10 Petabytes/Day
Scaling Apache Pulsar to 10 Petabytes/Day
 
Red Hat Gluster Storage Performance
Red Hat Gluster Storage PerformanceRed Hat Gluster Storage Performance
Red Hat Gluster Storage Performance
 
Frontera распределенный робот для обхода веба в больших объемах / Александр С...
Frontera распределенный робот для обхода веба в больших объемах / Александр С...Frontera распределенный робот для обхода веба в больших объемах / Александр С...
Frontera распределенный робот для обхода веба в больших объемах / Александр С...
 
Shootout at the PAAS Corral
Shootout at the PAAS CorralShootout at the PAAS Corral
Shootout at the PAAS Corral
 
Scylla Summit 2018: In-Memory Scylla - When Fast Storage is Not Fast Enough
Scylla Summit 2018: In-Memory Scylla - When Fast Storage is Not Fast EnoughScylla Summit 2018: In-Memory Scylla - When Fast Storage is Not Fast Enough
Scylla Summit 2018: In-Memory Scylla - When Fast Storage is Not Fast Enough
 
Journey to Stability: Petabyte Ceph Cluster in OpenStack Cloud
Journey to Stability: Petabyte Ceph Cluster in OpenStack CloudJourney to Stability: Petabyte Ceph Cluster in OpenStack Cloud
Journey to Stability: Petabyte Ceph Cluster in OpenStack Cloud
 
Build a High Available NFS Cluster Based on CephFS - Shangzhong Zhu
Build a High Available NFS Cluster Based on CephFS - Shangzhong ZhuBuild a High Available NFS Cluster Based on CephFS - Shangzhong Zhu
Build a High Available NFS Cluster Based on CephFS - Shangzhong Zhu
 
Redis Persistence
Redis  PersistenceRedis  Persistence
Redis Persistence
 
Redis overview for Software Architecture Forum
Redis overview for Software Architecture ForumRedis overview for Software Architecture Forum
Redis overview for Software Architecture Forum
 
HighLoad Solutions On MySQL / Xiaobin Lin (Alibaba)
HighLoad Solutions On MySQL / Xiaobin Lin (Alibaba)HighLoad Solutions On MySQL / Xiaobin Lin (Alibaba)
HighLoad Solutions On MySQL / Xiaobin Lin (Alibaba)
 

En vedette

Redis persistence in practice
Redis persistence in practiceRedis persistence in practice
Redis persistence in practiceEugene Fidelin
 
Redis trouble shooting
Redis trouble shootingRedis trouble shooting
Redis trouble shootingDaeMyung Kang
 
聊聊我接触的集群管理
聊聊我接触的集群管理聊聊我接触的集群管理
聊聊我接触的集群管理rfyiamcool
 
Redis as a Main Database, Scaling and HA
Redis as a Main Database, Scaling and HARedis as a Main Database, Scaling and HA
Redis as a Main Database, Scaling and HADave Nielsen
 
大话redis设计实现
大话redis设计实现大话redis设计实现
大话redis设计实现rfyiamcool
 
Getting Started with Redis
Getting Started with RedisGetting Started with Redis
Getting Started with RedisFaisal Akber
 
Use Redis in Odd and Unusual Ways
Use Redis in Odd and Unusual WaysUse Redis in Odd and Unusual Ways
Use Redis in Odd and Unusual WaysItamar Haber
 
Redis Developers Day 2015 - Secondary Indexes and State of Lua
Redis Developers Day 2015 - Secondary Indexes and State of LuaRedis Developers Day 2015 - Secondary Indexes and State of Lua
Redis Developers Day 2015 - Secondary Indexes and State of LuaItamar Haber
 
Get more than a cache back! The Microsoft Azure Redis Cache (NDC Oslo)
Get more than a cache back! The Microsoft Azure Redis Cache (NDC Oslo)Get more than a cache back! The Microsoft Azure Redis Cache (NDC Oslo)
Get more than a cache back! The Microsoft Azure Redis Cache (NDC Oslo)Maarten Balliauw
 
Build a Geospatial App with Redis 3.2- Andrew Bass, Sean Yesmunt, Sergio Prad...
Build a Geospatial App with Redis 3.2- Andrew Bass, Sean Yesmunt, Sergio Prad...Build a Geospatial App with Redis 3.2- Andrew Bass, Sean Yesmunt, Sergio Prad...
Build a Geospatial App with Redis 3.2- Andrew Bass, Sean Yesmunt, Sergio Prad...Redis Labs
 
RespClient - Minimal Redis Client for PowerShell
RespClient - Minimal Redis Client for PowerShellRespClient - Minimal Redis Client for PowerShell
RespClient - Minimal Redis Client for PowerShellYoshifumi Kawai
 
UV logic using redis bitmap
UV logic using redis bitmapUV logic using redis bitmap
UV logic using redis bitmap주용 오
 
HIgh Performance Redis- Tague Griffith, GoPro
HIgh Performance Redis- Tague Griffith, GoProHIgh Performance Redis- Tague Griffith, GoPro
HIgh Performance Redis- Tague Griffith, GoProRedis Labs
 
RedisConf 2016 talk - The Redis API: Simple, Composable, Powerful
RedisConf 2016 talk - The Redis API: Simple, Composable, PowerfulRedisConf 2016 talk - The Redis API: Simple, Composable, Powerful
RedisConf 2016 talk - The Redis API: Simple, Composable, PowerfulDynomiteDB
 
Using Redis as Distributed Cache for ASP.NET apps - Peter Kellner, 73rd Stre...
 Using Redis as Distributed Cache for ASP.NET apps - Peter Kellner, 73rd Stre... Using Redis as Distributed Cache for ASP.NET apps - Peter Kellner, 73rd Stre...
Using Redis as Distributed Cache for ASP.NET apps - Peter Kellner, 73rd Stre...Redis Labs
 
Troubleshooting Redis- DaeMyung Kang, Kakao
Troubleshooting Redis- DaeMyung Kang, KakaoTroubleshooting Redis- DaeMyung Kang, Kakao
Troubleshooting Redis- DaeMyung Kang, KakaoRedis Labs
 
Scalable Streaming Data Pipelines with Redis
Scalable Streaming Data Pipelines with RedisScalable Streaming Data Pipelines with Redis
Scalable Streaming Data Pipelines with RedisAvram Lyon
 
Cloud Foundry for Data Science
Cloud Foundry for Data ScienceCloud Foundry for Data Science
Cloud Foundry for Data ScienceIan Huston
 
Back your App with MySQL & Redis, the Cloud Foundry Way- Kenny Bastani, Pivotal
Back your App with MySQL & Redis, the Cloud Foundry Way- Kenny Bastani, PivotalBack your App with MySQL & Redis, the Cloud Foundry Way- Kenny Bastani, Pivotal
Back your App with MySQL & Redis, the Cloud Foundry Way- Kenny Bastani, PivotalRedis Labs
 

En vedette (20)

Redis on AWS
Redis on AWSRedis on AWS
Redis on AWS
 
Redis persistence in practice
Redis persistence in practiceRedis persistence in practice
Redis persistence in practice
 
Redis trouble shooting
Redis trouble shootingRedis trouble shooting
Redis trouble shooting
 
聊聊我接触的集群管理
聊聊我接触的集群管理聊聊我接触的集群管理
聊聊我接触的集群管理
 
Redis as a Main Database, Scaling and HA
Redis as a Main Database, Scaling and HARedis as a Main Database, Scaling and HA
Redis as a Main Database, Scaling and HA
 
大话redis设计实现
大话redis设计实现大话redis设计实现
大话redis设计实现
 
Getting Started with Redis
Getting Started with RedisGetting Started with Redis
Getting Started with Redis
 
Use Redis in Odd and Unusual Ways
Use Redis in Odd and Unusual WaysUse Redis in Odd and Unusual Ways
Use Redis in Odd and Unusual Ways
 
Redis Developers Day 2015 - Secondary Indexes and State of Lua
Redis Developers Day 2015 - Secondary Indexes and State of LuaRedis Developers Day 2015 - Secondary Indexes and State of Lua
Redis Developers Day 2015 - Secondary Indexes and State of Lua
 
Get more than a cache back! The Microsoft Azure Redis Cache (NDC Oslo)
Get more than a cache back! The Microsoft Azure Redis Cache (NDC Oslo)Get more than a cache back! The Microsoft Azure Redis Cache (NDC Oslo)
Get more than a cache back! The Microsoft Azure Redis Cache (NDC Oslo)
 
Build a Geospatial App with Redis 3.2- Andrew Bass, Sean Yesmunt, Sergio Prad...
Build a Geospatial App with Redis 3.2- Andrew Bass, Sean Yesmunt, Sergio Prad...Build a Geospatial App with Redis 3.2- Andrew Bass, Sean Yesmunt, Sergio Prad...
Build a Geospatial App with Redis 3.2- Andrew Bass, Sean Yesmunt, Sergio Prad...
 
RespClient - Minimal Redis Client for PowerShell
RespClient - Minimal Redis Client for PowerShellRespClient - Minimal Redis Client for PowerShell
RespClient - Minimal Redis Client for PowerShell
 
UV logic using redis bitmap
UV logic using redis bitmapUV logic using redis bitmap
UV logic using redis bitmap
 
HIgh Performance Redis- Tague Griffith, GoPro
HIgh Performance Redis- Tague Griffith, GoProHIgh Performance Redis- Tague Griffith, GoPro
HIgh Performance Redis- Tague Griffith, GoPro
 
RedisConf 2016 talk - The Redis API: Simple, Composable, Powerful
RedisConf 2016 talk - The Redis API: Simple, Composable, PowerfulRedisConf 2016 talk - The Redis API: Simple, Composable, Powerful
RedisConf 2016 talk - The Redis API: Simple, Composable, Powerful
 
Using Redis as Distributed Cache for ASP.NET apps - Peter Kellner, 73rd Stre...
 Using Redis as Distributed Cache for ASP.NET apps - Peter Kellner, 73rd Stre... Using Redis as Distributed Cache for ASP.NET apps - Peter Kellner, 73rd Stre...
Using Redis as Distributed Cache for ASP.NET apps - Peter Kellner, 73rd Stre...
 
Troubleshooting Redis- DaeMyung Kang, Kakao
Troubleshooting Redis- DaeMyung Kang, KakaoTroubleshooting Redis- DaeMyung Kang, Kakao
Troubleshooting Redis- DaeMyung Kang, Kakao
 
Scalable Streaming Data Pipelines with Redis
Scalable Streaming Data Pipelines with RedisScalable Streaming Data Pipelines with Redis
Scalable Streaming Data Pipelines with Redis
 
Cloud Foundry for Data Science
Cloud Foundry for Data ScienceCloud Foundry for Data Science
Cloud Foundry for Data Science
 
Back your App with MySQL & Redis, the Cloud Foundry Way- Kenny Bastani, Pivotal
Back your App with MySQL & Redis, the Cloud Foundry Way- Kenny Bastani, PivotalBack your App with MySQL & Redis, the Cloud Foundry Way- Kenny Bastani, Pivotal
Back your App with MySQL & Redis, the Cloud Foundry Way- Kenny Bastani, Pivotal
 

Similaire à Redis acc 2015_eng

Tuning Linux Windows and Firebird for Heavy Workload
Tuning Linux Windows and Firebird for Heavy WorkloadTuning Linux Windows and Firebird for Heavy Workload
Tuning Linux Windows and Firebird for Heavy WorkloadMarius Adrian Popa
 
Red Hat Storage Server Administration Deep Dive
Red Hat Storage Server Administration Deep DiveRed Hat Storage Server Administration Deep Dive
Red Hat Storage Server Administration Deep DiveRed_Hat_Storage
 
Windows Server 2012 R2 Software-Defined Storage
Windows Server 2012 R2 Software-Defined StorageWindows Server 2012 R2 Software-Defined Storage
Windows Server 2012 R2 Software-Defined StorageAidan Finn
 
Redis - The Universal NoSQL Tool
Redis - The Universal NoSQL ToolRedis - The Universal NoSQL Tool
Redis - The Universal NoSQL ToolEberhard Wolff
 
InnoDB architecture and performance optimization (Пётр Зайцев)
InnoDB architecture and performance optimization (Пётр Зайцев)InnoDB architecture and performance optimization (Пётр Зайцев)
InnoDB architecture and performance optimization (Пётр Зайцев)Ontico
 
Hadoop Architecture_Cluster_Cap_Plan
Hadoop Architecture_Cluster_Cap_PlanHadoop Architecture_Cluster_Cap_Plan
Hadoop Architecture_Cluster_Cap_PlanNarayana B
 
Innodb 和 XtraDB 结构和性能优化
Innodb 和 XtraDB 结构和性能优化Innodb 和 XtraDB 结构和性能优化
Innodb 和 XtraDB 结构和性能优化YUCHENG HU
 
In-memory Caching in HDFS: Lower Latency, Same Great Taste
In-memory Caching in HDFS: Lower Latency, Same Great TasteIn-memory Caching in HDFS: Lower Latency, Same Great Taste
In-memory Caching in HDFS: Lower Latency, Same Great TasteDataWorks Summit
 
Speed up your Symfony2 application and build awesome features with Redis
Speed up your Symfony2 application and build awesome features with RedisSpeed up your Symfony2 application and build awesome features with Redis
Speed up your Symfony2 application and build awesome features with RedisRicard Clau
 
Some thoughts on apache spark & shark
Some thoughts on apache spark & sharkSome thoughts on apache spark & shark
Some thoughts on apache spark & sharkViet-Trung TRAN
 
Hadoop - Disk Fail In Place (DFIP)
Hadoop - Disk Fail In Place (DFIP)Hadoop - Disk Fail In Place (DFIP)
Hadoop - Disk Fail In Place (DFIP)mundlapudi
 
Troubleshooting redis
Troubleshooting redisTroubleshooting redis
Troubleshooting redisDaeMyung Kang
 
MongoDB Replication fundamentals - Desert Code Camp - October 2014
MongoDB Replication fundamentals - Desert Code Camp - October 2014MongoDB Replication fundamentals - Desert Code Camp - October 2014
MongoDB Replication fundamentals - Desert Code Camp - October 2014clairvoyantllc
 
Tuning Linux for your database FLOSSUK 2016
Tuning Linux for your database FLOSSUK 2016Tuning Linux for your database FLOSSUK 2016
Tuning Linux for your database FLOSSUK 2016Colin Charles
 
SUSE Storage: Sizing and Performance (Ceph)
SUSE Storage: Sizing and Performance (Ceph)SUSE Storage: Sizing and Performance (Ceph)
SUSE Storage: Sizing and Performance (Ceph)Lars Marowsky-Brée
 

Similaire à Redis acc 2015_eng (20)

Tuning Linux Windows and Firebird for Heavy Workload
Tuning Linux Windows and Firebird for Heavy WorkloadTuning Linux Windows and Firebird for Heavy Workload
Tuning Linux Windows and Firebird for Heavy Workload
 
Red Hat Storage Server Administration Deep Dive
Red Hat Storage Server Administration Deep DiveRed Hat Storage Server Administration Deep Dive
Red Hat Storage Server Administration Deep Dive
 
Windows Server 2012 R2 Software-Defined Storage
Windows Server 2012 R2 Software-Defined StorageWindows Server 2012 R2 Software-Defined Storage
Windows Server 2012 R2 Software-Defined Storage
 
Redis - The Universal NoSQL Tool
Redis - The Universal NoSQL ToolRedis - The Universal NoSQL Tool
Redis - The Universal NoSQL Tool
 
Redis meetup
Redis meetupRedis meetup
Redis meetup
 
InnoDB architecture and performance optimization (Пётр Зайцев)
InnoDB architecture and performance optimization (Пётр Зайцев)InnoDB architecture and performance optimization (Пётр Зайцев)
InnoDB architecture and performance optimization (Пётр Зайцев)
 
Hadoop Architecture_Cluster_Cap_Plan
Hadoop Architecture_Cluster_Cap_PlanHadoop Architecture_Cluster_Cap_Plan
Hadoop Architecture_Cluster_Cap_Plan
 
Innodb 和 XtraDB 结构和性能优化
Innodb 和 XtraDB 结构和性能优化Innodb 和 XtraDB 结构和性能优化
Innodb 和 XtraDB 结构和性能优化
 
In-memory Caching in HDFS: Lower Latency, Same Great Taste
In-memory Caching in HDFS: Lower Latency, Same Great TasteIn-memory Caching in HDFS: Lower Latency, Same Great Taste
In-memory Caching in HDFS: Lower Latency, Same Great Taste
 
Speed up your Symfony2 application and build awesome features with Redis
Speed up your Symfony2 application and build awesome features with RedisSpeed up your Symfony2 application and build awesome features with Redis
Speed up your Symfony2 application and build awesome features with Redis
 
Some thoughts on apache spark & shark
Some thoughts on apache spark & sharkSome thoughts on apache spark & shark
Some thoughts on apache spark & shark
 
KeyValue Stores
KeyValue StoresKeyValue Stores
KeyValue Stores
 
Intro to Apache Spark
Intro to Apache SparkIntro to Apache Spark
Intro to Apache Spark
 
Intro to Apache Spark
Intro to Apache SparkIntro to Apache Spark
Intro to Apache Spark
 
Hadoop - Disk Fail In Place (DFIP)
Hadoop - Disk Fail In Place (DFIP)Hadoop - Disk Fail In Place (DFIP)
Hadoop - Disk Fail In Place (DFIP)
 
Troubleshooting redis
Troubleshooting redisTroubleshooting redis
Troubleshooting redis
 
Barcamp MySQL
Barcamp MySQLBarcamp MySQL
Barcamp MySQL
 
MongoDB Replication fundamentals - Desert Code Camp - October 2014
MongoDB Replication fundamentals - Desert Code Camp - October 2014MongoDB Replication fundamentals - Desert Code Camp - October 2014
MongoDB Replication fundamentals - Desert Code Camp - October 2014
 
Tuning Linux for your database FLOSSUK 2016
Tuning Linux for your database FLOSSUK 2016Tuning Linux for your database FLOSSUK 2016
Tuning Linux for your database FLOSSUK 2016
 
SUSE Storage: Sizing and Performance (Ceph)
SUSE Storage: Sizing and Performance (Ceph)SUSE Storage: Sizing and Performance (Ceph)
SUSE Storage: Sizing and Performance (Ceph)
 

Plus de DaeMyung Kang

How to use redis well
How to use redis wellHow to use redis well
How to use redis wellDaeMyung Kang
 
The easiest consistent hashing
The easiest consistent hashingThe easiest consistent hashing
The easiest consistent hashingDaeMyung Kang
 
How to name a cache key
How to name a cache keyHow to name a cache key
How to name a cache keyDaeMyung Kang
 
Integration between Filebeat and logstash
Integration between Filebeat and logstash Integration between Filebeat and logstash
Integration between Filebeat and logstash DaeMyung Kang
 
How to build massive service for advance
How to build massive service for advanceHow to build massive service for advance
How to build massive service for advanceDaeMyung Kang
 
Massive service basic
Massive service basicMassive service basic
Massive service basicDaeMyung Kang
 
Data Engineering 101
Data Engineering 101Data Engineering 101
Data Engineering 101DaeMyung Kang
 
How To Become Better Engineer
How To Become Better EngineerHow To Become Better Engineer
How To Become Better EngineerDaeMyung Kang
 
Kafka timestamp offset_final
Kafka timestamp offset_finalKafka timestamp offset_final
Kafka timestamp offset_finalDaeMyung Kang
 
Kafka timestamp offset
Kafka timestamp offsetKafka timestamp offset
Kafka timestamp offsetDaeMyung Kang
 
Data pipeline and data lake
Data pipeline and data lakeData pipeline and data lake
Data pipeline and data lakeDaeMyung Kang
 
webservice scaling for newbie
webservice scaling for newbiewebservice scaling for newbie
webservice scaling for newbieDaeMyung Kang
 

Plus de DaeMyung Kang (20)

Count min sketch
Count min sketchCount min sketch
Count min sketch
 
Redis
RedisRedis
Redis
 
Ansible
AnsibleAnsible
Ansible
 
Why GUID is needed
Why GUID is neededWhy GUID is needed
Why GUID is needed
 
How to use redis well
How to use redis wellHow to use redis well
How to use redis well
 
The easiest consistent hashing
The easiest consistent hashingThe easiest consistent hashing
The easiest consistent hashing
 
How to name a cache key
How to name a cache keyHow to name a cache key
How to name a cache key
 
Integration between Filebeat and logstash
Integration between Filebeat and logstash Integration between Filebeat and logstash
Integration between Filebeat and logstash
 
How to build massive service for advance
How to build massive service for advanceHow to build massive service for advance
How to build massive service for advance
 
Massive service basic
Massive service basicMassive service basic
Massive service basic
 
Data Engineering 101
Data Engineering 101Data Engineering 101
Data Engineering 101
 
How To Become Better Engineer
How To Become Better EngineerHow To Become Better Engineer
How To Become Better Engineer
 
Kafka timestamp offset_final
Kafka timestamp offset_finalKafka timestamp offset_final
Kafka timestamp offset_final
 
Kafka timestamp offset
Kafka timestamp offsetKafka timestamp offset
Kafka timestamp offset
 
Data pipeline and data lake
Data pipeline and data lakeData pipeline and data lake
Data pipeline and data lake
 
Redis acl
Redis aclRedis acl
Redis acl
 
Coffee store
Coffee storeCoffee store
Coffee store
 
Scalable webservice
Scalable webserviceScalable webservice
Scalable webservice
 
Number system
Number systemNumber system
Number system
 
webservice scaling for newbie
webservice scaling for newbiewebservice scaling for newbie
webservice scaling for newbie
 

Dernier

"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfPrecisely
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piececharlottematthew16
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostZilliz
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 

Dernier (20)

"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 

Redis acc 2015_eng

  • 1. Redis Internal and RoadMap from 2.8 to 3.2 charsyam@naver.com
  • 2. Argenda • Redis Management • Data Structure in Redis • Redis Roadmap – From 2.8 to 3.2
  • 4. REDIS • Simple In-Memory Cache Server • Support Collections, Replication, Persistent – Collections(K/V, set, sorted set, hash) – Replication(Master/Slave, support Chained replication) – Persistent(RDB/AOF)
  • 5. Single Threaded #1 • Redis is Single Threaded – Can’t Process other commends during Processing a Command – Command to need long-time • O(N) Commands with Large items. – Keys, flushall, del • Redis handles Lua Script as one command. • MULTI/EXEC – Process all commands at a time when exec command is reached.
  • 6. Single Threaded #2 • It is better to execute multiple instance if you have multi-cores – Need more memory, but more reliable • CPU 4 core, 32G Memory Mem: 26G Mem: 8G Mem: 8G Mem: 8G
  • 7. Redis Event Loop #1 Client #1 Client #2 …… Client #N Redis Event Loop I/O Multiplexing Process Command Packet #1 Packet #2
  • 8. Redis Event Loop #2 • When command packet is complete, Redis process this command. – Redis is single threaded, so other code can’t be processed. • In a loop, multiple command can be processed sequentially. – Like Reactor Pattern
  • 9. How Slow? Command Item Count Time flashall 1,000,000 1000ms(1 second)
  • 10. Quiz!!! If you send “Keys *” command in Production?
  • 11. Persistent • RDB/AOF – RDB and AOF are not related. – Just They are methods to support persistent – Can use them together.
  • 12. RDB #1 • Dump memory to disk with special format. – Compressed(optional) • When RDB is created? – When It satisfied “SAVE” condition – When slave send “SYNC” command(in replication) – When user order “SAVE” or “BGSAVE” commands • Caution!!! – Don’t use default option. • Most of Failure are related with Default Save Option • It is too small to use in production. • SAVE 900 1 • SAVE 60 10000 <- every 1 minute, redis can dump it’s memory – If it is larger than “10G”
  • 13. RDB #2 • Redis Uses fork system call to make RDB – Redis can spend twice memory in creating RDB – Command Service • READ:WRITE = 8:2 – But Batch Job or Write-Back Service • If you change all keys? • Because of Copy on Write
  • 14. Copy on Write • When Parent Process fork – At that time os doesn’t copy process memory in Read Page • Copy memory page when write is occurred.
  • 15. Copy on Write #1 Process - Parent Physical Memory Page A Page B Page C
  • 16. Copy on Write #2 – Fork(), but just Read Process - Parent Physical Memory Page A Page B Page C Process - Child
  • 17. Copy on Write #2 – Fork(), After write Process - Parent Physical Memory Page A Page B Page C Copy of Page C Process - Child
  • 18. Copy on Write • Redis can spend twice memory when all memory pages are changed. • If you redis uses swap memory area. – You can experience extreme performance degradation
  • 19. AOF #1 • Append Only File • Save data as redis protocol format • After event loop, save all write command to aof file – It is cheaper than RDB, just write small data at a time. • AOF File can be larger than memory size. – It can rewrite aof file with conf – AOF rewrite also uses fork system call()
  • 20. AOF #2 • Binary Logs and WAL save the data before modifying real data. But aof save data after data modifying
  • 22. RDB/AOF Tips #1 • If you need RDB/AOF. – Using Master/Slave and apply it to slave node – Using Multiple instance • Allocating small memory to each instance • 16GB/4 Core Machine – 3 instances each instance use 3G or 4G • Schedule RDB/AOF creation in maually • Using Swap memory cause performance degradation
  • 23. RDB/AOF Tips #2 • If you need using RDB in Master node. – config set stop-writes-on-bgsave-error no – Default is yes. And If it is yes, all write commands are prohibited when creating RDB is failed. • Disk or memory, or someone kill the process. There are many reasons. MISCONF Redis is configured to save RDB snapshots, but is currently not able to persist on disk. Commands that may modify the data set are disabled. Please check Redis logs for details about the error.”
  • 25. AWS on PV. Using HVM • If you use PV type Instance in Amazon AWS – Amazon AWS uses XEN for virtualization – PV type instance has performance degradation in XEN • Depending on used memory size. • It spend more then seconds. • Just Use HVM type for REDIS 
  • 26. PV vs HVM (m3.xlarge) - ms Memory PV HVM 0 0.5 0.1 608MB 143 5 1.54G 352 13 2.31G 517 20 4.62G 1208 Not test 6.16G 1600 Not test
  • 27. PV vs HVM • In PV, fork need to copy page tables – But it is slow • So It depends on Page tables Size
  • 30. Slow Disk IO • EBS is slow Ephemeral Disk • Frequent creating RDB is bad for performance.
  • 31. Recommanded Redis Version • After 2.8.13 – It uses Jemalloc 3.6.0 – Good at Memory fragmentation. • Redis in AWS ElasticCache – 2.8.19
  • 32. Memory Fragmentation #1 • Redis depends on Memory Allocator(ex. Jemalloc) – IN memcache, it uses slab allocator and using chunk internally – Redis just calls malloc and free when it need memory allocation. • It means you can’t avoid memory fragmentation.
  • 33. Memory Fragmentation #2 • 2.6.16 and 2.8.6 – 2.4G Used memory, But rss is 12G
  • 34. Redis Monitoring name Host or Redis(info) CPU Usage, Load Host Network inbound, outbound Host Current clients max client config Redis keys count, commands count Redis Used memory, RSS Redis Disk size, io Host Expired keys, Evicted keys Redis
  • 36. Data Structure in Redis • Support Redis Collections. – K/V, list, set, sorted set, hash • Sorted Set/Hash can use special Data Type for saving Memory : ziplist Data Types Default Data Type Data Type for speed Sorted Set ziplist Skiplist Hash ziplist Dict
  • 37. Redis Dict – Redis Default Data Type • Hash Table typedef struct dict { …… dictht ht[2]; …… }dict;
  • 38. Redis Dict – Redis Default Data Type • Hash Table
  • 39. Redis Dict – Extend Hash Table #1 • Two Hash Table are in Dict. • When need extending hash table – Allocating new hash table in ht[1] – After extending, change ht[0] and ht[1], and remove ht[1]
  • 40. Redis Dict – Extend Hash Table #2
  • 41. Redis Dict – Extend Hash Table #3
  • 42. Redis Dict – Extend Hash Table #3
  • 43. Question of Redis Dict? • How to process commands during extending – Redis is Single Threaded – So If it takes long time. We can’t process others. • How to search keys during extending? – There are two hash tables
  • 44. Don’t extend hash table at a time • Extending Hash Table – Making HT[1] as twice size of HT[0] – Just move just one bucket in hash table • New items only are added in HT[1] • Searching Hash Table during Extending – Search HT[0] and HT[1] also.
  • 45. Redis Hash – Hash in Hash
  • 46. Redis Sorted Set : Skiplist • O(log(N)) • Using Level for searching speed.
  • 47. Redis Sorted Set – Find Item #1
  • 48. Redis Sorted Set – Find Item #2
  • 49. Redis Sorted Set – Find Item #3
  • 50. Redis Sorted Set – Find Item #4
  • 53. Why ziplist? • Hash and SkipList are Fast. But using much memory • If items are small. Sequential search is also not slow. – Redis uses only memory. So it is also fast. Redis.conf hash-max-ziplist-entries hash-max-ziplist-value zset-max-ziplist-entries zset-max-ziplist-value
  • 54. Ziplist 구조 zlbytes zltail zllen entry entry zlend
  • 55. Ziplist Drawback • It is for few items (not many) • Sequential Search – It will be slower, Items count are increased. • It need memory resizing when item is added. – And moving items for adding
  • 58. Redis 2.8 • Scan • Partial Sync
  • 59. Scan
  • 60. Scan • From 2.8.x – Replacement for “KEY *” • Iterating Hash table bucket • Cursor is Index of Hash Table Bucket
  • 64. Scan Tips • Redis also scans Sorted Set, Hash, and Set in the same way. – Sorted set also uses dict as dereference. • But how to scan ziplist? – It dosen’t use hash tables. – Just return all items, because it suppose that there are few items. – So, If there are too many items. It works like O(n) command그
  • 66. Redis Replication 1. Slave send “Sync” command to Master 2. Master forks to make RDB File 3. After RDB creation, Master send RDB file to Slave 4. In 3 step, Redis master save commands that received from client for replication 5. After sending RDB, Slave loads RDB file 6. Master send saving commands to slave
  • 67. Problem of Redis Repliaction • If connection is closed – Even it is very short. – Slave needs full sync. – Disk IO is expensive • Slave checks master status using polling
  • 68. Partial Sync • If connection is closed. – But it is short, so change are in replication buffer. – Avoiding full sync, just send commands in replication buffer
  • 70. Redis 3.0 • Redis Cluster • Diskless Replication(Experimental)
  • 71. Redis Cluster #1 • Minimum spec – Master 3 nodes – Slave 3 nodes – It needs total 6 nodes for operation
  • 72. Redis Cluster #2 • 16384 slots • Don’t need sentinels. • Using Redis-trib.rb to manage cluster. – Only supporitng Manully slot migration
  • 78. Redis Cluster Drawbacks • Depending on Library • Manual slot migration
  • 79. Diskless Replication • In replication, RDB file is created. – But it spends disk IO • Just send RDB data directly. – Not creating RDB file in local. – Removing time to save RDB
  • 81. Redis 3.2 • Sds header Memory size Optimization • GEO Command
  • 82. Sds header Memory size Optimization #1 • Supporting variant sds header • Adding classes for 24 bytes in Jemalloc – Changed jemalloc code in Redis deps folder
  • 83. Sds header Memory size Optimization #2 • Supporing variant sds header size. String 길이 SDS 헤더 사이즈 8bit length 3 bytes 16bit length 5 bytes 32bit length 9 bytes 64 bit length 17 bytes
  • 84. Sds header Memory size Optimization #3 There is no 24 bytes Jemalloc increases memory 2^LG_QUANTUM Change #define LG_QUANTUM 4 to #define LG_QUANTUM 3
  • 85. Sds header Memory size Optimization #4 • Changing memory size. – Tested with 1M items 적용 메모리 사용량 original 115.57M Just changing SDS size 92.69M Jemalloc new classes 77.43M
  • 87. GEO Command • GEO 관련 커맨드 추가 – GEOADD – GEOHASH – GEOPOS – GEODIST – GEORADIUS – GEORADIUSBYMEMBER