Metabase unstable on Heroku

Hi!

We deployed Metabase on Heroku last year, but since last week, Metabase is really unstable, becoming unavailable at least 3 times a day.
We only have 1 database connected (Snowflake).

Actions we already tried:

  • Increase the Metabase memory from 2gb to 14gb.
  • Sync Snowflake database only 1x per day, at 2AM.
  • Increase the Snowflake auto-suspend time to 5 minutes
    But the problem persists.

Important info: Heroku has 30 sec timeout by default, so, if a query/api call takes more than 30sec to execute, Heroku tries to cancel the request.

Question: This default 30s timeout from Heroku can prevent Metabase from operating normally?

Metabase logs while unavailable:

Metabase metrics while unavailable:

Metabase infos:

{
  "browser-info": {
    "language": "pt-BR",
    "platform": "Win32",
    "userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.0.0.0 Safari/537.36",
    "vendor": "Google Inc."
  },
  "system-info": {
    "file.encoding": "UTF-8",
    "java.runtime.name": "OpenJDK Runtime Environment",
    "java.runtime.version": "1.8.0_332-heroku-b09",
    "java.vendor": "Oracle Corporation",
    "java.vendor.url": "http://java.oracle.com/",
    "java.version": "1.8.0_332-heroku",
    "java.vm.name": "OpenJDK 64-Bit Server VM",
    "java.vm.version": "25.332-b09",
    "os.name": "Linux",
    "os.version": "4.4.0-1104-aws",
    "user.language": "en",
    "user.timezone": "America/Sao_Paulo"
  },
  "metabase-info": {
    "databases": [
      "snowflake"
    ],
    "hosting-env": "heroku",
    "application-database": "postgres",
    "application-database-details": {
      "database": {
        "name": "PostgreSQL",
        "version": "15.2 (Ubuntu 15.2-1.pgdg20.04+1)"
      },
      "jdbc-driver": {
        "name": "PostgreSQL JDBC Driver",
        "version": "42.3.2"
      }
    },
    "run-mode": "prod",
    "version": {
      "tag": "v0.43.4",
      "date": "2022-06-27",
      "branch": "release-x.43.x",
      "hash": "61cc28e"
    },
    "settings": {
      "report-timezone": "America/Sao_Paulo"
    }
  }
}

Hi there, first of all upgrade Metabase to the latest version. Also, if your DB becomes big enough and queries take more than 30 seconds they will get killed and you don't want that. Third: 14 gigabytes of RAM is one of the biggest RAM assignments I've seen and I really don't think you need that much:

  • bump your app db size
  • make sure Metabase is using all the RAM you provide (via JAVA_OPTS)
  • move out of Heroku if possible, as they use a weird container runtime and the 30 seconds limit is not a good idea when your Metabase deployment grows
1 Like