Cloud Run vs Cloud Run Functions (2nd Gen) & Cloud Functions (1st Gen)
Date: 23 July 2025
1. Executive Summary
Google Cloud now offers three closely related serverless compute flavors:
Product | What it is | Typical Fit |
---|---|---|
Cloud Run service | Run any OCI container as an HTTP service or background job. | Full micro‑services, ML inference, batch jobs. |
Cloud Run function (2nd Gen) | Source‑only functions that compile down to a Cloud Run container under the hood. | Event‑driven glue code, quick HTTP endpoints. |
Cloud Functions (1st Gen) | Legacy platform still billed on invocations/GB‑s/GHz‑s. | Existing workloads awaiting upgrade. |
For sporadic traffic, Cloud Run request‑based billing and Cloud Run functions cost the same; migration changes developer experience more than the bill.
2. Terminology & Current Names
- “Cloud Run functions” = Cloud Functions 2nd Gen (2024‑present).
- “Request‑based billing” = pay ‑per‑vCPU‑second, ‑GiB‑second only while handling a request, plus $0.40 / million requests after free tier.
- “Instance‑based billing” = traditional wall‑clock billing; CPU stays allocated between requests.
3. Feature & Configuration Differences
Dimension | Cloud Run service | Cloud Run function (2nd Gen) |
---|---|---|
Packaging | Bring your own container (Docker, Buildpacks, etc.). | Push source; Google builds the container. |
Triggers | HTTP/gRPC by default; other events via Eventarc. | HTTP plus built‑in triggers (Storage, Pub/Sub, Firestore, Audit Logs…). |
Concurrency | 1 – 1 000 (80 default). | 1 default; up to 1 000 configurable. |
Max resources | 8 vCPU / 32 GiB RAM (GPUs, volumes). | 4 vCPU / 16 GiB RAM. |
Traffic splitting | Full rollout/rollback, A/B. | Available (not in 1st‑Gen). |
Billing modes | Request‑based or instance‑based. | Request‑based only. |
4. Pricing Models (USD list, us‑central1
baseline)
4.1 Cloud Run request‑based (applies to services & functions)
Component | Rate | Free / mo |
---|---|---|
Active CPU | $0.000024 per vCPU‑s | 180 000 vCPU‑s |
Idle CPU (min instances) | $0.0000025 per vCPU‑s | — |
Active Memory | $0.0000025 per GiB‑s | 360 000 GiB‑s |
Idle Memory (min inst.) | $0.0000025 per GiB‑s | — |
Requests | $0.40 per M | 2 M |
4.2 Cloud Run instance‑based (services only)
Component | Rate | Free / mo |
---|---|---|
CPU | $0.000018 per vCPU‑s | 240 000 vCPU‑s |
Memory | $0.000002 per GiB‑s | 450 000 GiB‑s |
Requests | None | N/A |
4.3 Cloud Functions 1st Gen (legacy)
Component | Rate | Free / mo |
---|---|---|
Invocations | $0.40 per M | 2 M |
Memory | $0.0000025 per GB‑s | 400 k GB‑s |
CPU | $0.0000100 per GHz‑s | 200 k GHz‑s |
Internet egress | $0.12 / GB | 5 GB |
5. Cost Illustration – Sporadic Workload
Scenario
- 10 k invocations / month
- 500 ms execution each
- 1 vCPU, 256 MiB
- Scales to 0 between bursts
- Region:
europe‑west2
Model | Calculated Monthly Cost |
---|---|
Cloud Run function (2nd Gen) | $0 (all within free tier) |
Cloud Run service (request‑based) | $0 |
Cloud Run service (instance‑based) | ~$0.09 if instance stays up the whole 5 s total; higher if kept warm |
Result: No cost advantage to migrating when the service already uses request‑based billing.
6. When Migration Does Make Sense
- You need built‑in Cloud event triggers without managing Eventarc.
- You like source‑only deployments (skip Docker).
- You want strict 1‑request isolation by default.
- You are retiring 1st‑Gen Cloud Functions and want lowest‑effort port.
7. Migration Checklist (Service → Function)
Map the entry point – Export a single handler (
main.py
,index.js
, etc.).Remove unnecessary endpoints/background loops.
Adjust config – Env vars, memory ≤ 16 GiB, vCPU ≤ 4, timeout ≤ 60 min.
Deploy
gcloud run deploy my‑function --source=. --region=europe-west2 --trigger-http --allow-unauthenticated
Add event triggers if required.
Update clients/DNS – new URL.
Rollback is instant via previous Cloud Run revision.
8. References
- Google Cloud Run & Cloud Run Functions pricing docs, retrieved 23 July 2025.
- Google Cloud product release notes, Aug 2024 – Jul 2025 (Cloud Functions 2nd Gen GA).
- Google Cloud blog “Cloud Run pricing updates: request‑based vs instance‑based modes”, 14 Mar 2024.