4 ms·
Wasn't there an article on how Valkey rewrote Redis to multithreaded with large performance gains?
by KingOfCoders 2y ago
Wasn't there an article on how Valkey rewrote Redis to multithreaded with large performance gains?
- gregoriol 2y agohttps://thenewstack.io/valkey-is-a-different-kind-of-fork/ https://thenewstack.io/valkey-is-a-different-kind-of-fork/ says "How much faster? A lot." but doesn't provide any data nor technical details
- KingOfCoders 2y agoYes that was the one I remember, didn't remember it hadn't data :-(
- reconditerose 2y agoThis is basically the original source of the claim, https://valkey.io/blog/unlock-one-million-rps/ https://valkey.io/blog/unlock-one-million-rps/. We are working on a followup that goes more into depth about how to setup the benchmark so that is easier to reproduce.
- ManBeardPc 2y agoOf course multi-threaded is faster (more QPS) as long as there is no high contention for resources. Especially things like read-heavy workloads will see a big improvement. Single-threaded implementations have the advantage to be much simpler, robust and don't require synchronization.
- olavgg 2y agoThe biggest perf improvement in Valkey, will be RDMA for the version 8 release. See https://github.com/valkey-io/valkey/pull/477#issuecomment-2119785640 https://github.com/valkey-io/valkey/pull/477#issuecomment-21...
- LunaSea 2y agoI'm guessing that RDMA only applies for performance benchmarks of clustered / sharded Redis setups right? I would expect vertical scaling to have better performance for most use cases as you can get cheap servers with very large amounts of RAM and high number of CPU cores.
- olavgg 2y agoNo, the thing about RDMA is that it significantly lowers latency and allows for copying of data without involving the cpu. If you use RoCE, you need advanced network switches that support PFC, ECN, DCBX that allows for lossless ethernet with the ability to pause frames to see any benefit. While lossy RoCE do work on newer generation of network interfaces, it comes with quirks and may not be any faster than TCP.
- reconditerose 2y agoThe biggest per core "efficiency" improvement will come from RDMA, since IO tends to be the largest bottleneck in Redis (and now Valkey). However, if you are running with deep pipelines (sending multiple commands as a batch without waiting for responses from each commands) than the benefits of RDMA are pretty limited since the bottleneck is on command processing. Multithreading doesn't help much either. One of the strategies that is being used in the multi-threading is using CPU memory prefetching to pull memory closing to the CPU so that we aren't stalling on fetching data from main memory while executing commands. We still want to try to apply these techniques without multi-threading to improve the efficiency of single or double core installations.