Under the hood
Performance
Caching, limits, and how to keep dashboards fast.
A dashboard's speed depends on how much each chart's query reads, how often it can be answered from a cache, and how many charts open at once. This page covers each, and what you can change.
What makes a chart fast
| Faster | Slower |
|---|---|
| A managed copy laid out (partitioned and clustered) by the columns filters use. | A view, or files read in place: every query re-runs the view or reads the files. |
| A filter on a date or partition column. | A chart over a whole large table with no filter. |
| A repeat view of the same chart, tenant, and filters, answered from the cache. | The first view after a load, or on a newly started instance. |
| A few fields, grouped. | Many fields, or two fields with many values each. |
A chart runs one BigQuery query, using BigQuery's fastest request path, which returns small results in one round trip.
The caches
GOAT keeps each chart's answer in the memory of each Cloud Run instance, 64 MiB by default, keyed by the chart, the tenant, the filters, and the version of the data. A kept answer comes back without a BigQuery query. BigQuery's own result cache sits behind it.
For managed copies, an answer is kept until the next load. For Live connect tables, views, and files read in place, it is kept for a window, 5 minutes by default. A dataset's Reuse answers for setting changes that window: shorter shows changes sooner, longer queries less. See Costs.
One instance always stays warm, so its cache stays filled. Extra instances started for busy times begin with empty caches.
Opening a dashboard
An embedded dashboard reads each chart's data as the chart comes near the visible part of the page, so a long dashboard does not query its lower charts until a viewer scrolls to them. A page can load every chart at once instead; see Embed options.
There is no limit on the number of charts on a dashboard. Each chart that misses the cache is one query, and counts against the request ceilings below.
Request ceilings
| Ceiling | Default | Applies to |
|---|---|---|
| Chart, metric, and rows queries that miss the cache | 300 a minute, bursts of 40 | Each tenant's viewers together; each operator. |
| Filter value lists | 120 a minute, bursts of 20 | The same. |
| Viewer tokens | 300 a minute | Each API key. |
A request over a ceiling is answered 429 with Retry-After; an embedded chart retries up to twice. A large dashboard opened cold may pass the burst, and its last charts then load a moment later. The ceilings are kept per Cloud Run instance.
Changes reach viewers within a minute
GOAT keeps the records behind embedded dashboards (published state, access, tenants, charts) for up to 60 seconds by default. A publish, an unpublish, a change of access, a suspended tenant, or an edited chart reaches viewers within that time.
Instances and their size
An install runs one instance at all times, with 1 CPU and 512 MiB of memory, and starts more under load, up to 10 by default. GOAT spends most of its time waiting on BigQuery and Firestore rather than computing, so more CPU rarely helps; more instances help with many viewers at once. Whoever runs the install sets these when installing.
Checklist for a slow dashboard
- Check whether its datasets are views or files read in place. Make a managed copy.
- Check that its filters use a date or partitioned column.
- Check the dataset's Reuse answers for setting.
- Check how many charts open at once, and whether the page loads them all eagerly.
- If viewers see charts load a moment late on a large dashboard, the request ceiling's burst was reached. That is expected and recovers by itself.