{"slug": "introducing-the-valkey-large-object-module-as-fast-as-your-hardware", "title": "Introducing the Valkey Large Object Module: As Fast as Your Hardware", "summary": "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.", "body_md": "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.\n\nGPU 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).\nValkey 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.\n\nLMCache 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:\n\n| 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 | \n|---|---|---|---|---|---|\n| Kimi K2.7-Code (FP8) | 34.3 KiB | 8.6 MiB | 69 MiB | 8.6 MiB | 69 MiB | \n| Qwen3-235B-A22B (FP8) | 94 KiB | 23.5 MiB | 188 MiB | 5.9 MiB | 47 MiB | \n| Mistral-Medium-3.5-128B (FP8) | 176 KiB | 44 MiB | 352 MiB | 5.5 MiB | 44 MiB | \n\nLarger chunks mean fewer, bigger objects per prompt, and a cache hit has to move many of them quickly.\nThe [Valkey Large Object module](https://github.com/valkey-io/valkey-large-object) is built for that.\nIn [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.\nThis 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.\nHowever, the module is not limited to KV caching; it efficiently stores large binary values.\n\nThis 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.\n\nValkey 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.\n\nWe 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).\nThroughput 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.\n\n**Table 1: Performance of Valkey without the Large Object module**\n\n| Object size (MiB) | Total Gbps (GET + SET) | GET p50 / p99 (ms) | SET p50 / p99 (ms) | PING p99 / max (ms) | Evictions per second | \n|---|---|---|---|---|---|\n| 1 | 305.3 (144.5 + 160.8) | 1.0 / 1.6 | 1.4 / 3.5 | 1.2 / 440 | 18,795 | \n| 8 | 213.4 (147.9 + 65.5) | 13.8 / 22.3 | 32.0 / 52.2 | 10.4 / 228 | 955 | \n| 32 | 201.9 (136.7 + 65.2) | 46.1 / 64.7 | 83.4 / 208 | 17.4 / 239 | 238 | \n| 64 | 171.4 (110.2 + 61.2) | 77.1 / 105 | 134 / 189 | 19.5 / 226 | 112 | \n| 256 | 94.2 (47.6 + 46.6) | 352 / 396 | 373 / 430 | 37.6 / 97 | 21 | \n| 500 | 89.1 (44.1 + 45.0) | 751 / 973 | 751 / 830 | 48.5 / 253 | 11 | \n\nThe 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.\n`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.\nThe `SET` s first filled memory to the limit, and the measurement then ran with the server at the limit and evicting continuously.\nA separate connection sent a `PING` every 10 ms to show how long an unrelated small command waits.\n\nThe 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.\n\n**Figure 1: How the module handles a GET or SET**\n\n**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.\nThe bytes live in the module's segments or in a file, depending on the operating mode.\nAn object can be up to `largeobj.max-object-size` (512 MiB by default, configurable), and in `Dram` mode it must fit in one segment.\nLike a String, this is a single value data type.\n\n**Engine.** Every `GET` and `SET` blocks only the client that issues the command, in every storage and transport mode.\nThe module moves the data on its own worker threads (8 by default, `largeobj.worker-threads`) while the Valkey main thread keeps serving everyone else.\nObjects 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.\nIn `Tiered` mode the chunks pass through a bounded window of reused staging buffers, so a transfer never allocates the whole object.\n\n**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.\nSo 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.\nIn `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.\nInside each segment, the module's own allocator hands out exact-sized, 4 KiB-aligned slots.\nThe DRAM cache pool starts with one segment and adds more as it fills, up to `maxmemory`.\nIn `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.\n\n**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.\nThe module reads and writes the files with direct I/O through io_uring, so object bytes skip the operating system's page cache.\nWrites and cache misses pass through the fixed-size disk staging segment pool, which totals `largeobj.disk-staging-size` of DRAM.\nAn 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.\nWhen the disk limit or `maxmemory` is reached, a write evicts the least recently used large objects that `maxmemory-policy` allows, as core Valkey does.\n\n**Transport.** The RDMA commands use [libfabric](https://ofiwg.github.io/libfabric/).\nA client sends `BLOB.RDMA_HELLO` once per connection with its libfabric endpoint address, and the reply lists the server's addresses.\nEach `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.\nThe object bytes never travel on the Valkey TCP connection, which carries only the command and the transfer details.\nThe server starts every transfer, so a client never gets access to server memory.\n`BLOB.TCP_SET` and `BLOB.TCP_GET` carry the bytes on the normal connection and work with any client.\nThe default `EfaDirect` provider needs EFA hardware.\n\n**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.\n\nThe 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.\nThese 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.\n\n**Figure 2: Combined GET and SET throughput, stock Valkey and the module**\n\n**Table 2: Performance improvements with the Large Object module**\n\nEach cell shows stock Valkey → the module.\n\n| Object size (MiB) | Total Gbps (GET + SET) | GET p50 (ms) | GET p99 (ms) | SET p50 (ms) | SET p99 (ms) | PING p99 (ms) | \n|---|---|---|---|---|---|---|\n| 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 | \n| 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 | \n| 32 | 202 → 389 (1.9x) | 46.1 → 31.5 | 64.7 → 37.5 | 83.4 → 34.3 | 208 → 41.2 | 17.4 → 0.4 | \n| 64 | 171 → 378 (2.2x) | 77.1 → 43.8 | 105 → 54.5 | 134 → 45.6 | 189 → 56.1 | 19.5 → 0.4 | \n| 256 | 94 → 372 (4.0x) | 352 → 88.6 | 396 → 101 | 373 → 95.4 | 430 → 105 | 37.6 → 0.3 | \n| 500 | 89 → 372 (4.2x) | 751 → 178 | 973 → 193 | 751 → 185 | 830 → 195 | 48.5 → 0.3 | \n\nThe results:\n\n`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.\nTwo 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.\nThe run filled the disk first, then ran at the limit.\nThe stock results come from the [earlier section](https://valkey.io/blog/valkey-large-object-module/#what-changes-when-values-reach-hundreds-of-megabytes).\nIt is important to note that the test instances' network and storage bandwidth cap these numbers, so machines with higher limits can go much further.\n\nTable 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.\n\n**Table 3: Lower latency with the Large Object module and optimal clients**\n\n| Object size (MiB) | GET p50 / p99 (ms) | SET p50 / p99 (ms) | \n|---|---|---|\n| 1 | 0.3 / 0.5 | 0.5 / 0.8 | \n| 8 | 2.6 / 3.9 | 3.0 / 4.6 | \n| 32 | 10.4 / 13.7 | 11.6 / 15.5 | \n| 64 | 10.3 / 13.8 | 13.0 / 17.7 | \n| 256 | 41.7 / 49 | 51 / 62 | \n| 500 | 59 / 73 | 68 / 82 | \n\nTo read and write your first large object, start with the [getting started guide](https://valkey.io/topics/large-object-getting-started/).\nIt walks you through building the module and running your first commands.\nThe [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.\n`Tiered` mode expects an XFS file system and Linux 5.1 or later.\n\nThe 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:\n\n```\nvalkey-server \\\n  --port 6379 --save '' --appendonly no \\\n  --maxmemory-policy allkeys-lru \\\n  --loadmodule ./target/release/libvalkey_large_object.so \\\n  --largeobj.operating-mode Tiered \\\n  --largeobj.disk-dir /mnt/bigobj-data/lo \\\n  --largeobj.segment-size 1073741824 \\\n  --largeobj.disk-staging-size 17179869184 \\\n  --largeobj.disk-maxmemory 108000000000000 \\\n  --largeobj.fabric-provider EfaDirect\n```\n\nThe 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.\nThe TCP commands work with any client.\nThe 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.\n\nThe 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.\n\nThe 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.", "url": "https://wpnews.pro/news/introducing-the-valkey-large-object-module-as-fast-as-your-hardware", "canonical_source": "https://valkey.io/blog/valkey-large-object-module/", "published_at": "2026-11-30 01:01:01+00:00", "updated_at": "2026-11-30 15:18:51.103547+00:00", "lang": "en", "topics": ["ai-infrastructure", "large-language-models", "ai-tools"], "entities": ["Valkey", "Valkey Large Object module", "LMCache", "Kimi K2.7-Code", "Qwen3-235B-A22B", "Mistral-Medium-3.5-128B", "cachecannon"], "also_reported_by": [], "takeaway": "The Valkey Large Object module lifts single-node throughput to 372-399 Gbps at every object size and retrieves 1 MiB KV-cache objects at under 1 ms median latency, versus stock Valkey 9.2.0 dropping from 305 Gbps at 1 MiB to 89 Gbps at 500 MiB.", "recommendation": null, "alternates": {"html": "https://wpnews.pro/news/introducing-the-valkey-large-object-module-as-fast-as-your-hardware", "markdown": "https://wpnews.pro/news/introducing-the-valkey-large-object-module-as-fast-as-your-hardware.md", "text": "https://wpnews.pro/news/introducing-the-valkey-large-object-module-as-fast-as-your-hardware.txt", "jsonld": "https://wpnews.pro/news/introducing-the-valkey-large-object-module-as-fast-as-your-hardware.jsonld"}}