observability
Loki Log Storage Calculator
Calculate Grafana Loki disk, S3 storage, and RAM requirements based on pod count, log rate, compression ratio, and retention period.
Related tool
K8s Cluster Cost
Calculate the monthly cost of running a self-managed Kubernetes cluster on Hetzner Cloud, Vultr, or DigitalOcean. Choose server types for control planes, workers, and load balancers with HA mode.
Sizing Grafana Loki for Kubernetes
Loki stores logs in two places: an index (labels only) and compressed chunks (raw log lines). This split is what makes Loki dramatically cheaper than Elasticsearch.
Storage Architecture
Raw logs → Promtail/Alloy → Loki Ingester (RAM) → chunks → disk or S3
→ index → BoltDB / DynamoDB / etc.Sizing Formula
compressed_gb_per_day = (pods × log_rate_mb_per_pod) / 1024 / compression_ratio
total_disk = compressed_gb_per_day × retention_days × 1.1S3 Backend Setup (Hetzner)
With the S3 backend, Loki ingesters only keep ~1–2 days of data locally (the "flush window"). Everything else lives in object storage:
storage_config:
aws:
s3: s3://hetzner-fsn1/loki-chunks
endpoint: fsn1.your-objectstorage.comReducing Log Volume
Drop noisy logs at the Promtail/Alloy level before they reach Loki:
pipeline_stages:
- drop:
expression: "health|readiness|liveness"This can cut log volume 30–60% for typical Kubernetes clusters with frequent health check endpoints.
Worked example: Loki Storage
What the calculator returns for its default inputs — change any value in the form above to recalculate.
| Input | Value |
|---|---|
| Pod Count | 50 |
| Log Rate per Pod | 100 MB/day |
| Compression Ratio | 8× — typical JSON/text (default) |
| Retention Period | 14 days |
| S3 Backend (Hetzner Object Storage)? | No — local disk only |
| Result | Value |
|---|---|
| Local disk needed | 10 GB |
| Loki RAM (ingester+query) | 2.0 GB |
| Raw logs per day | 4.88 GB |
| Compressed per day | 0.61 GB |
| Ingester RAM | 1.0 GB |
| Querier RAM | 1.0 GB |
How the calculation works
- ›Raw logs per day = pods × MB per pod per day.
- ›Compressed per day = raw ÷ compression ratio (Loki chunks typically compress 5–10×).
- ›With an S3 backend, object storage holds compressed logs × retention days, and local disk only needs ~2 days of compressed data for the WAL and caches. Without S3, local disk holds the whole retention period + 10%.
- ›Ingester RAM ≈ 1.5 × one 15-minute window of compressed logs (minimum 1 GB); querier RAM ≈ 10 MB per pod (minimum 0.5 GB).
- ›Object storage cost uses Hetzner Object Storage pricing (€0.0119 per GB-month).
Label cardinality matters as much as volume: keep labels to namespace, app and similar low-cardinality values.
Key Terms
Full glossary →Loki
A horizontally scalable log aggregation system by Grafana Labs. Unlike Elasticsearch, Loki only indexes metadata labels, storing log content as compressed chunks in object storage.
Prometheus
An open-source metrics and alerting system. Prometheus scrapes metrics from Kubernetes components and applications, stores them in a time-series database (TSDB), and evaluates alert rules.
Frequently Asked Questions
How much does Loki compress log data?
Loki uses snappy compression on log chunks before storing them. Typical JSON logs from Kubernetes compress 6–10×. A cluster producing 10 GB/day raw logs will need ~1–2 GB/day of storage.
Should I use S3 backend for Loki?
Yes, for any retention >7 days. With S3 backend (Hetzner Object Storage at €0.0119/GB/mo), you avoid large PVCs and get unlimited retention at low cost. Local disk is simpler for development clusters.
How is Loki different from Elasticsearch for logs?
Loki only indexes log labels (namespace, pod, container) — not the log content. This makes it 5–10× cheaper in storage and RAM. The trade-off: full-text search is slower (scans chunks rather than an inverted index). For Kubernetes log tailing and label-based filtering, Loki is sufficient.
What's the difference between Loki ingester RAM and querier RAM?
Ingesters hold unflushed log chunks in memory (~15 min of data) before writing to disk/S3. Querier RAM is used for executing LogQL queries and caching recent results. For small clusters, a single-binary Loki deployment consolidates both.
Related Tools
Observability Sizing
Size your Prometheus, Grafana, Loki, and Alertmanager stack. Calculate RAM, disk, and CPU requirements based on your cluster size and retention period.
Prometheus Storage
Calculate Prometheus disk and RAM requirements based on active time series count, scrape interval, and retention period. Includes TSDB head, WAL, and chunk cache sizing.
Tempo Storage
Calculate Grafana Tempo or Jaeger distributed tracing storage requirements. Size disk, S3, and RAM based on spans/sec, bytes per span, sampling rate, and retention.
K8s Cluster Cost
Calculate the monthly cost of running a self-managed Kubernetes cluster on Hetzner Cloud, Vultr, or DigitalOcean. Choose server types for control planes, workers, and load balancers with HA mode.
Grafana Sizing
Calculate Grafana RAM, CPU, and storage requirements based on dashboard count, concurrent users, alert rules, and data source count.