Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google Cloud Run suitable to run Spring Boot?

We have a Docker container that packages a Java Spring Boot application. The application sometimes takes about 40 seconds to start.

Is Google Cloud Run suitable to run such a "heavyweight" application?

Let's say it'd be scaled down to 0 replicas, then the following would take 40 seconds upwards to be processed. Or is there some logic on Cloud Run's side to avoid such a case.

like image 403
Harold L. Brown Avatar asked Jul 26 '19 11:07

Harold L. Brown


Video Answer


2 Answers

You can't avoid the cold start cost when Cloud Run starts a new virtual server instance. If 40 seconds is unacceptable overhead to handle an incoming "cold" request, then you might want to pay for a servers that stay running 24/7.

like image 103
Doug Stevenson Avatar answered Sep 25 '22 08:09

Doug Stevenson


You can't avoid that 40 second spin up time. So it really depends on how often you're calling it.

We use spring boot + gke, cloud run would make no sense unless the code was used like once a week. (That's maybe dramatic, but you get it).

If you have end users interacting with that, it's probably unacceptable. If it's just an API endpoint for some automation then you're only annoying skynet.

like image 43
thebwt Avatar answered Sep 25 '22 08:09

thebwt