해리슨 블로그

[GCP] Cloud Run and Cloud Run Function Pricing Structure

Created: 2024-11-11

Created: 2024-11-11 10:19

[GCP] Cloud Run and Cloud Run Function (formerly Cloud Function) Pricing Structures

GCP recently announced the UI integration of Cloud Run and Cloud Function.


Functionally, Cloud Run is a serverless platform that runs a single Docker image, while Cloud Function is a platform that executes code snippets (functions) in certain languages (Node.js, Go, .Net, Java, PHP, Python, Ruby).

This results in different execution methods. Cloud Run launches an image and then makes calls to that image, allowing a single container to handle multiple calls concurrently. (In other words, multiple new calls can be received while a single call is in progress.)

Conversely, Cloud Function uses a function call method, meaning that 10 containers are needed to execute 10 commands.

Therefore, Cloud Function is advantageous for lightweight tasks or when rapid cold starts are necessary for single calls, while Cloud Run is better suited for large-scale processes or when slightly slower execution is acceptable.

So, what about the crucial pricing?

(As was likely intended from the outset...)

Basically, the invocation pricing for both is the same: \$0.4 per million invocations.

Also, assuming full-day usage, the cost for the same amount of memory is \$0.216.

Then what about vCPU?

For Cloud Function, it's \$0.864 per 1 GHz/day. (Cloud Function billing varies depending on clock usage.)

For Cloud Run, it's \$2.07 per 1 core/day. This means Cloud Run can be considered to use 2.4 GHz. (The official documentation also states that 1 vCPU is 2.4 GHz.)

In conclusion, both services (Cloud Run, Cloud Function) have identical pricing models; only the service directions differ.

Therefore, after this integration, choosing between the two services based on usage patterns should allow for a cheaper and more efficient service configuration.

Comments0