Large Objects Ruin the Party – Valkey 9 Tames Them
Blog post from Momento
Valkey 9.0 introduces significant improvements to handle large data objects in multi-tenant systems without compromising the performance of small object requests, a problem that plagued Valkey 8.1 due to blocking caused by large object fetches. The new version utilizes a reply copy avoidance mechanism, allowing the I/O threads to handle data transfers by passing a pointer reference instead of copying large objects into reply buffers, thereby avoiding the main thread blocking that previously disrupted smaller requests. This innovation ensures consistent performance even with mixed workloads, as evidenced by maintaining low latency for small objects while large data transfers occur. Additionally, the optimization can be configured via three hidden settings, providing further tuning flexibility if needed, although the default settings are suitable for most use cases. This change is part of a series of community-driven enhancements that collectively improve Valkey's efficiency, and future updates promise to further optimize the system's handling of cache workloads by offloading read commands entirely to worker threads.