Redis 6 Multithreaded I/O: Design, Implementation, and Performance Evaluation
RedisConf 2019 highlighted the introduction of multithreaded I/O in Redis 6, detailing its architecture, thread handling of network reads/writes, configuration settings, and benchmark results that show roughly double the throughput for GET/SET commands compared to the single‑threaded Redis 5.0.5.
RedisConf 2019 was held early in San Francisco (April 1‑3) to celebrate Redis's 10th anniversary, featuring over 1,600 registrants and 80 talks, including a presentation by Redis creator antirez on the new multithreaded I/O feature in Redis 6.
Historically, Redis was single‑threaded and its performance bottleneck was network I/O; two optimization directions are improving network I/O (e.g., using DPDK) and leveraging multithreading (as in Memcached). After many community requests, Redis 6 finally added multithreaded I/O.
The multithreaded I/O handles only network read/write and protocol parsing, while command execution remains single‑threaded to avoid added complexity with key, Lua, transaction, and list operation concurrency.
The I/O threads operate in a lock‑free manner: the main thread receives connections, queues read events, distributes connections to I/O threads via round‑robin, waits (spinlock) for I/O completion, then executes commands serially.
Performance testing was conducted on Alibaba Cloud Ubuntu 18.04 instances (8 CPU 2.5 GHz, 8 GB RAM). The multithreaded version was built from the unstable branch, while the single‑threaded baseline was Redis 5.0.5. Configuration added:
io-threads 4 # enable 4 I/O threads
io-threads-do-reads yes # also parse requests in I/O threadsThe benchmark command used was:
redis-benchmark -h 192.168.0.49 -a foobared -t set,get -n 1000000 -r 100000000 --threads 4 -d ${datasize} -c 256Results show that with 4 I/O threads, GET/SET throughput roughly doubled compared to the single‑threaded version. The data serve as a proof‑of‑concept rather than production‑grade metrics.
Redis 6.0 is expected to be released by the end of 2019, bringing performance, protocol, and access‑control improvements, with further work on Redis Cluster proxy for multi‑language SDK compatibility.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
Big Data Technology & Architecture
Wang Zhiwu, a big data expert, dedicated to sharing big data technology.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
