Introducing the Valkey Large Object Module: As Fast as Your Hardware The Valkey Large Object module sustained 372-399 Gbps of reads and writes on a single node at every object size, Valkey reported, versus stock Valkey 9.2.0 over TCP whose throughput fell from 305 Gbps at 1 MiB to 89 Gbps at 500 MiB. The module targets distributed KV caching for large language model inference, where LMCache stores 256-token prompt chunks as objects ranging from 8.6 MiB for Kimi K2.7-Code (FP8) to 44 MiB for Mistral-Medium-3.5-128B (FP8), and it retrieves 1 MiB objects at a median latency under 1 ms and 32 and 64 MiB objects at about 10 ms. The post is the first of three on distributed KV caching with Valkey. Large objects show up in a wide range of applications, from video and audio files to, more recently, the KV attention states of large language models LLMs . An LLM reads the whole prompt before it answers. For every token, at every layer, it computes a key vector and a value vector that later tokens use to decide what to pay attention to. Those saved vectors are the KV cache. If a later request starts with the same text, such as a shared system prompt, a long document or the earlier turns of a conversation, the inference engine can load the saved KV cache instead of computing it again, which saves GPU time and shortens the time to the first token. GPU memory is too small to keep every cache, so inference stacks keep them in tiers: GPU memory, then the host's memory, then a shared store that every GPU server can read, managed by tools such as LMCache https://github.com/LMCache/LMCache . Valkey can be that shared store, and a Valkey cluster scales its capacity independently of the GPU servers, as KV caching on Valkey https://valkey.io/blog/kv-caching-on-valkey/ shows for a fleet of GPU servers. LMCache splits a prompt into chunks, 256 tokens by default, and stores each chunk as one object. The size depends on the model and the chunk size: | Model | Cache per token | 256-token chunk | 2,048-token chunk | 256-token chunk, per GPU across 8 GPUs | 2,048-token chunk, per GPU across 8 GPUs | |---|---|---|---|---|---| | Kimi K2.7-Code FP8 | 34.3 KiB | 8.6 MiB | 69 MiB | 8.6 MiB | 69 MiB | | Qwen3-235B-A22B FP8 | 94 KiB | 23.5 MiB | 188 MiB | 5.9 MiB | 47 MiB | | Mistral-Medium-3.5-128B FP8 | 176 KiB | 44 MiB | 352 MiB | 5.5 MiB | 44 MiB | Larger chunks mean fewer, bigger objects per prompt, and a cache hit has to move many of them quickly. The Valkey Large Object module https://github.com/valkey-io/valkey-large-object is built for that. In our benchmark https://valkey.io/blog/valkey-large-object-module/ how-fast-it-runs , one node sustained 372-399 Gbps of reads and writes at every object size. This allows all the models in the table above to set up distributed KV caching workloads that retrieve KV objects with a median latency under 1 ms for 1 MiB objects and about 10 ms for 32 and 64 MiB objects. However, the module is not limited to KV caching; it efficiently stores large binary values. This is the first of three posts on distributed KV caching with Valkey. It covers what changes in in-memory key-value datastores when values reach hundreds of megabytes, and how the Valkey Large Object module improves performance for such large objects. Valkey is built for small values, typically a few hundred bytes. Commands run on the main thread while other clients wait, and every byte goes through the TCP stack and the server's network buffers. With small values, the Valkey CPU is typically not the bottleneck as it's able to serve each request quickly. We measured stock Valkey 9.2.0 over TCP, with every value held in DRAM, on one i8ge.48xlarge maxmemory 640gb , allkeys-lru , 8 I/O threads . Throughput fell from 305 Gbps at 1 MiB to 89 Gbps at 500 MiB, and a PING from another connection took 1.2-48 ms at p99 and up to 440 ms. Table 1: Performance of Valkey without the Large Object module | Object size MiB | Total Gbps GET + SET | GET p50 / p99 ms | SET p50 / p99 ms | PING p99 / max ms | Evictions per second | |---|---|---|---|---|---| | 1 | 305.3 144.5 + 160.8 | 1.0 / 1.6 | 1.4 / 3.5 | 1.2 / 440 | 18,795 | | 8 | 213.4 147.9 + 65.5 | 13.8 / 22.3 | 32.0 / 52.2 | 10.4 / 228 | 955 | | 32 | 201.9 136.7 + 65.2 | 46.1 / 64.7 | 83.4 / 208 | 17.4 / 239 | 238 | | 64 | 171.4 110.2 + 61.2 | 77.1 / 105 | 134 / 189 | 19.5 / 226 | 112 | | 256 | 94.2 47.6 + 46.6 | 352 / 396 | 373 / 430 | 37.6 / 97 | 21 | | 500 | 89.1 44.1 + 45.0 | 751 / 973 | 751 / 830 | 48.5 / 253 | 11 | The workload: Two c8gn.16xlarge clients drove it with cachecannon https://github.com/cachecannon/cachecannon and a 10-second request timeout, using an equal number of GET and SET connections per client: 16 each at 1 and 8 MiB, 12 each at 32 MiB, 8 each at 64 MiB, and 4 each at 256 and 500 MiB. GET s read a 64 GiB hot set that was filled beforehand, so almost every GET finds its key, and SET s always write new keys, so none overwrites an existing value. The SET s first filled memory to the limit, and the measurement then ran with the server at the limit and evicting continuously. A separate connection sent a PING every 10 ms to show how long an unrelated small command waits. The Valkey Large Object module is a Valkey module written in Rust that adds a data type and commands optimized for large binary values. It needs Valkey 8.0 or later on Linux. Figure 1: How the module handles a GET or SET Data type. A Large Object data type holds a small descriptor, not the object's bytes: an object ID, the length and a CRC32C checksum. The bytes live in the module's segments or in a file, depending on the operating mode. An object can be up to largeobj.max-object-size 512 MiB by default, configurable , and in Dram mode it must fit in one segment. Like a String, this is a single value data type. Engine. Every GET and SET blocks only the client that issues the command, in every storage and transport mode. The module moves the data on its own worker threads 8 by default, largeobj.worker-threads while the Valkey main thread keeps serving everyone else. Objects are streamed in chunks 1 MiB by default, largeobj.chunk-size , up to 64 at a time largeobj.max-buffers-per-op , and each chunk moves on as soon as its source has produced it, so network and disk transfers overlap. In Tiered mode the chunks pass through a bounded window of reused staging buffers, so a transfer never allocates the whole object. Memory. Data sent or received over EFA must sit in memory registered with the EFA network card, and registering is too slow to do on every transfer. So the module allocates memory from Valkey in large segments 1 GiB each by default, largeobj.segment-size , which count toward used memory and maxmemory , and registers each segment when it is created. In Tiered mode the segments are registered with io uring as well, for performance, so the kernel pins their pages once instead of on every disk read and write, and one buffer serves the network and the disk without a copy. Inside each segment, the module's own allocator hands out exact-sized, 4 KiB-aligned slots. The DRAM cache pool starts with one segment and adds more as it fills, up to maxmemory . In Dram mode it holds every object, and in Tiered mode it acts as a read cache, next to the fixed-size disk staging segment pool described below. Disk. In Tiered mode every object is a file on block storage, such as local NVMe or network-attached block storage like Amazon EBS, and DRAM is a read cache. The module reads and writes the files with direct I/O through io uring, so object bytes skip the operating system's page cache. Writes and cache misses pass through the fixed-size disk staging segment pool, which totals largeobj.disk-staging-size of DRAM. An object is copied into the DRAM cache on its first read by default, and when the cache is full, less frequently used copies are dropped while the objects stay on disk. When the disk limit or maxmemory is reached, a write evicts the least recently used large objects that maxmemory-policy allows, as core Valkey does. Transport. The RDMA commands use libfabric https://ofiwg.github.io/libfabric/ . A client sends BLOB.RDMA HELLO once per connection with its libfabric endpoint address, and the reply lists the server's addresses. Each BLOB.RDMA GET or BLOB.RDMA SET then lists one or more remote addresses in the client's registered memory, each with its memory key and length, in one registered region or several, and the server writes to or reads from them directly. The object bytes never travel on the Valkey TCP connection, which carries only the command and the transfer details. The server starts every transfer, so a client never gets access to server memory. BLOB.TCP SET and BLOB.TCP GET carry the bytes on the normal connection and work with any client. The default EfaDirect provider needs EFA hardware. Integrity. BLOB.RDMA SET can send a CRC32C checksum that the server verifies, and BLOB.RDMA GET returns the stored checksum and the length so the client can verify what it received. The module kept 372-399 Gbps of combined GET and SET throughput at every object size from 1 MiB to 500 MiB, 1.2x to 4.2x stock Valkey, while a PING to the same server stayed under 0.4 ms at p99. These are results from one i8ge.48xlarge server in Tiered mode over RDMA with AWS Elastic Fabric Adapter EFA , measured at the disk limit where every SET evicts the oldest objects. Figure 2: Combined GET and SET throughput, stock Valkey and the module Table 2: Performance improvements with the Large Object module Each cell shows stock Valkey → the module. | Object size MiB | Total Gbps GET + SET | GET p50 ms | GET p99 ms | SET p50 ms | SET p99 ms | PING p99 ms | |---|---|---|---|---|---|---| | 1 | 305 → 372 1.2x | 1.0 → 1.3 | 1.6 → 2.1 | 1.4 → 1.5 | 3.5 → 2.8 | 1.2 → 0.2 | | 8 | 213 → 399 1.9x | 13.8 → 10.6 | 22.3 → 15.2 | 32.0 → 10.8 | 52.2 → 16.2 | 10.4 → 0.2 | | 32 | 202 → 389 1.9x | 46.1 → 31.5 | 64.7 → 37.5 | 83.4 → 34.3 | 208 → 41.2 | 17.4 → 0.4 | | 64 | 171 → 378 2.2x | 77.1 → 43.8 | 105 → 54.5 | 134 → 45.6 | 189 → 56.1 | 19.5 → 0.4 | | 256 | 94 → 372 4.0x | 352 → 88.6 | 396 → 101 | 373 → 95.4 | 430 → 105 | 37.6 → 0.3 | | 500 | 89 → 372 4.2x | 751 → 178 | 973 → 193 | 751 → 185 | 830 → 195 | 48.5 → 0.3 | The results: PING from a separate client waited at most 0.4 ms at p99 with the module, against 1.2-48 ms with stock Valkey. SET s, and it rejected none at any size. GET reads from NVMe, The workload: The server had a 108 TB disk limit on 16 instance-store NVMe drives striped under XFS. Two c8gn.16xlarge clients drove it over EFA with cachecannon https://github.com/cachecannon/cachecannon , using the same workload as the stock run: the same number of GET and SET connections per client, GET s over a 64 GiB hot set, and SET s of new keys at the same time. The run filled the disk first, then ran at the limit. The stock results come from the earlier section https://valkey.io/blog/valkey-large-object-module/ what-changes-when-values-reach-hundreds-of-megabytes . It is important to note that the test instances' network and storage bandwidth cap these numbers, so machines with higher limits can go much further. Table 3 is a separate run at lower concurrency. Each of the two clients ran 4 GET and 4 SET connections at 1 to 32 MiB, 2 and 2 at 64 and 256 MiB, and 1 and 1 at 500 MiB. With fewer requests in flight, the module's latency is lower than in Table 2. Table 3: Lower latency with the Large Object module and optimal clients | Object size MiB | GET p50 / p99 ms | SET p50 / p99 ms | |---|---|---| | 1 | 0.3 / 0.5 | 0.5 / 0.8 | | 8 | 2.6 / 3.9 | 3.0 / 4.6 | | 32 | 10.4 / 13.7 | 11.6 / 15.5 | | 64 | 10.3 / 13.8 | 13.0 / 17.7 | | 256 | 41.7 / 49 | 51 / 62 | | 500 | 59 / 73 | 68 / 82 | To read and write your first large object, start with the getting started guide https://valkey.io/topics/large-object-getting-started/ . It walks you through building the module and running your first commands. The configuration guide https://valkey.io/topics/large-object-configuration/ covers storage and monitoring settings, and the use cases https://valkey.io/topics/large-object-use-cases/ show where else the module fits. Tiered mode expects an XFS file system and Linux 5.1 or later. The benchmark above ran with this command, on an i8ge.48xlarge with its 16 NVMe drives striped under XFS, and with maxmemory unset so the DRAM cache grew as needed: valkey-server \ --port 6379 --save '' --appendonly no \ --maxmemory-policy allkeys-lru \ --loadmodule ./target/release/libvalkey large object.so \ --largeobj.operating-mode Tiered \ --largeobj.disk-dir /mnt/bigobj-data/lo \ --largeobj.segment-size 1073741824 \ --largeobj.disk-staging-size 17179869184 \ --largeobj.disk-maxmemory 108000000000000 \ --largeobj.fabric-provider EfaDirect The Valkey Large Object module is open source, and Valkey Large Object 0.1 https://github.com/valkey-io/valkey-large-object/releases/tag/0.1 is available now. The TCP commands work with any client. The RDMA commands need a client that implements the libfabric flow; Valkey GLIDE's Python sync client supports them from valkey-glide-sync 2.6.0. The second post in this series compares Valkey deployments for KV caching, over the network and on the GPU servers themselves, and shows how each performs against other object stores. The third goes deeper into model and inference architectures and how to configure Valkey for your inference setup. The module was developed with contributions from Karthik Subbarao https://github.com/KarthikSubbarao , Cameron Zack https://github.com/zackcam , Neeraj Ramachandran https://github.com/neerajr0 , Anita Ruangrotsakun https://github.com/anitarua , Nadav Levanoni https://github.com/nadav-levanoni , Kenny Chamberlin https://github.com/kvcache , Kevin McGehee https://github.com/kevinmcgehee and Muhammad Ibrahim https://github.com/ibrahimnd2000 . Thanks also to everyone who shaped the design, to those who added support for the module in Valkey GLIDE and to those who built the LMCache integration.