Redis Engine versions and features

介紹 Redis 2.x 到 6.x 版本之間,主要新增的功能及參數。原則上的建議使用者使用最新版本的 Redis Engine,因為 Redis 會持續修正 bug 及做效能改善,所以原則上,較新版本的 Redis Engine 會優於舊版本。

Jerry’s Notes
What’s next?
4 min readMar 19, 2022

--

Redis version 6.x

6.2: Performance improvements for TLS-enabled clusters using x86 node types with 8 vCPUs or more or Graviton2 node types with 4 vCPUs or more. Support data tiering.

■ Data tiering — ElastiCache for Redis

On clusters with data tiering, ElastiCache monitors the last access time of every item it stores. When available memory (DRAM) is fully consumed, ElastiCache uses a least-recently used (LRU) algorithm to automatically move infrequently accessed items from memory to SSD. When data on SSD is subsequently accessed, ElastiCache automatically and asynchronously moves it back to memory before processing the request. If you have a workload that accesses only a subset of its data regularly, data tiering is an optimal way to scale your capacity cost-effectively.

■ For existing 6.0 clusters, you can opt-in to the next auto minor version upgrade by setting the AutoMinorVersionUpgrade parameter to yes in the CreateCacheCluster, ModifyCacheCluster, CreateReplicationGroup or ModifyReplicationGroup APIs. ElastiCache for Redis will upgrade the minor version of your existing 6.0 clusters to 6.2 using self-service updates.

Y: lazyfree-lazy-user-del

When the value is set to yes, the DEL command acts the same as UNLINK. 。(Added in 6.0 — Default: yes)

6.0:

Authenticating Users with Role Based Access Control

client-side caching and significant operational improvements

Log Delivery — ElastiCache for Redis

Redis version 5.x

■ 5.0.6 — increases node or shard limit up to 500 per a cluster.

■ Redis (cluster mode enabled) clusters can have up to 500 shards, with your data partitioned across the shards.

■ For versions below 5.0.6, the limit is 250 per cluster.

Y: lua-replicate-commands: 當關閉時,從節點只會更新”最後”在主節點執行完成的結果,預設是每一筆執行的過程,都會同步到從節點上。(version 6.0 removed- Default: yes)

■ 5.0.5 — improves availability of auto-failover clusters during all planned operations. This function will redirects traffic from a Redis replica to a primary node. Any new customer connection during DNS update and propagation will be proxied from the replica to the primary (1–2-minute duration)

■ 5.0.3 — adds dynamic network processing to enhance I/O handling (and ability to rename commands)

By utilizing the extra CPU power available in nodes with four or more vCPUs, ElastiCache transparently delivers up to 83% increase in throughput and up to 47% reduction in latency per node.

Amazon ElastiCache for Redis 5.0.3 增強了 I/O 處理,通過利用具有四個或更多 vCPU 的節點中可用的額外 CPU 處理能力,將每個節點的吞吐量提高

[+] Amazon ElastiCache for Redis 5.0.3 enhances I/O handling to boost performance:

https://aws.amazon.com/about-aws/whats-new/2019/03/amazon-elasticache-for-redis-503-enhances-io-handling-to-boost-performance/?nc1=h_ls

Parameter ‘rename-commands’ allows you to rename potentially dangerous or expensive Redis commands that might cause accidental data loss, such as FLUSHALL or FLUSHDB

■ 5.0.0 — includes Redis streams

This models ‘a log data structure’ that allows producers to append new items in real time. It also allows consumers to consume messages either in a blocking or nonblocking fashion.

Redis version 4.x

4.0.10 — Both online resizing and encryption in a single ElastiCache

■ Psync 2.0: 優化前一個版本,當主從切換後,必然執行全同步的行為。

■ 增加 LFU (Last Frequently Used) — maxmemory (Eviction) Policy.

■ redis-cli –hotkey 使用 lfu 來支援 hotkey 的尋找。

■ memory defragmentation while online (w metric ActiveDefragHits)

■ Redis 指標 ActiveDefragHits。

■ 改善內存管理 — memory defragmentation。

Asynchronous flushes and deletes. threaded operations (FLUSHDB, FLUSHALL, and UNLINK)

■ UNLINKL This command is very similar to DEL: it removes the specified keys. Just like DEL a key is ignored if it does not exist. However, the command performs the actual memory reclaiming in a different thread, so it is not blocking, while DEL is. This is where the command name comes from: the command just unlinks the keys from the keyspace. The actual removal will happen later asynchronously.

■ 非同步排清和刪除功能支援。ElastiCache for Redis 支援 UNLINK、FLUSHDB 和 FLUSHALL 等命令在與主要執行緒不同的執行緒中執行。這麼做可用非同步方式釋放記憶體,藉以提升應用程式的效能與回應時間。

Lazy delete free (UNLINK、FLUSHDB 和 FLUSHALL): 重點在於,這已可以解決刪除 bigkey 的過程中,造成 Redis 限塞。

ElastiCache for Redis 支持 UNLINK、FLUSHDB 和 FLUSHALL 等命令以從主線程在不同線程中運行。這樣做可以異步釋放內存,從而有助於提高應用程序的性能和響應速度。

[+] Supported ElastiCache for Redis versions — ElastiCache for Redis version 4.0.10 (enhanced):

https://docs.aws.amazon.com/AmazonElastiCache/latest/red-ug/supported-engine-versions.html#redis-version-4-0-10

Redis version 3.x

■ 3.2.10 — online cluster resizing to add or remove shards from the cluster while it continues to serve incoming I/O requests.

■ 3.2.6 — Support In-transit encryption and at-rest encryption

■ 3.2.4 — Support cluster mode with partitioning. EC disables ‘CLUSTER’ management commands.

■ Geospatial indexing vis GEO commands

Redis version 2.x

■ 2.8.22 — folkless save method. metrics ‘ReplicationBytes’ and ‘SaveInProgress’. Lots of features is updated in this version.

■ Support psync: 如果發生容錯移轉,由於複本會盡可能與主要節點執行部分同步,而不需進行完整同步,因此現在可以更快恢復複寫群組

■ Support folkless save method: 主要節點和複本不再需要於同步期間使用磁碟,因此可提供更快的速度。

■ Redis 2.8.22 版或更新版本不支援 Redis 組態變數 appendonly 和 appendfsync。

■ 新增 maxclients 參數。ElastiCache Redis 預設 65000 不可改。 T2/T3/T4 by node type.

■ 2.6.16 — Redis version 2.6.13 was the initial version of Redis supported by Amazon ElastiCache for Redis. Multi-AZ is not supported on Redis 2.6.13.

--

--

Jerry’s Notes
What’s next?

An cloud support engineer focus on troubleshooting with customer reported issue ,and cloud solution architecture.