What Is Cloud Run? Choosing Services and Background Workloads
Cloud Run is a platform for running containerized applications on Google Cloud’s managed infrastructure. You can run code as a service that handles web requests or events, as a job that exits when work is complete, or as a worker pool for continuous background consumption, without operating servers or a Kubernetes cluster yourself. The main decision is not simply whether to deploy a container; it is whether a service, job, or worker pool fits the workload’s trigger, scaling, cost, and state requirements.
What Is Cloud Run? Choosing Services and Background Workloads
Cloud Run is a platform for running containerized applications on Google Cloud’s managed infrastructure. You can run code as a service that handles web requests or events, as a job that exits when work is complete, or as a worker pool for continuous background consumption, without operating servers or a Kubernetes cluster yourself. The main decision is not simply whether to deploy a container; it is whether a service, job, or worker pool fits the workload’s trigger, scaling, cost, and state requirements.
What does Cloud Run manage, and what remains your responsibility?
Cloud Run manages the container execution environment and infrastructure scaling. You can deploy a container image or use supported source-based deployment, and a service provides a stable HTTPS endpoint. You still design request handling, authentication and authorization, capacity for external databases, safe retries, logs, and monitoring. Less infrastructure work does not remove application operations responsibilities.
Cloud Run offers services, jobs, and worker pools for different execution patterns. Services respond to HTTP requests and events; jobs run defined work to completion; worker pools handle continuous background processing that does not receive HTTP requests. The documentation also lists individually managed, long-lived Cloud Run instances as a separate resource. As of 2026-11-21, the documentation marked this resource as Preview; check its stage and terms before relying on it.
How do services and revisions handle requests?
A service exposes a stable URL, and each deployment creates an immutable revision. A revision includes container images and settings such as environment variables, memory limits, and request concurrency. Once a new revision is healthy, Cloud Run can route requests to it. Distinguishing the service from its revisions helps when rolling out changes or reverting a deployment.
The service’s ingress container must listen on the configured port at 0.0.0.0, not 127.0.0.1. The default port is 8080, and Cloud Run provides the PORT environment variable. If the container does not start and become ready within the required time, requests can fail. Configure startup probes and request timeouts, then verify readiness and responses in the deployed environment.
Does container file or process state persist?
Cloud Run instances can stop when traffic falls or scaling changes. The container filesystem is a temporary writable layer backed by memory; its data disappears when the instance stops. Use external storage such as Cloud Storage or a supported network file system for persistent files. Writing too much temporary data can consume the container’s memory, so account for it in memory limits.
Before a service instance shuts down, it can receive SIGTERM and get about 10 seconds to exit. Handle shutdown so the application can flush buffers or clean up, but do not assume an instance will remain running or every task will finish. Make retryable work safe to run more than once, and persist important data externally.
How should you tune autoscaling and request concurrency?
Cloud Run services adjust the number of container instances to requests, events, and CPU use, and by default can scale to zero when idle. Maximum concurrency is the upper limit on requests handled by one instance at the same time. Lower concurrency can require more instances for the same traffic, but may improve responsiveness when an app has limited parallelism or each request uses substantial CPU or memory. Higher concurrency may reduce instance count and cost, but the code and shared resources must safely handle parallel requests.
Start with the default and use load tests and monitoring to inspect latency, errors, CPU, memory, and instance count. A single-threaded app on a multi-vCPU instance may saturate one CPU while average CPU usage looks low. In that case, a concurrency limit can be a more direct scaling signal. Autoscaling can also increase database connections and quota demand; set a maximum instance count that backing services can handle.
How do billing and minimum instances affect cost?
Cloud Run services offer request-based and instance-based billing. With request-based billing, CPU is generally allocated while requests are being processed, which can fit intermittent or bursty traffic. With instance-based billing, CPU is allocated and charged over the instance lifecycle, which can suit short background work after a response. Cloud Run jobs use instance-based billing; worker pools are billed for the time their instances run.
Minimum instances can reduce cold-start latency, but keeping instances warm can cost money. Idle-instance charges also depend on the billing setting. A long-running singleton, a continuous non-HTTP queue consumer, and an HTTP request handler may fit different resource types: compare Cloud Run instances, worker pools, and services respectively. Estimate costs with current pricing and actual traffic; do not assume a savings percentage in advance.
Should you choose a service, job, or worker pool?
Use a service for a website, API, or HTTP/event-driven handler that responds to callers. A job can fit a migration or batch process that starts manually or on a schedule, completes its work, and exits. Consider a worker pool for a non-HTTP consumer that continuously pulls messages from Kafka or Pub/Sub. Worker pools do not autoscale by default, so you must configure instance counts or set up scaling from external metrics.
A simple decision rule is to look at the trigger and completion behavior. If the workload responds to requests and should scale with traffic, start with a service. If a bounded execution should finish and exit, use a job. If it continuously pulls work without an HTTP endpoint, consider a worker pool. Push-based queue delivery to a service and pull-based worker consumption differ in retry and scaling behavior, so design delivery guarantees and duplicate handling as well.
Example: how would you process uploaded images?
Assume a user uploads an image, a web API accepts the request and schedules work, and a separate process converts the image and saves the result. Put the fast HTTPS API in a Cloud Run service and store source and output files in Cloud Storage rather than the temporary container filesystem. If each conversion runs to completion, a Cloud Run job may fit; if a process must continuously pull from a queue, consider a worker pool.
Put the object path and processing identifier in each message, and make processing idempotent so a redelivered message does not corrupt the result. Set service instance limits and job parallelism based on database and storage quotas. Use logs and metrics to trace the flow from upload to completion. In a small pilot, test retries, invalid files, partial failures, denied permissions, and recovery before increasing volume. This is an illustrative assumption, not a measured performance or cost result.
When should you consider another runtime?
Cloud Run can fit when you want managed container execution and request-driven scaling, and can design the app to tolerate instance replacement. If you need fine-grained control over nodes, networking, and orchestration, consider Google Kubernetes Engine. If you need guest-OS control or long-lived machine state, consider Compute Engine. A managed application platform for a specific language runtime may also reduce operations work further.
Before choosing Cloud Run, check the container runtime contract, file persistence, request timeouts, concurrency, backing-service connection limits, and billing model. Apps that rely on a particular port binding or temporary files may need changes. Feature availability and pricing can change, so verify a small deployment in the intended region and configuration.
References
[Google Cloud: What is Cloud Run?](https://docs.cloud.google.com/run/docs/overview/what-is-cloud-run)
[Google Cloud: Cloud Run deployment options and resource model](https://docs.cloud.google.com/run/docs/resource-model)
[Google Cloud: Container runtime contract](https://docs.cloud.google.com/run/docs/container-contract)
[Google Cloud: Service instance autoscaling](https://docs.cloud.google.com/run/docs/about-instance-autoscaling)
[Google Cloud: Concurrent requests for services](https://docs.cloud.google.com/run/docs/about-concurrency)
[Google Cloud: Billing settings for services](https://docs.cloud.google.com/run/docs/configuring/billing-settings)
[Google Cloud: Minimum instances](https://docs.cloud.google.com/run/docs/configuring/min-instances)
Google Cloud documentation checked on 2026-11-21. Resource launch stages, limits, regional availability, and prices can change; verify current documentation before deployment.