3

I did research but couldn't find any "howTo" for deploying Metabase with Cloud Run on GCP, I only found Q&A the problems by deploying it.
My goal is to deploy Metabase with Cloud run and use Postgres as database. I have already deployed app by Cloud Run and have cloudbuild.yml pipeline on git that I use it for building my app I just wanna add Metabase.
Any directions or solutions?

2 Answers 2

2

It is not recommended to deploy Metabase on Cloud Run because:

Computation is scoped to a request. You should only expect to be able to do computation within the scope of a request: a container instance does not have any CPU available if it is not processing a request.

Container runtime contract

Therefore you might be facing issues loading the application and database connections timeout.

I think your best option is using AppEngine Flexible.

Install Metabase on Google Cloud with Docker – App Engine

2
  • This has changed since cloud run has an option to disable throttling now. In theory, this makes Cloud Run even better candidate than GAE Flex for Metabase, i.e. you get to use Secret Manager out of the box Mar 28, 2022 at 9:19
  • I tried to deploy metabase with disabled throttling, the problem is that metabase does a lot of things at startup time and it seems that even with 100% of a vCPU it is unable to complete setup in 5 mins. It might work better with more vCPU allocated, but it seems extremely wasteful to me. Apr 2, 2022 at 14:56
1

It's very hard to use Metabase on Cloud Run. And Running it on Flexible App Engine is more expensive (~100$/month). Metabase entrypoint doing lot of processes and if Cloud Run decide to create another container instance it will display the loading metabase page so we have to do multiple manually refresh to get the new container ready.

I managed this problem by using more JVM JAVA_OPTS -Xmx4g and limit the MAX_INSTANCES to 1. I set a Cloud Scheduler task who does a get query to the metabase service base URL every 10 minutes.

With this configuration metabase will stay alive and Cloud Run will never create more than 1 container. So the refresh problem will not appear any more.

For the moment I don't have problems with this configuration but I think the best way to host metabase is to run it on Compute Engine VM.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.