ahmetb / cloud-run-faq

Unofficial FAQ and everything you've been wondering about Google Cloud Run.
https://cloud.run
Creative Commons Attribution 4.0 International
2.32k stars 124 forks source link

How to calculate cpu allocated for warm containers(or idle containers)? #142

Open wuyafang opened 3 years ago

wuyafang commented 3 years ago

I noticed that warm containers get their CPU throttled to ~0% when they are not processing requests,while in pricing tables(https://cloud.google.com/run/pricing) idle containers still need to be paid $0.00000250 for vCPU-seconds unit.

I was wondering how to calculate CPU allocated for warm containers(or idle containers) ?

ahmetb commented 3 years ago

@wuyafang the question is unclear to me. Warm containers are charged at the specified rate as long as they stay around, even though they can't use the CPU (because there are no requests coming).

tsu1980 commented 3 years ago

For about when container startup is described in the Document.

Your container instances must listen for requests within 4 minutes after being started. During this startup time, container instances are allocated CPU.

https://cloud.google.com/run/docs/reference/container-contract#startup