Grafana dashboard becomes unresponsive and heap memory increases with large dynamic panel repetition

I’m facing a performance issue in Grafana when using highly dynamic dashboards.

Setup

  • I am dynamically generating dashboard rows using template variables
  • Panels are also created using the repeat option (based on another variable)
  • Example flow:
    • Sensors → each sensor creates rows dynamically
    • Channels → each row repeats panels based on channel variable
  • Panels with no data are automatically hidden using query conditions

Expected Behavior

  • Dashboard should scale based on available sensors/channels
  • Panels with no data should remain hidden
  • UI should remain responsive even with large datasets

Actual Issue

When the number of sensors/channels increases:

  • The dashboard UI becomes very slow / unresponsive
  • Browser tab starts lagging heavily
  • JavaScript heap memory usage increases significantly (around 500–600 MB+)
  • Eventually the page may freeze or take too long to render

Observations

  • The issue only appears when a large number of panels are generated via repeat variables
  • Smaller datasets work fine
  • Problem seems related to client-side rendering overhead from too many repeated panels

Questions

  • Is there any recommended limit for repeated panels in Grafana?
  • Are there any best practices to handle large dynamic dashboards more efficiently?
  • Any way to reduce heap usage or improve rendering performance in such cases?

Any suggestions or similar experiences would be really helpful.

Repeating panels multiplies queries exponentially → 10 sensors × 4 panels × 2 queries = 80 simultaneous queries, which overwhelms the browser.
Grafana has no built-in panel limit for repeat variables → it renders everything the variable returns, which is why heap climbs to 500–600MB and the page freezes.

No official limit exists. Community experience shows performance degrades significantly beyond 50–100 total rendered panels.

Fix :
Limit variable selections
In your Sensors variable settings → uncheck Include All option OR set a Custom all value using a wildcard regex instead of selecting everything. This prevents all sensors loading simultaneously.

Use Prometheus recording rules
Pre-compute heavy PromQL queries so panels fetch pre-aggregated results instead of computing on every load. This reduces query execution time significantly.

Increase refresh interval
Set minimum 60s auto-refresh when many panels are active.

Restructure your architecture
Instead of Sensors → rows → Channels → repeated panels on one dashboard: