1、redis- redis Q&A - - readwriteTBredis1.0: 2.0: ssd3.0: reshardingredis eredis counterservice ssd redrocks counterservice phantom rediseredis - counterservice - phantom75%+80%+1-2ssdssd - redis - TB (GB/) 6 - / : ms - counterservice_ssd lru & - GB - TB redisstringhashlistset - - pika redis rocksdb -
2、pika disk-basedvs ms KV vs delcompact vs vs luadb - - hashlistsetzset / : ms - redrocks/redrocks - all key in mem? rocksdb or kv or key(pika)? worker or worker + io or eredis redrocks - hotwarmcoldLRU memssdredisDBSlot Map“hot” data rocksdbBloom FilterMemoryDiskSwap in/out rdb LRU/ : compact filterR
3、DBRocksdb“cold” dataAOFHDDSSDredrocks - + Main ThreadBackgroud Thread Replicationslave BIo: aoflazyfreeConnect HandlerProtocol ParseReplicationBioExpire Data Swap(io): EvictionData SwapCommand Processredrocks - Main Thread io + pipe NotifyIO Job Queue LRUValue syncasync keyIO Thread Pool bloomfilter
4、io luaswap inswap outRocksdb on SSDredrocks - bloomfiltercuckoofilterredrocks - cuckoofilterGithubLanguageHashInsertRedrocksc+https:/ - cuckoofilterFilterHashSlot+VictimsBucketredrocks - rocksdb max_background_compactions level0_slowdown_writes_triggerlevel0_stop_writes_trigger compaction_readahead_
5、size write_buffer_sizemax_write_buffer_number target_file_size_basemax_bytes_for_level_base max_cache_files disable_walredrocks - & fork rdb + rocksdb checkpoint + aof + masterslave1syncsyncfrom3:1001RocksdbCheckpointredrocks - Main ThreadBackgroud ThreadConnect HandlerReplicationBioExpireProtocol P
6、arseCommand Processkey in memEvictionkey in diskData Swapswap outswap inDataMemorySSDRedisDB “hot data”Rocksdb “cold data”PersistenceRDBRocksdb CheckpointAOFredrocks - key (string)redis - redis - redisservice 2.0 resharding redis - redisservice 2.0 : pre-sharding slots proxy2-phase commit slot - key sloterediscounterservicephantomcounterservice ssdredrockspikassdredisredisservice Q&A