How a one-minute clone works
Every container on Upsun gets its own volume on a Ceph cluster. Ceph is distributed storage: think of it as network-attached disks you can map to any machine and unmap a second later. We covered the move to it in why we moved from LVM to Ceph. When you clone an environment, Ceph doesn’t copy your data. It takes a copy-on-write snapshot. At that moment, nothing is written to disk except a bit of metadata. The clone and the original share the same underlying blocks. The copying happens later, lazily. The first time you write to a given spot on the disk, Ceph writes the new block and updates the metadata so the clone stops pointing at the parent’s version. Every untouched block keeps falling through to the parent. That first write to each spot is a touch slower, because there is metadata to update, but you never notice it in practice. That’s the whole reason a terabyte clones as fast as a gigabyte. You pay only for what you change, and you pay for it at the moment you change it.The bill: walking the chain
Now clone the clone. Then clone that one. Each new environment points at its parent, which points at its parent, all the way back to the original. Reads are where this adds up. When you read a block that nobody in the chain has modified, Ceph asks the clone, then its parent, then its parent’s parent, until it finds the block or reaches the original. The deeper the chain, the more hops per read. Ceph draws a line here. The Linux kernel’s RBD driver caps the parent chain at 16 levels (RBD_MAX_PARENT_CHAIN_LEN). A clone can sit at most 15 levels below the original. Try to go deeper and Ceph refuses. It’s a hard limit, and a reasonable one: they’re trading a little flexibility for predictable read performance, which is the right call.
Some pick an even lower line. OpenStack’s Cinder defaults rbd_max_clone_depth to 5, and breaks the chain on its own once a clone would cross it, rather than riding the kernel’s 16 all the way up. It decided 5 layers of read amplification is already enough to hurt. Same mechanism, same trade-off, two teams drawing the line in different places.