Valkey 9.2.0, the Redis-compatible key-value store, was released on 18 November 2026, and it can now take an RDB snapshot without calling fork(). We loaded 5 million keys into 9.2.0 and ran BGSAVE under a steady stream of writes, twice each way. The fork-based save copied 845 MB of memory on a 797 MB dataset. The forkless save copied none. It also ran writes at roughly half the speed of the fork-based save while it worked.
That trade is worth taking on a node that keeps 2x memory headroom just to survive a snapshot. It is not yet worth taking for replica full syncs: the same mechanism serves them, three bugs against forkless sync are still open, and we reproduced one of them on the GA build. A paused replica froze the primary for 17.9 seconds.
Why fork() was the price of every snapshot
Since the Redis days, BGSAVE has worked the same way. The server forks, the child writes the dataset to disk, and the parent keeps serving clients. The kernel shares memory pages between the two until the parent writes to one, then copies that page. On a quiet server that copy is small, and under heavy writes it can approach the size of the dataset.
JimB123, who wrote the forkless implementation, listed the costs in the design issue a year ago. Fork pauses the server while the OS builds the child's memory map, and "Times exceeding 100ms can often be seen." Under write load nearly every page can get cloned, which approaches a 2x memory requirement. So the operational rule became: provision for twice the dataset, or risk the OOM killer during a save.
At 300 GB this gets ugly. In a proposal for a different save path, a contributor measured BGSAVE taking 1102.31 seconds on an idle 300 GB dataset, with 2.28 GB of copy-on-write even with no traffic. The 9.2.0 release notes still carry a fix for "excessive copy-on-write memory during fork-based saves" under an LFU eviction policy. The cost of fork grows with how much you write while it runs.
How a save works without a child process
Forkless save keeps everything in one process. A background thread walks the keyspace and serializes each key into the RDB file while the main thread keeps executing commands. The hard part is consistency: the snapshot has to reflect the dataset at the moment BGSAVE started, while clients keep changing it.
The design gives every key an epoch. It changes whenever the key is created or modified. When a client writes to a key the background thread has not reached yet, that key is expedited: serialized out of order, before the write lands. The writing client either waits for that to happen or, for small values, the server clones the key and lets the client continue. Issue #5328 puts the clone limit at strings of up to 512 bytes.
So the cost moves from memory pages to the write path, which now synchronizes with the save thread. With writes spread evenly across the whole keyspace, as in our test, a large share of writes hit keys the thread has not reached. Our reading of the design is that this is why throughput dropped, and we did not profile it further.

Replica full syncs use the same machinery. For diskless syncs the primary streams the RDB straight to the replica socket, and PR #4797 adds a new RDB opcode, 242, so writes made during the save travel inline inside the RDB stream. That coupling, a client write waiting on a thread that is waiting on a socket, is what the open bugs below are about.
Turning it on, and the config name the release notes get wrong
Forkless is off by default and takes two settings. The first allocates the per-key metadata and can only be set at startup. The second picks the method. In valkey.conf:
forkless-infrastructure-enabled yes
forkless-policy prefer-forklessThe 9.2.0 GA release notes describe forkless saves as opt-in via forkless-infrastructure-enabled and bgsave-default-method. The second one does not exist in the shipped binary. It was renamed to forkless-policy in the full-sync PR, and the Valkey 9.2 announcement post and the bundled valkey.conf use the new name. On 9.2.0 the old one fails:
127.0.0.1:6379> CONFIG SET bgsave-default-method forkless
(error) ERR Unknown option or number of arguments for CONFIG SET - 'bgsave-default-method'Pass it on the command line, as we did, and 9.2.0 refuses to start with "Bad directive or wrong number of arguments", so you find out before any traffic arrives. The other trap is runtime-only rollout. forkless-policy is mutable, but it rejects prefer-forkless with "can only be selected when the server was started with 'forkless-infrastructure-enabled yes'", and that setting returns "can't set immutable config". Enabling forkless on a running fleet takes a restart of every node, which on a replicated setup means planning failovers.
There is no way to force forkless. prefer-forkless falls back to fork when it has to, for example when a loaded module cannot handle forkless, and the PR notes there is no require-forkless option in this release. Check what actually ran after each save:
valkey-cli INFO persistence | grep -E 'rdb_last_bgsave_type|rdb_last_cow_size'
# rdb_last_bgsave_type:forkless
# rdb_last_cow_size:0What we measured: memory goes flat, write throughput halves
The setup: two valkey/valkey:9.2.0 containers on a Podman Linux VM (8 vCPU, 10 GiB, kernel 7.2.11, on an M3 Pro), io-threads 1, persistence otherwise off. One used the defaults, the other started with the two settings above. Each loaded 5,000,000 keys with 100-byte values (797 MB of used_memory), then ran valkey-benchmark -t set -r 5000000 -d 100 -c 20 -P 16 against the same keys, so every write overwrote an existing key at random. Three seconds in, we called BGSAVE and sampled the container's anonymous memory every 100 ms until it finished. The benchmark ran in the same container, so it competed with the server for CPU. Two runs each:
| Metric | Fork (default) | Forkless |
|---|---|---|
rdb_last_cow_size | 845,201,408 / 844,869,632 bytes | 0 / 0 |
| Extra anonymous memory during the save | 806 MB / 806 MB | 9 MB / 10 MB |
latest_fork_usec | 6,839 / 7,653 | 0 / 0 |
| Save window | 3.24 s / 3.17 s | 4.72 s / 4.63 s |
| SET ops/s during the save | 796,250 / 703,520 | 373,943 / 364,268 |
| SET ops/s with no save running | 1,074,535 | 1,065,680 |
Memory came out the way the Linux Foundation announcement promised. Random overwrites across the whole keyspace are the worst case for copy-on-write, and fork duly copied more memory than the dataset reported. Forkless held the extra to about 10 MB. If your sizing rule is "never let a node pass 50% memory because of BGSAVE", 9.2 gives you a reason to revisit it for saves.
Neither the Valkey announcement nor the Linux Foundation release mentions what forkless does to write throughput. During the save, writes ran at about 47-53% of what they managed during a fork-based save, and at about a third of the no-save baseline. The save also took about 1.5 seconds longer. The fork pause itself was 7 ms here, because 800 MB is a small dataset. The 300 GB measurement from the save-path proposal above put the freeze at 4,207 ms. Our forkless runs reported latest_fork_usec:0.
Caveats. One machine, one workload and two runs each, with a benchmark client sharing the CPU and a single I/O thread. We did not test a workload that writes to a small hot set of keys, which might lose less, or multiple I/O threads, so treat the 50% as a warning about uniform write-heavy traffic, not a constant.
The 4 bytes per key is not always 4
The bundled config says forkless-infrastructure-enabled "costs 4 additional bytes per key". We filled each server with 1,000,000 keys via DEBUG POPULATE at several value sizes and divided the change in used_memory by the key count:
| Value size | Infra off | Infra on | Difference |
|---|---|---|---|
| 10 B | 57 B/key | 57 B/key | 0 |
| 32 B | 80 B/key | 81 B/key | 1 |
| 64 B | 113 B/key | 113 B/key | 0 |
| 100 B | 145 B/key | 167 B/key | 22 |
| 200 B | 273 B/key | 280 B/key | 7 |
| 500 B | 561 B/key | 568 B/key | 7 |
At 100-byte values the flag cost 22 bytes per key, a 15% jump. With the benchmark's longer key names at the same value size, the difference was zero. We did not confirm the cause. Measure used_memory on a replica with your own key shapes before you enable it on a node that is already tight on memory.
Replica full syncs: the part to leave on fork
Forkless also serves full resynchronization, which is when a new or lagging replica needs the whole dataset. prefer-forkless applies to it automatically, and it falls back to fork in several setups, per PRs #4797 and #4460:
| Your replication setup | What the full sync does |
|---|---|
| Dual-channel replication | Forks. Its RDB channel does not negotiate the inband-repl capability. |
Replica loads with repl-diskless-load swapdb | Forks, for the same reason. |
repl-compression enabled on the link | Forks. Forkless output does not support replication-stream compression yet. |
| A slot import is active when the save starts | Forks. |
| Replica needs an RDB version older than 81 | Forks. |
| A loaded module cannot handle forkless | Forks. |
Two of those rows collide with other 9.2 features. The Valkey team reports that LZ4 repl-compression cut replication bandwidth by 52% in its PR test, and if you turn that on, your full syncs keep forking whatever forkless-policy says. The same goes for anyone already on dual-channel replication. Check rdb_last_bgsave_type after a sync rather than assuming.
Where it does run, three bugs filed against forkless sync were still open on 22 November 2026:
- #5328: a replica that stops reading mid-sync can freeze the whole primary for up to
repl-timeout. A script writes a key it did not declare, and, per the report, the main thread waits on a save thread that is stuck writing to the stalled socket. - #5393:
SORT ... BY/GET ... STOREduring a diskless forkless sync leaves the replica with a different result than the primary, and it does not converge. - #5449: active hash field expiry during a socket forkless sync can leave expired fields on the replica, and
DEBUG DIGESTdoes not catch it because it skips expired fields.
We reproduced #5328 on the 9.2.0 image. The primary ran with prefer-forkless, diskless sync, repl-timeout 10 and 2,000,000 keys of 1,000 bytes. Once a fresh replica's sync started, we froze the replica's container with podman pause, waited two seconds, sent a batch of EVAL "return server.call('append', ARGV[1], 'x')" 0 key:<n> calls, then timed a PING. It took 17,896 ms. The primary's log shows the sync dying on the timeout:
# forkless-save: error writing KV pair
* forkless-save: background processor finished. 33404 items processed. ***ERROR***
# forkless-save: client(12) connection error: Connection timed out. 0 clients remain.
# forkless-save: forkless save failed. 21 seconds.Same primary, CONFIG SET forkless-policy require-fork, a fresh replica, the same pause and scripts: PING answered in 2 ms. The reporter notes that in a cluster, a freeze longer than cluster-node-timeout (15 seconds by default) gets the primary failed over, so a replica VM descheduled mid-sync is enough to trigger a failover.
Valkey maintainer madolson filed five crashes from adversarial testing against the forkless save path in September, JimB123 confirmed them and pointed to fixes for three, and the 9.2.0 notes carry a long list of forkless fixes, including corrupt snapshots from SWAPDB and from concurrent ZUNION reads. Forkless is still a new concurrency surface between client writes and a background serializer, the same shape of problem that left branches pointing at missing objects when 200 agents pushed to stock Git while background maintenance ran.
Who should turn it on now
This release follows the Postgres playbook for asynchronous I/O: Postgres 18 kept the old synchronous path as the default and made the new one a switch. Keeping require-fork as the default makes sense here. Our recommendation by situation:
| Your setup | What to do on 9.2.0 |
|---|---|
Standalone node with scheduled save points that is memory-bound | Enable it after measuring per-key overhead and write throughput during a save on your own traffic. |
| Replicas that take the backups | Best first candidate. Client writes go to the primary, so we expect a slower write path during the replica's save to show up as replication lag rather than client latency. We did not measure this. |
| Primary with replicas that full-sync over diskless replication | Keep require-fork until #5328, #5393 and #5449 close. |
| Write-heavy primary with latency SLOs and spare memory | Stay on fork. You already paid for the headroom, and fork kept writes faster in our test. |
In 9.2.0 one setting, forkless-policy, governs both saves and full syncs; the sync PR added no config of its own. A primary that serves diskless syncs takes the sync risk along with the memory win, which is why the backup replica is the clean first step. It is close to shadow testing: the replica receives the primary's real write stream, you compare rdb_last_cow_size, save duration and replication lag against a fork-based replica, and nothing a client sees depends on the result.
The Valkey team's upgrade advice applies. Don't enable new features until you are sure you won't need to downgrade. Backing out of forkless is a runtime CONFIG SET forkless-policy require-fork; only removing the per-key infrastructure needs a restart. The new compression options are stickier: an AOF base written with lz4 or zstd needs a Valkey version that can read streaming-compressed RDB.
What to watch: issue #5328 and a 9.2.x patch release that mentions forkless full sync. Until the sync bugs close, a primary on prefer-forkless ties its availability to its slowest replica, and that is the main thing standing between Valkey users and dropping the 2x memory rule.
