Comparison of Valkey and Redis DBMS performance

The results of testing the latest releases of Redis 8.0 and Valkey 8.1 DBMS are presented, in which significant performance optimizations were declared. In all tests conducted, the fork developed by the community outperformed the original project, mainly due to the implementation in Valkey of a new mechanism for multi-threaded input/output processing in asynchronous mode, transferred to the project by Amazon.

In the AWS Graviton4 c8g.2xlarge test environment with 8 VCPUs, Valkey 8.1.1 achieved a throughput of 999.8 thousand SET requests per second, while Redis 8.0 achieved a level of 729.4 thousand requests per second. Overall, Valkey's throughput was 37% higher than Redis's for SET operations and 16% higher for GET. At the same time, compared to Redis, Valkey demonstrated a 30% reduction in SET and 60% reduction in GET latency.

 Comparison of Valkey and Redis DBMS performance

A separate analysis was conducted of the change in throughput and delays depending on the number of parallel processors in the multi-threaded I/O processing mode. Up to 3 threads, Valkey and Redis show approximately equal results, but then Valkey takes the lead. With 6 threads on a system with 8 VCPUs, Valkey's performance was 678 thousand SET requests per second, and Redis's was 563 thousand requests per second with a limit of 256 simultaneous connections. When the number of connections increased to 400, Valkey's performance increased to 832 thousand SET requests per second.

 Comparison of Valkey and Redis DBMS performance

After optimizing interrupt handling in the system to reduce the number of context switches in Valkey, we managed to increase the performance to 999.8 thousand SET requests per second. The essence of the optimization came down to allocating 2 VCPUs for interrupt handling and binding the remaining 6 VCPUs to the Valkey and Redis I/O processing threads to eliminate the migration of handlers between CPUs. sudo ethtool -L ens34 combined 2 # limit the number of IRQ handlers to 2 grep ens34 /proc/interrupts # see which handlers are involved (99 and 100) echo 1 | sudo tee /proc/irq/99/smp_affinity # bind handler 99 to core 1 echo 2 | sudo tee /proc/irq/100/smp_affinity # bind handler 100 to core 2 # Start the DBMS (for Redis, change valkey/valkey:8.1.1 to redis:8.0) with container binding to CPU cores 2-7 docker run —network=»host» —rm \ —cpuset-cpus=»2-7″ valkey/valkey:8.1.1 \ —save «» —appendonly no —io-threads 6 \ —protected-mode no —maxmemory 10gb

For performance testing, the following command was used: docker run —network=»host» —rm —cpuset-cpus=»2-7″ \ valkey/valkey:8.0.1 valkey-benchmark \ -h 172.31.4.92 -p 6379 -t SET,GET -n 100000000 -c 256 \ -r 3000000 —threads 6 -d 1024

Source: opennet.ru

Add a comment