K8sCalc

observability

Grafana Resource Sizing Calculator

Calculate Grafana RAM, CPU, and storage requirements based on dashboard count, concurrent users, alert rules, and data source count.

Grafana Resource Planning for Kubernetes

Grafana has a very different resource profile from Prometheus or Loki — it's lightweight at idle but spikes aggressively when users are actively loading dashboards.

Memory Usage

RAM = base (128 MB) + concurrent_users × 50 MB + dashboards × 5 MB + alerts × 10 MB/100

Most of Grafana's memory is query result caching and active WebSocket connections.

CPU Spikes

CPU usage is query-driven. Each panel fires one or more data source queries. At peak:

  • 20-panel dashboard × 10 concurrent users = 200 simultaneous queries
  • Each query involves HTTP proxying + JSON parsing + data transformation

Set CPU limit to 4–8× the request to handle spikes without throttling.

Storage Backend Options

BackendUse case
SQLite (default)Single replica, development
PostgreSQLHA Grafana, multiple replicas
MySQLLegacy setups

Dashboard as Code

Store dashboards in Git using Grafonnet (Jsonnet) or the Grafana dashboard JSON model, synced via grafana-operator or the Helm sidecar. This eliminates PVC dependency for dashboard state.

yaml
grafana.ini:
  database:
    type: postgres
    host: postgres:5432
    name: grafana

Frequently Asked Questions

What are good Kubernetes resource limits for Grafana?

For a small team (5–10 users, 30 dashboards): requests: 100m CPU / 256Mi RAM, limits: 500m CPU / 512Mi RAM. For large orgs: requests: 250m / 512Mi, limits: 2000m / 2Gi. Always set CPU limits higher than requests — Grafana CPU spikes on dashboard loads.

Does Grafana need a persistent volume?

Yes, unless you use an external database. By default Grafana uses SQLite stored in /var/lib/grafana. For HA Grafana (multiple replicas), you must use PostgreSQL or MySQL as the backend — SQLite cannot be shared.

How do I run multiple Grafana replicas?

Switch to PostgreSQL as the database backend, enable sticky sessions on your ingress, and set GF_SERVER_ROUTER_LOGGING=true. In Helm: set replicas: 2+ and configure the database section in values.yaml.

Why does Grafana spike CPU when dashboards load?

Each panel in a dashboard fires a separate query to the data source. A dashboard with 20 panels × 5 concurrent users = 100 simultaneous queries, each of which Grafana must proxy, parse, and transform. CPU requests should have at least 4× headroom over idle.

Related Tools