storage
Longhorn Storage Calculator
Calculate the total storage required for Longhorn distributed block storage, including replica overhead, snapshot retention, and S3 backup sizing on Hetzner Object Storage.
Understanding Longhorn Storage Architecture
Longhorn is a CNCF project providing distributed block storage for Kubernetes. It creates replicated volumes that survive node failures, similar to how RAID works but distributed across the cluster.
How Longhorn Replication Works
When you create a Longhorn volume with 3 replicas, Longhorn stores a full copy on 3 different nodes. Each replica is kept in sync synchronously on write. If a node fails, Longhorn rebuilds the missing replica on another healthy node.
Storage Formula
Total local disk needed = (raw data × replicas) + (snapshots × change rate × retention)
Example: 100 GB data, 3 replicas, 1 snapshot/day, 7-day retention, 30% change rate:
- ›Replicas: 100 × 3 = 300 GB
- ›Snapshots: 100 × 0.3 × 7 = 21 GB
- ›Total: ~321 GB across the cluster (~107 GB per node)
Snapshot vs Backup
Longhorn has two distinct data protection mechanisms:
- 1.Snapshots — stored locally on the same disk as the volume. Fast but not offsite.
- 2.Backups — incremental uploads to S3 (or NFS). True disaster recovery.
Recommended Production Setup
For production, use both: local snapshots for fast recovery from accidental deletion, S3 backups for disaster recovery. Configure Hetzner Object Storage as the backup target — it costs ~€1/GB/month at scale.
Frequently Asked Questions
How much extra storage does Longhorn use for replicas?
Longhorn uses full copies for each replica — 3 replicas means 3× your raw data size. Snapshots add approximately 10–30% overhead depending on data change rate and retention period.
Does Longhorn backup to S3 compress the data?
Yes. Longhorn uses incremental backups with compression. The S3 backup size is typically 1.0–1.5× your raw data size (not 3×), since it only stores one copy to S3.
What is the Longhorn recommended minimum disk per node?
Each worker node participating in Longhorn should have at minimum (raw data size × replica factor / node count) + 20% headroom. For 3 nodes with 3 replicas and 100 GB data: each node needs ~35–40 GB for Longhorn volumes.
Can I use Hetzner Object Storage as Longhorn backup target?
Yes. Hetzner Object Storage is S3-compatible and works directly as a Longhorn backup target. Pricing is €0.0119/GB/month, making it very cost-effective for daily incremental backups.