High fork times can lead to master unavailability in Redis/Valkey,

Arpit Bhayani

Arpit Bhayani

Jul 03, 2025 • 1 min read


High fork times can lead to master unavailability in Redis/Valkey, which is due to the large page table that needs to be copied during a fork.

Even though the fork operation doesn’t copy the actual pages and uses copy-on-write, the page table still needs to be copied.

If the process’s memory consumption is high, the page table is relatively bigger, and copying it can take several seconds, blocking the main thread.

So, all we need to do is optimize the fork time while making sure there are no other repercussions.

Working at scale hits hard… all those OS concepts suddenly come in handy when you’re optimizing this stuff :)

Arpit Bhayani

Principal Engineer II at Razorpay - building Agent Studio, Ex-staff engg at GCP Memorystore & Dataproc, Creator of DiceDB, ex-Amazon Fast Data, ex-Director of Engg. SRE and Data Engineering at Unacademy. I spark engineering curiosity through my no-fluff engineering videos on YouTube and my courses