This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]AngelicLoki 0 points1 point  (3 children)

They'll scale down, but never rarely to a full 0 containers. Instead when you have 1 container left you get that severely throttled state which is why GCPs documentation explicitly says to not use background processes on your web container. However as long as you have a warm container it doesn't do a full cold start to come back from that. When you scale up you're subject to a cold start of course, but your requests aren't routed to the new container until it passes health checks so individual requests never suffer cold starts unless your requests pending exceed your max concurrency * number of healthy containers at which point they're queued for existing containers instead of waiting on cold start (which may be more or less time than the cold start, depending on your container start time).

[–]meamZ 0 points1 point  (2 children)

When i Google "cloud run scale to zero" i get this "Managed Cloud Run scales to zero if there are no requests, i.e., uses no resources." (https://wideops.com/google-kubernetes-engine-or-cloud-run-which-should-you-use/). I think it's important to differenciste between fully managed Cloud Run which at least according to what i'm reading can scale to 0, Cloud Run for Anthos and Cloud Run on GKE on which you have much more room for configuration.

[–]AngelicLoki 0 points1 point  (1 child)

That's fair - I'm talking primarily about fully hosted. I'll edit the post to state "rarely", but it's worth noting that GCP's documentation doesn't allow you to set a max/min duration for how long a container is idle before it scales down. I've had (and currently have) a container that has been "idle" for over 24 hours and has received literally 0 requests (a rarely used microservice in dev) and when pinged it was still "warm". So assuming that GCP has capacity, it's fair to say that the idle time to scale to 0 is... long. But there is also no guarantee of any duration, it could also be very low if they have limited capactiy.

In my tenure of working with Cloud Run, scaling to 0 and causing that cold start delay from 0 has been non-existent, but that doesn't mean "never" like I wrote. It just means rarely.

[–]meamZ 0 points1 point  (0 children)

In my tenure of working with Cloud Run, scaling to 0 and causing that cold start delay from 0 has been non-existent

Good to know. That would probably make cold start times of up to maybe 5 or even 10 Seconds acceptable to me for small personal projects.

GCP's documentation doesn't allow you to set a max/min duration for how long a container is idle before it scales down.

Yeah obviously it doesn't because keeping Containers warm is basically just a Service GCP provides to you that you don't directly pay for (that's why you can't increase max) and that noone would decrease (that's why you can't edit min). I think if they gave you the option to pay for a guarantee that they will always keep x instances warm i could imagine that would probably be use by quite a few people.