Metabase MaxIdleTime

I try this option to set maxidletime.

java -Xmx2g -Dc3p0.maxPoolSize=10 -Dc3p0.maxIdleTime=180 -jar /var/www/html/metabase/metabase.jar

but in the process list query, I still get a sleep query of more than 300s.

This is mydiagnosis info

{
"browser-info": {
"language": "id-ID",
"platform": "Win32",
"userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.159 Safari/537.36",
"vendor": "Google Inc."
},
"system-info": {
"file.encoding": "ANSI_X3.4-1968",
"java.runtime.name": "OpenJDK Runtime Environment",
"java.runtime.version": "11.0.11+9-Ubuntu-0ubuntu2.18.04",
"java.vendor": "Ubuntu",
"java.vendor.url": "https://ubuntu.com/",
"java.version": "11.0.11",
"java.vm.name": "OpenJDK 64-Bit Server VM",
"java.vm.version": "11.0.11+9-Ubuntu-0ubuntu2.18.04",
"os.name": "Linux",
"os.version": "3.10.0-1160.21.1.vz7.174.13",
"user.language": "en",
"user.timezone": "Etc/UTC"
},
"metabase-info": {
"databases": [
"h2",
"mysql",
"mongo"
],
"hosting-env": "unknown",
"application-database": "mysql",
"application-database-details": {
"database": {
"name": "MariaDB",
"version": "10.4.17-MariaDB-1:10.4.17+maria~bionic"
},
"jdbc-driver": {
"name": "MariaDB Connector/J",
"version": "2.6.2"
}
},
"run-mode": "prod",
"version": {
"date": "2020-11-12",
"tag": "v0.37.1",
"branch": "release-x.37.x",
"hash": "ba57ab6"
},
"settings": {
"report-timezone": null
}
}
}

Hi @herdikun
I would recommend that you upgrade - latest release is 0.40.3.1
There is no "sleep query". The connections go into idle state, when they are not used, and then they get closed after 5 minutes (except one).
Connection handling in c3p0 is more complex and sometimes need multiple settings to handle correctly.
https://github.com/metabase/metabase/blob/master/src/metabase/driver/sql_jdbc/connection.clj#L45-L88

I have updated to the last version, but when I try to run this i still getting sleep more than 180 s

@herdikun I didn't say that anything was fixed about this. But if you see the connection running a sleep query, then that is not Metabase. The connections goes into idle, when not used.
Use a script on the database to kill idle connections.

i think this is from Metabase, because i use a different user for the Metabase application.

@herdikun Post your full process list from the database.

just sleep when idle metabase

@herdikun Okay, then kill the connection on the database.

@herdikun That is just MySQL being silly and calling it "Sleep" instead of "idle".
https://stackoverflow.com/questions/4284194/terminating-idle-mysql-connections