Skip to main content
⎈K8sCalc

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.

✓Content reviewed Jul 18, 2026

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.1

S3 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:

yaml
storage_config:
  aws:
    s3: s3://hetzner-fsn1/loki-chunks
    endpoint: fsn1.your-objectstorage.com

Reducing Log Volume

Drop noisy logs at the Promtail/Alloy level before they reach Loki:

yaml
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.

InputValue
Pod Count50
Log Rate per Pod100 MB/day
Compression Ratio8× — typical JSON/text (default)
Retention Period14 days
S3 Backend (Hetzner Object Storage)?No — local disk only
ResultValue
Local disk needed10 GB
Loki RAM (ingester+query)2.0 GB
Raw logs per day4.88 GB
Compressed per day0.61 GB
Ingester RAM1.0 GB
Querier RAM1.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.

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

Related Generators

Related Guides