India’s Leading Domain & Web Hosting Provider

  • Chat
    Live Chat 24 X 7 online support
  • Contact NTSPL Hosting support
    Call Now +91 - 8260003333

Google Cloud Run Serverless Development: Services, Jobs & Functions

Quick answer

Cloud Run is Google Cloud's fully managed serverless platform for running containers as HTTP services, batch jobs or functions, scaling automatically from zero. NTSPL builds Cloud Run applications wired together with Eventarc, Cloud Tasks and Cloud Scheduler, tuning concurrency, minimum instances and billing mode so Indian consumer and marketplace apps handle peaks without paying for idle servers.

Google Cloud services in scope

Cloud Run servicesCloud Run jobsCloud Run functionsEventarcCloud TasksCloud Scheduler
Google Cloud · Serverless Applications

The Problem Cloud Run services and Cloud Run jobs Solve

Serverless on Google Cloud goes wrong in predictable ways. Teams deploy each endpoint as a separate function and end up with 120 deployables and no shared code path. Others leave concurrency at 1 copied from an old functions setup, so a lunch-hour spike spins up 900 instances that exhaust Cloud SQL connections. Webhooks from aggregators or payment gateways get processed inline, and when a downstream POS or SMS gateway slows, request timeouts cascade back to the caller. Cold starts on large Java images then add seconds to the first order of the morning.

NTSPL designs Cloud Run around the shape of the work. Synchronous APIs are Cloud Run services with concurrency set from load tests and minimum instances only on customer-facing paths. Anything that can wait goes onto Cloud Tasks or Pub/Sub, with Eventarc routing storage, audit-log and Pub/Sub events to the right handler. Scheduled and batch work runs as Cloud Run jobs triggered by Cloud Scheduler, so nothing sits idle waiting for cron.

When Cloud Run Is the Right Runtime (and When GKE or Compute Engine Fit Better)

Signals that point to serverless applications on Google Cloud

  • API traffic varies more than 10x between off-peak and peak hours, such as lunch and dinner ordering or evening browsing.
  • Servers or VMs run 24x7 to host services that are idle for more than 60% of the day.
  • Webhook bursts from aggregators, payment gateways or job boards cause timeouts because they are processed inline.
  • Your team spends more time patching base images and Kubernetes nodes than shipping features for a handful of services.
  • Legacy Cloud Functions need upgrading to second-generation runtimes or tighter integration with Cloud Run features.

When a different approach is better

  • Workloads needing persistent local disks, privileged containers or custom kernel modules belong on GKE Standard or Compute Engine.
  • A large platform with dozens of services needing a shared service mesh, operators and StatefulSets is better served by GKE Autopilot.
  • Steady, near-constant CPU load around the clock, such as stream processors, is often cheaper on committed Compute Engine or GKE capacity than instance-based Cloud Run.

Serverless Building Blocks: Cloud Run Services, Jobs and Functions with Eventarc, Cloud Tasks and Cloud Scheduler

Service Role in the architecture Choose it when
Cloud Run services Run stateless containers behind an HTTPS endpoint, scaling instances on concurrent requests from zero to a configured maximum, with traffic splitting between revisions. You have an HTTP or gRPC API, web front end or webhook receiver with variable traffic.
Cloud Run jobs Run containers to completion as one or many parallel tasks, each with an index, retries and a task timeout, without serving requests. Work is batch or scheduled, such as nightly reports, data imports or bulk notifications, and should stop when finished.
Cloud Run functions Source-based functions, formerly Cloud Functions, built and deployed as Cloud Run services with event triggers and the same scaling and networking options. A single-purpose handler for an event, such as an uploaded file or Pub/Sub message, is easier to maintain as a function than a container.
Eventarc Routes events from Google Cloud sources, Cloud Audit Logs, Pub/Sub and third parties to Cloud Run targets in CloudEvents format with filtering. Services should react to things happening, such as an object finalized in a bucket, without polling or custom glue code.
Cloud Tasks Managed queues that dispatch HTTP requests to Cloud Run with per-queue rate limits, concurrency caps, retries with backoff and scheduled delivery times. A downstream system can only take a limited rate, or a request should be retried reliably without the caller waiting.
Cloud Scheduler Managed cron that triggers Cloud Run jobs, HTTP endpoints or Pub/Sub topics on a schedule with time-zone support, including Asia/Kolkata. Recurring work is still driven by crontab on a VM that runs 24x7 for a few minutes of actual work.
Reference architecture

Event-driven Cloud Run application with queued side effects

Event-driven Cloud Run application with queued side effects

Customers call a global external Application Load Balancer that routes through a serverless NEG to a Cloud Run service in asia-south1, which writes the transaction to the database and enqueues side effects such as POS pushes, SMS or partner calls to Cloud Tasks. Eventarc delivers storage and Pub/Sub events to Cloud Run functions, and Cloud Scheduler starts Cloud Run jobs for reports and bulk work.

Edge
Request Handling
Asynchronous Work
Data & Scheduling
Interactive reference architecture

Select any component

Event-driven Cloud Run application with queued side effects: click any of its 9 components to see its role and the design choice NTSPL makes for it, or trace the 6-step primary path.

Customers and partner webhooks → Global external Application Load Balancer with serverless NEG → Cloud Run API service → Cloud SQL or Firestore → Cloud Tasks queues → Cloud Run functions

Cloud Run Engineering Decisions: Concurrency, Cold Starts, Billing Mode and Async Offload

01

Concurrency and maximum instances

Cloud Run's default concurrency of 80 is a starting point, not an answer. We load-test each service and set concurrency where p95 latency starts to bend, typically 20-40 for CPU-heavy Java or Python and 100-250 for I/O-bound Node.js or Go. Maximum instances is then derived from the database: if Cloud SQL allows 500 connections and each instance pools 10, the API caps at around 45 instances, leaving headroom for jobs and admin tools.

02

Cold starts and minimum instances

Minimum instances cost money while idle, so we set them only on customer-facing services and only for the hours that matter, adjusted by Cloud Scheduler before lunch or evening peaks. Startup CPU boost, smaller distroless images, lazy initialization of SDK clients and avoiding heavy frameworks on hot paths usually cut cold start from 3-4 seconds to under one second. Background handlers keep minimum instances at zero.

03

Request-based or instance-based billing

Request-based billing charges CPU only while requests are processed and adds a per-request fee; it suits spiky APIs. Instance-based billing keeps CPU allocated for the instance lifetime with no per-request fee, which suits services doing background work after responding or sustaining high, steady traffic. We compare both using a week of real request logs, since busy services above roughly 50-60% utilization often become cheaper on instance-based billing.

04

Cloud Tasks versus Pub/Sub for offload

Cloud Tasks fits when one specific handler must be called with explicit control over rate, concurrency, scheduled delivery and per-task deduplication, such as pushing orders to store POS terminals at 20 per second. Pub/Sub fits fan-out to many subscribers and very high throughput where the publisher should not know the consumers. Both retry; we set dead-letter handling for each so failed messages are inspected, not lost.

05

Service granularity and functions versus services

We group endpoints that share a data model and release cadence into one Cloud Run service, rather than one function per route, to keep deployables under control and share connection pools. Cloud Run functions are used for genuinely isolated event handlers, such as thumbnailing or webhook fan-out. Since functions now deploy as Cloud Run services, moving a handler between the two models later is straightforward.

How NTSPL Ships an Event-Driven Application on Cloud Run

01

Containerize and baseline

Package each service with a slim base image, add health and readiness behaviour, and record cold-start and steady-state latency.

02

Concurrency and scaling tests

Load-test each service at 1x, 5x and 10x expected peak to choose concurrency, CPU, memory and instance limits.

03

Async offload with Cloud Tasks and Eventarc

Move webhook processing, notifications and partner calls onto queues and event triggers, with dead-letter handling.

04

Edge and private networking

Place services behind a global Application Load Balancer with serverless NEGs, restrict ingress, and configure Direct VPC egress for database access.

05

Jobs and schedules

Replace VM crontabs with Cloud Scheduler triggering Cloud Run jobs, using task parallelism for bulk work.

06

Progressive rollout

Deploy new revisions with tagged URLs, shift traffic in 10%, 50% and 100% steps, and keep the previous revision ready for instant rollback.

What you receive

Service map grouping endpoints into Cloud Run services, functions and jobs with owners and SLOs
Load-test results with chosen concurrency, CPU, memory, minimum and maximum instances per service
Terraform for Cloud Run services, jobs, Eventarc triggers, Cloud Tasks queues and Scheduler jobs
Queue design sheet with rate limits, retry and dead-letter policies per downstream system
Billing-mode comparison per service with projected monthly cost under both models
Runbook for revision rollback, queue backlog handling and cold-start regressions

Securing Cloud Run: Ingress Settings, Invoker IAM, Service Identity and Direct VPC Egress

Cloud Run's main exposures are services left publicly invokable on their run.app URL, every service sharing the default compute service account, and secrets baked into images or plain environment variables. NTSPL restricts ingress so only the load balancer or internal callers reach services, requires IAM invoker permission for service-to-service calls, gives each service its own identity, and mounts secrets from Secret Manager with version pinning.

  • Ingress setting internal-and-cloud-load-balancing so Cloud Armor cannot be bypassed via the run.app URL
  • roles/run.invoker granted per calling identity, with authenticated Cloud Tasks and Eventarc push
  • Dedicated service account per service and function, never the default compute account
  • Secret Manager references with pinned versions and rotation, not secrets in images
  • Binary Authorization policy for Cloud Run so only attested images are deployed

Cloud Run Pricing Levers: Request-Based Billing, Concurrency, Min Instances and Committed Use

Cloud Run bills vCPU-seconds and GiB-seconds of memory, plus a per-request fee under request-based billing, with a monthly free tier per billing account. Minimum instances incur idle charges, and higher concurrency directly reduces cost because more requests share one instance. Cloud Tasks bills per operation, Cloud Scheduler per job beyond a small free allowance, and Eventarc per event for non-Google sources.

  • Raise concurrency from load-test results to cut instance-seconds by 30-60% on I/O-bound services
  • Schedule minimum instances only for peak hours instead of 24x7
  • Switch steady, busy services to instance-based billing and apply Cloud Run committed use discounts
  • Right-size CPU and memory per service; many Node.js and Go services run well on 1 vCPU and 512 MiB
  • Move chatty polling to Eventarc triggers so instances run only when events occur
Buyer comparison

Cloud Run services vs Cloud Run functions vs Cloud Run jobs: which should I use?

Pick by how the code is invoked and packaged. Use Cloud Run services for anything answering HTTP or gRPC requests, especially multi-endpoint APIs and web apps where you control the container, framework and dependencies. Use Cloud Run functions when you want to deploy source code for a single event handler, such as a Pub/Sub message or a file upload, and let Google build the container; since functions now run on Cloud Run, they get the same networking, scaling and revision features. Use Cloud Run jobs when work has a start and an end, does not serve requests, and may need to fan out into parallel tasks, such as reconciliations or bulk messaging triggered by Cloud Scheduler. Most applications use all three.

Key facts about serverless applications on Google Cloud

●Cloud Functions was renamed Cloud Run functions in 2024, and functions are deployed as Cloud Run services.
●A Cloud Run service instance can handle up to 1,000 concurrent requests, with a default of 80.
●Cloud Run supports request timeouts of up to 60 minutes for services.
●Cloud Run offers request-based billing and instance-based billing, chosen per service.
●Cloud Tasks queues support configurable maximum dispatch rates and maximum concurrent dispatches.
Illustrative industry case studies

Serverless Applications on Google Cloud in Practice

3 serverless applications scenarios from Quick-service restaurants (QSR), Recruitment and HR-tech, Hyperlocal home-services marketplace: the starting position, the services chosen, the architecture, the rollout and the measured outcome.

Google CloudServerless ApplicationsQuick-service restaurants (QSR)

QSR chain processes 6x lunch-hour orders with zero dropped POS pushes

Challenge: 2.3% of peak-hour aggregator orders auto-cancelled because webhook responses timed out

0.1%Peak-hour aggregator order cancellations
Read case study →
Google CloudServerless ApplicationsRecruitment and HR-tech

Job portal parses 400,000 resumes a day on Cloud Run with no idle servers

Challenge: Parsing backlog of 5-7 hours on peak days

Under 90 secondsResume parsing delay on peak days
Read case study →
Google CloudServerless ApplicationsHyperlocal home-services marketplace

Home-services marketplace cuts missed appointments 42% with Cloud Tasks reminders

Challenge: Booking-to-assignment time of up to 12 minutes at weekend peaks

Under 40 secondsBooking-to-assignment time at peak
Read case study →
Google CloudComputeAgritech

Agritech firm delivers 6 a.m. crop advisories to 2.1 million farmers on time

Challenge: Nightly pipeline duration of 7.5-10 hours against a 6 a.m. advisory deadline

2 hours 40 minutesNightly pipeline duration
Cross-linked: primary service is Compute
Read case study →
Google CloudStorage & Content DeliveryDigital news publishing

News publisher absorbs 14x breaking-news spikes with a 94% Cloud CDN hit ratio

Challenge: Homepage outages of more than 20 minutes during two national news events

94%Cache-hit ratio
Cross-linked: primary service is Storage & Content Delivery
Read case study →
Google CloudStorage & Content DeliveryK-12 e-learning

K-12 e-learning company halves video delivery cost across 180,000 lessons

Challenge: Rebuffering ratio of 4.8% during exam season on mobile networks

1.3%Exam-season rebuffering ratio
Cross-linked: primary service is Storage & Content Delivery
Read case study →
Google CloudDatabasesFintech (rewards and loyalty)

Loyalty fintech handles festive redemption peaks on Cloud SQL with Memorystore

Challenge: Primary CPU above 90% during festive weeks, with 3.1% of redemptions timing out

0.05%Redemption timeouts at festive peak
Cross-linked: primary service is Databases
Read case study →
Google CloudAPI & IntegrationEV charging network

EV charging network connects 9 roaming partners and settles sessions in near real time

Challenge: Nine roaming partners on nine different custom APIs

0.6%Roaming session dispute rate
Cross-linked: primary service is API & Integration
Read case study →
Google CloudAPI & IntegrationRetail pharmacy

Pharmacy chain exposes e-prescription APIs and live stock across 720 stores

Challenge: 11% of online orders cancelled due to stale stock data

2.4%Online orders cancelled for stock-outs
Cross-linked: primary service is API & Integration
Read case study →

Serverless Applications on Google Cloud: Frequently Asked Questions

How is Cloud Run billed, and is it cheaper than a VM?

Cloud Run bills per vCPU-second and GiB-second of memory used by instances, plus a per-request charge under request-based billing, after a monthly free tier. For services idle much of the day, it is typically 40-70% cheaper than an always-on VM because it scales to zero. For services busy around the clock, instance-based billing with committed use discounts narrows or reverses the difference, so we model both.

What happened to Cloud Functions?

Cloud Functions became Cloud Run functions in 2024. Functions deployed from source are now built and run as Cloud Run services, so they share Cloud Run's scaling, concurrency, networking and revision management. Existing first-generation functions keep working, but we recommend moving to the current model to gain concurrency and longer timeouts, typically with small code changes for event signatures.

How do we migrate a monolith on VMs to Cloud Run?

Start by containerizing the monolith unchanged and running it on Cloud Run behind the same load balancer, which proves statelessness and session handling. Then extract the busiest or most change-prone modules into separate services, moving background work onto Cloud Tasks and cron jobs onto Cloud Scheduler with Cloud Run jobs. File writes to local disk must move to Cloud Storage first, as instance filesystems are ephemeral.

Can Cloud Run keep customer data within India?

Yes. Cloud Run, Cloud Tasks, Cloud Scheduler and Eventarc are available in Mumbai (asia-south1) and Delhi (asia-south2). Deploying services, queues and triggers in these regions, with databases and buckets pinned by organization policy, keeps processing and storage in India for DPDP Act 2023 commitments. A global load balancer in front still terminates TLS at Google's edge before forwarding to the India region.

How do we stop Cloud Run from overwhelming our database during a spike?

Set maximum instances based on database connection limits and per-instance pool size, raise concurrency so fewer instances serve the same load, and use Cloud SQL Managed Connection Pooling or a pooler where needed. Writes that do not need to be synchronous should go through Cloud Tasks with a dispatch rate the database can sustain, so spikes queue instead of failing.

How do Eventarc and Pub/Sub differ for triggering Cloud Run?

Pub/Sub is the messaging service; Eventarc is the routing layer that delivers events from many sources, including Cloud Storage, Cloud Audit Logs and Pub/Sub topics, to Cloud Run in CloudEvents format with filtering. Many Eventarc triggers use Pub/Sub as transport underneath. Use Eventarc when reacting to platform events; publish to Pub/Sub directly when your own services emit domain events.