Your question took too long - increasing timeout when running MySQL queries

Hi, I'm receiving this error every time I try to run a query (MySQL) that takes more than (approx) 1 minute.
How can I increase that timeout in order to run queries that takes longer than 1 minute?

Here's my Diagnostic Info and logs

Diagnostic Info

{
"browser-info": {
"language": "en",
"platform": "MacIntel",
"userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Safari/537.36",
"vendor": "Google 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": "5.4.0-1060-aws",
"user.language": "en",
"user.timezone": "GMT"
},
"metabase-info": {
"databases": [
"mysql",
"h2"
],
"hosting-env": "unknown",
"application-database": "postgres",
"application-database-details": {
"database": {
"name": "PostgreSQL",
"version": "13.7"
},
"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": null
}
}
}

Logs

[7d94229a-6669-42f8-a058-aaf7adf5b2d5] 2022-10-06T15:48:53+02:00 DEBUG metabase.server.middleware.log GET /api/user/current 200 8.6 ms (9 DB calls) App DB connections: 1/15 Jetty threads: 4/50 (3 idle, 0 queued) (159 total active threads) Queries in flight: 0 (0 queued)
[7d94229a-6669-42f8-a058-aaf7adf5b2d5] 2022-10-06T15:48:53+02:00 DEBUG metabase.server.middleware.log GET /api/session/properties 200 12.3 ms (4 DB calls) App DB connections: 0/15 Jetty threads: 3/50 (3 idle, 0 queued) (159 total active threads) Queries in flight: 0 (0 queued)
[7d94229a-6669-42f8-a058-aaf7adf5b2d5] 2022-10-06T15:48:53+02:00 DEBUG metabase.server.middleware.log GET /api/collection/root 200 2.3 ms (2 DB calls) App DB connections: 0/15 Jetty threads: 3/50 (4 idle, 0 queued) (160 total active threads) Queries in flight: 0 (0 queued)
[7d94229a-6669-42f8-a058-aaf7adf5b2d5] 2022-10-06T15:48:53+02:00 DEBUG metabase.server.middleware.log GET /api/bookmark 200 5.5 ms (1 DB calls) App DB connections: 6/15 Jetty threads: 8/50 (0 idle, 0 queued) (162 total active threads) Queries in flight: 0 (0 queued)
[7d94229a-6669-42f8-a058-aaf7adf5b2d5] 2022-10-06T15:48:53+02:00 DEBUG metabase.server.middleware.log GET /api/database 200 11.8 ms (3 DB calls) App DB connections: 2/15 Jetty threads: 6/50 (2 idle, 0 queued) (162 total active threads) Queries in flight: 0 (0 queued)
[7d94229a-6669-42f8-a058-aaf7adf5b2d5] 2022-10-06T15:48:53+02:00 DEBUG metabase.server.middleware.log GET /api/activity/recent_views 200 23.2 ms (8 DB calls) App DB connections: 6/15 Jetty threads: 6/50 (3 idle, 0 queued) (163 total active threads) Queries in flight: 0 (0 queued)
[7d94229a-6669-42f8-a058-aaf7adf5b2d5] 2022-10-06T15:48:53+02:00 DEBUG metabase.server.middleware.log GET /api/collection/tree 200 27.9 ms (11 DB calls) App DB connections: 6/15 Jetty threads: 6/50 (3 idle, 0 queued) (163 total active threads) Queries in flight: 0 (0 queued)
[7d94229a-6669-42f8-a058-aaf7adf5b2d5] 2022-10-06T15:48:53+02:00 DEBUG metabase.server.middleware.log GET /api/activity/popular_items 200 27.4 ms (10 DB calls) App DB connections: 1/15 Jetty threads: 4/50 (4 idle, 0 queued) (165 total active threads) Queries in flight: 0 (0 queued)
[7d94229a-6669-42f8-a058-aaf7adf5b2d5] 2022-10-06T15:48:57+02:00 DEBUG metabase.server.middleware.log GET /api/session/properties 200 23.4 ms (4 DB calls) App DB connections: 0/15 Jetty threads: 4/50 (5 idle, 0 queued) (165 total active threads) Queries in flight: 0 (0 queued)
[7d94229a-6669-42f8-a058-aaf7adf5b2d5] 2022-10-06T15:48:57+02:00 DEBUG metabase.server.middleware.log GET /api/setting 200 27.7 ms (3 DB calls) App DB connections: 0/15 Jetty threads: 4/50 (5 idle, 0 queued) (165 total active threads) Queries in flight: 0 (0 queued)
[7d94229a-6669-42f8-a058-aaf7adf5b2d5] 2022-10-06T15:48:57+02:00 DEBUG metabase.server.middleware.log GET /api/setup/admin_checklist 200 8.9 ms (11 DB calls) App DB connections: 0/15 Jetty threads: 3/50 (6 idle, 0 queued) (165 total active threads) Queries in flight: 0 (0 queued)
[7d94229a-6669-42f8-a058-aaf7adf5b2d5] 2022-10-06T15:48:59+02:00 DEBUG metabase.server.middleware.log GET /api/util/bug_report_details 200 4.3 ms (1 DB calls) App DB connections: 0/15 Jetty threads: 3/50 (6 idle, 0 queued) (165 total active threads) Queries in flight: 0 (0 queued)
[7d94229a-6669-42f8-a058-aaf7adf5b2d5] 2022-10-06T15:51:20+02:00 DEBUG metabase.server.middleware.log GET /api/util/bug_report_details 200 2.1 ms (1 DB calls) App DB connections: 0/15 Jetty threads: 3/50 (4 idle, 0 queued) (160 total active threads) Queries in flight: 0 (0 queued)

Hi @andrev
None of the logs you've included shows if the timeout is coming from MySQL, which you then need to adjust on MySQL or possibly add session variable (max_execution_time), or if the timeout is caused by a reverse-proxy closing the connection too soon, which you need to adjust on the reverse-proxy (e.g. proxy_read_timeout). I'm guessing it's a reverse-proxy.