Hello!
I'm new to metabase and want to create a fast loading dashboard. However, some of my questions take 30s-50s to execute. I have tried to set a reasonable value for the cache to decrease execution time, but the caching doesn't help since as its stated in the logs that the Query itself just take 1 second to run. How can I decrease the execution time? More memory, CPU,...??
When I change the setting 'Group by week' to 'Group by day' then the question is loaded within 2 seconds.
This is the query of dashboard and some questions:
4e7d4b99-92d4-4312-a1d5-683d323a5adf] 2022-10-16T17:36:52+02:00 INFO metabase.query-processor.card Question's average execution duration is 40.7 s; using 'magic' TTL of 8.1 hours 💾
[4e7d4b99-92d4-4312-a1d5-683d323a5adf] 2022-10-16T17:37:06+02:00 INFO metabase.query-processor.middleware.cache Query took 318.0 ms to run; minimum for cache eligibility is 5.0 s
[4e7d4b99-92d4-4312-a1d5-683d323a5adf] 2022-10-16T17:37:06+02:00 DEBUG metabase.server.middleware.log POST /api/card/17/query 202 [ASYNC: completed] 14.0 s (14 DB calls) App DB connections: 2/15 Jetty threads: 2/50 (5 idle, 0 queued) (148 total active threads) Queries in flight: 0 (0 queued)
[4e7d4b99-92d4-4312-a1d5-683d323a5adf] 2022-10-16T17:37:52+02:00 DEBUG metabase.server.middleware.log GET /api/dashboard/1 200 61.0 ms (18 DB calls) App DB connections: 2/15 Jetty threads: 3/50 (4 idle, 0 queued) (145 total active threads) Queries in flight: 0 (0 queued)
[4e7d4b99-92d4-4312-a1d5-683d323a5adf] 2022-10-16T17:37:52+02:00 DEBUG metabase.server.middleware.log GET /api/table/7/query_metadata 200 54.7 ms (9 DB calls) App DB connections: 1/15 Jetty threads: 4/50 (3 idle, 0 queued) (145 total active threads) Queries in flight: 0 (0 queued)
[4e7d4b99-92d4-4312-a1d5-683d323a5adf] 2022-10-16T17:37:52+02:00 INFO metabase.query-processor.card Question's average execution duration is 39.6 s; using 'magic' TTL of 7.9 hours 💾
[4e7d4b99-92d4-4312-a1d5-683d323a5adf] 2022-10-16T17:37:52+02:00 INFO metabase.query-processor.card Question's average execution duration is 2.0 s; using 'magic' TTL of 24.5 mins 💾
[4e7d4b99-92d4-4312-a1d5-683d323a5adf] 2022-10-16T17:37:52+02:00 INFO metabase.query-processor.card Question's average execution duration is 1.4 s; using 'magic' TTL of 16.2 mins 💾
[4e7d4b99-92d4-4312-a1d5-683d323a5adf] 2022-10-16T17:37:52+02:00 INFO metabase.query-processor.card Question's average execution duration is 41.8 s; using 'magic' TTL of 8.4 hours 💾
[4e7d4b99-92d4-4312-a1d5-683d323a5adf] 2022-10-16T17:37:52+02:00 INFO metabase.query-processor.card Question's average execution duration is 38.0 s; using 'magic' TTL of 7.6 hours 💾
[4e7d4b99-92d4-4312-a1d5-683d323a5adf] 2022-10-16T17:37:52+02:00 INFO metabase.query-processor.card Question's average execution duration is 1.8 s; using 'magic' TTL of 21.6 mins 💾
[4e7d4b99-92d4-4312-a1d5-683d323a5adf] 2022-10-16T17:37:54+02:00 INFO metabase.query-processor.middleware.cache Query took 1.2 s to run; minimum for cache eligibility is 5.0 s
[4e7d4b99-92d4-4312-a1d5-683d323a5adf] 2022-10-16T17:37:54+02:00 DEBUG metabase.server.middleware.log POST /api/dashboard/1/dashcard/14/card/15/query 202 [ASYNC: completed] 2.0 s (18 DB calls) App DB connections: 1/15 Jetty threads: 3/50 (5 idle, 0 queued) (163 total active threads) Queries in flight: 5 (0 queued)
[4e7d4b99-92d4-4312-a1d5-683d323a5adf] 2022-10-16T17:37:54+02:00 INFO metabase.query-processor.middleware.cache Query took 1.6 s to run; minimum for cache eligibility is 5.0 s
[4e7d4b99-92d4-4312-a1d5-683d323a5adf] 2022-10-16T17:37:54+02:00 DEBUG metabase.server.middleware.log POST /api/dashboard/1/dashcard/2/card/2/query 202 [ASYNC: completed] 2.2 s (19 DB calls) App DB connections: 0/15 Jetty threads: 3/50 (5 idle, 0 queued) (159 total active threads) Queries in flight: 4 (0 queued)
[4e7d4b99-92d4-4312-a1d5-683d323a5adf] 2022-10-16T17:37:55+02:00 INFO metabase.query-processor.middleware.cache Query took 1.7 s to run; minimum for cache eligibility is 5.0 s
[4e7d4b99-92d4-4312-a1d5-683d323a5adf] 2022-10-16T17:37:55+02:00 DEBUG metabase.server.middleware.log POST /api/dashboard/1/dashcard/1/card/1/query 202 [ASYNC: completed] 2.4 s (19 DB calls) App DB connections: 1/15 Jetty threads: 3/50 (5 idle, 0 queued) (155 total active threads) Queries in flight: 3 (0 queued)
[4e7d4b99-92d4-4312-a1d5-683d323a5adf] 2022-10-16T17:38:35+02:00 INFO metabase.query-processor.middleware.cache Query took 675.0 ms to run; minimum for cache eligibility is 5.0 s
[4e7d4b99-92d4-4312-a1d5-683d323a5adf] 2022-10-16T17:38:35+02:00 DEBUG metabase.server.middleware.log POST /api/dashboard/1/dashcard/3/card/3/query 202 [ASYNC: completed] 42.7 s (19 DB calls) App DB connections: 1/15 Jetty threads: 3/50 (5 idle, 0 queued) (164 total active threads) Queries in flight: 2 (0 queued)
[4e7d4b99-92d4-4312-a1d5-683d323a5adf] 2022-10-16T17:38:35+02:00 INFO metabase.query-processor.middleware.cache Query took 724.0 ms to run; minimum for cache eligibility is 5.0 s
[4e7d4b99-92d4-4312-a1d5-683d323a5adf] 2022-10-16T17:38:35+02:00 DEBUG metabase.server.middleware.log POST /api/dashboard/1/dashcard/18/card/17/query 202 [ASYNC: completed] 42.7 s (21 DB calls) App DB connections: 1/15 Jetty threads: 3/50 (5 idle, 0 queued) (160 total active threads) Queries in flight: 1 (0 queued)
[4e7d4b99-92d4-4312-a1d5-683d323a5adf] 2022-10-16T17:38:35+02:00 INFO metabase.query-processor.middleware.cache Query took 521.0 ms to run; minimum for cache eligibility is 5.0 s
[4e7d4b99-92d4-4312-a1d5-683d323a5adf] 2022-10-16T17:38:35+02:00 DEBUG metabase.server.middleware.log POST /api/dashboard/1/dashcard/18/card/16/query 202 [ASYNC: completed] 43.0 s (19 DB calls) App DB connections: 1/15 Jetty threads: 2/50 (6 idle, 0 queued) (156 total active threads) Queries in flight: 0 (0 queued)
Diagnostic info:
{
"browser-info": {
"language": "en-GB",
"platform": "MacIntel",
"userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.6.1 Safari/605.1.15",
"vendor": "Apple Computer, Inc."
},
"system-info": {
"file.encoding": "UTF-8",
"java.runtime.name": "OpenJDK Runtime Environment",
"java.runtime.version": "11.0.16.1+1",
"java.vendor": "Eclipse Adoptium",
"java.vendor.url": "https://adoptium.net/",
"java.version": "11.0.16.1",
"java.vm.name": "OpenJDK 64-Bit Server VM",
"java.vm.version": "11.0.16.1+1",
"os.name": "Linux",
"os.version": "4.15.0-180-generic",
"user.language": "en",
"user.timezone": "GMT"
},
"metabase-info": {
"databases": [
"bigquery-cloud-sdk",
"mongo"
],
"hosting-env": "unknown",
"application-database": "postgres",
"application-database-details": {
"database": {
"name": "PostgreSQL",
"version": "14.4"
},
"jdbc-driver": {
"name": "PostgreSQL JDBC Driver",
"version": "42.5.0"
}
},
"run-mode": "prod",
"version": {
"date": "2022-09-29",
"tag": "v0.44.4",
"branch": "release-x.44.x",
"hash": "382d728"
},
"settings": {
"report-timezone": "Europe/Vienna"
}
}
}