Reduce costs and increase performance with query caching in Grafana Cloud
Now, when the same query is submitted repeatedly, the results will come back from the cache rather than the data source itself. This not only lowers load times for popular dashboards, but will also reduce API costs for your data sources and decrease the likelihood that those APIs will rate-limit or throttle requests.
Here’s one common scenario in which query caching can have a great impact on organizations. For many of our users, Black Friday and Cyber Monday are the busiest days of the year, when dashboards are being viewed by everyone across the org. On these mission-critical days, it’s vital that time is not lost waiting for a dashboard to load. With query caching:
- The total wait time can be reduced by 79.2% across 100 team members for a dashboard that takes 5 seconds to load.
- After the first person loads the dashboard, all subsequent load times go down to just 1 second.
- This will also reduce the operational costs for the day, by lowering the number of API calls by 99%.
How to enable query caching
- Google Cloud Monitoring
- Microsoft SQL Server
To enable query caching on a supported data source, navigate to the data source and click on the Cache tab. (If the cache tab is not shown, the data source does not support caching.) Within the cache tab, click Enable.
Once the feature is enabled, you can choose how often the data should be refreshed by updating the Time to Live (TTL) or by keeping the default TTL of 5 minutes. If you want a data source to have a long time to live, but want a particular panel in a dashboard to refresh more often, you can do that too! Simply increase the Max Data Points in the panel’s query options.
You’ll notice an information icon showing up next to the title of the panel, indicating that it is showing a cached response.
From there, enjoy the faster dashboard load times and lower API costs!
Query caching is available now for all Grafana Cloud Pro and Advanced users. If you’re not already using Grafana Cloud Pro or Advanced, sign up now for your free 14-day Pro trial or upgrade your subscription in the cloud portal under Billing/Manage Subscriptions.
Stay tuned for more content on new and exciting features coming to the Grafana Cloud Pro and Advanced tiers. And tell us what you’d like to see! You can chat with the Cloud team on our Grafana Cloud Community Slack.