Metabase 0.43.0 takes 100% CPU

Metabase (docker-based) has been updated to 0.43.0.
Now, I can see performance degradation. The java process takes 100% from time to time.
The CPU utilization graph shows that the performance issue happened after the Metabase update.
Please suggest

Hi @alexdrv
Post "Diagnostic Info" from Admin > Troubleshooting.
Which version did you upgrade from?
And what is happening in the log at the times you see high load? Admin > Troubleshooting > Logs.

Hello Flamber,

I believe I upgraded from v0.41 (it was installed 2 months ago).

Diagnostic Info:
{
"browser-info": {
"language": "en-US",
"platform": "MacIntel",
"userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.4951.54 Safari/537.36",
"vendor": "Google Inc."
},
"system-info": {
"file.encoding": "UTF-8",
"java.runtime.name": "OpenJDK Runtime Environment",
"java.runtime.version": "11.0.15+10",
"java.vendor": "Eclipse Adoptium",
"java.vendor.url": "https://adoptium.net/",
"java.version": "11.0.15",
"java.vm.name": "OpenJDK 64-Bit Server VM",
"java.vm.version": "11.0.15+10",
"os.name": "Linux",
"os.version": "4.14.104-95.84.amzn2.x86_64",
"user.language": "en",
"user.timezone": "GMT"
},
"metabase-info": {
"databases": [
"postgres"
],
"hosting-env": "unknown",
"application-database": "h2",
"application-database-details": {
"database": {
"name": "H2",
"version": "1.4.197 (2018-03-18)"
},
"jdbc-driver": {
"name": "H2 JDBC Driver",
"version": "1.4.197 (2018-03-18)"
}
},
"run-mode": "prod",
"version": {
"date": "2022-05-02",
"tag": "v0.43.0",
"branch": "release-x.43.x",
"hash": "ee686fc"
},
"settings": {
"report-timezone": "US/Pacific"
}
}
}

I don't see anything strange in the logs. However, I see that the Postgres sync takes a lot of time. The DB did not grow up significantly since May 5th.

Looks like during the sync I have CPU usage

@alexdrv

  1. You should migrate away from H2 if you are using Metabase in production:
    https://www.metabase.com/docs/latest/operations-guide/migrating-from-h2.html
  2. You are seeing a lot more activity because JSON columns are now being expanded, but because you are using the very inefficient H2 application database, then it's causing a lot more load than it should
    https://www.metabase.com/blog/Metabase-0.43/index.html#native-json-record-support-in-postgres

Thanks a lot.
I'll migrate from H2

Migration has been passed however I see similar issue.

I see that sync takes time...
FINISHED: step 'sync-fields' for postgres Database 37 'Sandbox PG' (2.9 mins)

Do you think it can be an issue?

{
"browser-info": {
"language": "en-US",
"platform": "MacIntel",
"userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.4951.54 Safari/537.36",
"vendor": "Google Inc."
},
"system-info": {
"file.encoding": "UTF-8",
"java.runtime.name": "OpenJDK Runtime Environment",
"java.runtime.version": "11.0.15+10",
"java.vendor": "Eclipse Adoptium",
"java.vendor.url": "https://adoptium.net/",
"java.version": "11.0.15",
"java.vm.name": "OpenJDK 64-Bit Server VM",
"java.vm.version": "11.0.15+10",
"os.name": "Linux",
"os.version": "4.14.104-95.84.amzn2.x86_64",
"user.language": "en",
"user.timezone": "GMT"
},
"metabase-info": {
"databases": [
"postgres"
],
"hosting-env": "unknown",
"application-database": "postgres",
"application-database-details": {
"database": {
"name": "PostgreSQL",
"version": "14.2"
},
"jdbc-driver": {
"name": "PostgreSQL JDBC Driver",
"version": "42.3.2"
}
},
"run-mode": "prod",
"version": {
"date": "2022-05-02",
"tag": "v0.43.0",
"branch": "release-x.43.x",
"hash": "ee686fc"
},
"settings": {
"report-timezone": "US/Pacific"
}
}
}

@alexdrv How many columns do you have with JSON data? And how many attributes do they contain on average?
Someone else reported problems too, so it seems like it's certain setups that has this problem:
https://github.com/metabase/metabase/issues/22636 - upvote by clicking :+1: on the first post

I have 3 tables with the jsonb columns with the following number of records:

  • 2257 - 1 json element inside,
  • 3 - 56 json elements inside,
  • 5 - 6 json elements inside.