Cloud Run Instance never scale down to 0

this is production running instance, so i dont know if i can just delete it and create a new instance, any idea why this instance never fall below 5? already set minimum instance to 0 in revision and service-level scaling

thanks in advances!

3 Likes

Hello @Rafi123 ,Welcome on Google Cloud Community.

It might be possible that even if you have min instances set to 0, you are not be able fuly scale to 0 because your Cloud Run service receiving any kind of requests during this 15 minutes slots. Based on

"Cloud Run does not immediately shut down instances once they have handled all requests. To minimize the impact of cold starts, Cloud Run may keep some instances idle for a maximum of 15 minutes. These instances are ready to handle requests in case of a sudden traffic spike.

For example, when an instance has finished handling requests, it may remain idle for a period of time in case another request needs to be handled. An idle instance may persist resources, such as open database connections. Note that CPU is only allocated during request processing unless you explicitly configure your service to have CPU always allocated.

To keep idle instances permanently available, use the min-instance setting. Note that using this feature will incur cost even when the service is not actively serving requests."

Source doc: https://cloud.google.com/run/docs/about-instance-autoscaling

You should create new revision for this Cloud Run and manage traffic to handle 100% with new revision.


cheers,
DamianS
LinkedIn medium.com Cloudskillsboost

2 Likes