DEV Community

Cover image for Cloning a terabyte in under a minute: the real limits of copy-on-write ⚡
Flora Brandão for Upsun

Posted on

Cloning a terabyte in under a minute: the real limits of copy-on-write ⚡

Replicating massive production environments quickly is a common challenge when you need to test changes without waiting hours for data syncs. It often feels like a balancing act between speed and infrastructure constraints.

Here is how you can manage the engineering trade-offs of rapid cloning:

  • The problem: When using Ceph copy-on-write to clone environments instantly, you eventually hit a strict 16-level clone-depth limit.
  • The fix: Overcoming this constraint requires flattening the chain, which introduces its own architectural costs.
  • Why it matters: Understanding how walking the chain affects your system helps you navigate the balance between rapid depth and broader scalability.

Want to explore the details of how a one-minute clone works and what nothing is free means for your architecture? Check out the full technical write-up here:

Cloning a terabyte in a minute, and the limit hiding behind it - Upsun Developer

Upsun clones a terabyte production environment in under a minute using Ceph copy-on-write. Here is the 16-level clone-depth limit behind it, why flattening is the price you pay, and what it says about engineering trade-offs.

favicon developer.upsun.com

Top comments (2)

Collapse
 
luis_cruzy profile image
Luis Cruzy

I've worked on similar projects where we had to clone large datasets quickly, and I can attest to the challenges of balancing speed and infrastructure constraints. The 16-level clone-depth limit with Ceph copy-on-write is a real concern, and flattening the chain can indeed introduce additional architectural costs. I'm curious to know more about the specific trade-offs you've encountered when walking the chain and how you've navigated them in your own projects. Do you have any recommendations for monitoring the clone depth and identifying potential bottlenecks in the cloning process?

Collapse
 
ralt profile image
Florian Margaine

Honestly, I'd say the biggest recommendation is to have a system where you don't end up hitting this clone-depth limit very often if ever. In our case, we simply flatten and move on, because we know that for our use case, we almost never hit this point, so developer experience during this scenario is not a huge concern.

As for monitoring, if you don't encounter this scenario very often to begin with, then it's not really something to directly monitor. We do monitor developer experience metrics, such as deployment times, so we would transiently see this if it were to pop up more often.