Articles

Cloud Run timeout: the 60-minute request limit, WebSockets, and longer jobs

Cloud Run requests time out after 5 minutes by default and 60 at most. How to raise it, what a 504 leaves running, WebSockets, and jobs that run for days.

Updated

A Cloud Run service request can run for up to 60 minutes (3,600 seconds); the default is 5 minutes. When a request runs past its timeout, Cloud Run closes the connection and returns HTTP 504, but the container isn’t stopped and may keep working on it. WebSocket connections are requests too, so they are cut at the same timeout. For work that takes longer than an hour, a Cloud Run job can run each task for up to 7 days (168 hours).

Gregale publishes this page. Cloud Run’s limits come from Google’s docs, checked on December 3, 2026: request timeout, WebSockets, job task timeout, billing settings and pricing. Gregale’s limits come from its plans page.

Cloud Run timeout limits

WhatDefaultMaximum
Service request (HTTP, gRPC, WebSocket)5 minutes60 minutes
Job task, per attempt10 minutes168 hours (7 days); 12 hours with GPUs
Job executionNoneNo limit; it ends when every task is done
Pub/Sub push to a service (acknowledgment)10 seconds10 minutes
Cloud Scheduler HTTP target3 minutes30 minutes
Cloud Tasks HTTP target10 minutes30 minutes
Workflows HTTP request, synchronous5 minutes30 minutes

When Pub/Sub, Eventarc, Cloud Scheduler, Cloud Tasks or Workflows calls your service, its own timeout applies, so a Cloud Scheduler job stops waiting after 30 minutes even if the service allows 60.

How to change the timeout

With the gcloud CLI, in seconds or as a duration such as 20m:

bash
gcloud run services update my-service --timeout=3600

You can pass the same --timeout flag to gcloud run deploy, set timeoutSeconds in the service YAML, or enter a value from 1 to 3,600 seconds under Requests → Request timeout when you edit the service in the console. Each change creates a new revision.

Check your server too. Gunicorn, for example, kills a sync worker that stays busy for more than 30 seconds by default, whatever Cloud Run allows; raise --timeout, or set it to 0 and let Cloud Run’s timeout apply. Some clients also give up sooner than Cloud Run does.

What happens at the timeout

Cloud Run closes the connection and returns 504. The container keeps running, and the handler may go on working on the abandoned request while it serves others. Google suggests setting the timeout above the longest request you expect, or tracking the time left in your handler so it can clean up and return early.

For timeouts over 15 minutes, Google recommends retries and handlers that are safe to repeat: the longer a request runs, the more likely the connection is lost, and a retried request may reach a different instance.

WebSockets on Cloud Run

A WebSocket connection is a long HTTP request, so the request timeout ends it: after 5 minutes by default and 60 minutes at most, even if your server sets no limit. Google’s advice:

  • Raise the timeout to the longest you want a connection to stay open.
  • Reconnect in the client, with a library such as reconnecting-websocket or Socket.IO’s disconnect handling.
  • Turn on session affinity so a client tends to reconnect to the same instance. It’s best effort, so share state between instances anyway.

An instance with any open WebSocket counts as active, so it’s billed as instance-based billing for as long as connections stay open. One container can hold up to 1,000 concurrent requests, so raise the concurrency setting if your server can handle it.

Do you pay for the whole timeout?

With request-based billing, the default, Cloud Run charges while an instance starts, handles requests and shuts down, rounded up to 100 ms; requests that run at the same time on one instance share that time. So a request that runs the full hour bills the full hour. At the us-central1 rates of $0.000024 per vCPU-second and $0.0000025 per GiB-second, an hour with 1 vCPU and 512 MiB is about 9 cents, before the free tier of 180,000 vCPU-seconds, 360,000 GiB-seconds and 2 million requests a month.

When the work needs more than 60 minutes

  • Cloud Run jobs. A task can run for up to 7 days, and a job can split its work across many tasks. Google recommends turning on retries, especially for long tasks. Jobs always use instance-based billing.
  • Cloud Tasks. Queue the work and let a task call your service, with automatic retries, for up to 30 minutes per attempt.
  • Workflows with callbacks. For a workflow step that runs longer than 30 minutes, Google suggests a Cloud Run job or a callback endpoint.
  • Cloud Run instances, in preview since August 2026, run a single long-lived instance for up to 7 days.

If an API starts the work, don’t make the client wait for it: return 202 with a job ID and let the client poll. The Vercel timeout guide shows the pattern, and the AWS Lambda timeout guide covers Lambda's 30-minute limit.

Where Gregale fits

Cloud Run allows more time than Gregale does. Gregale’s HTTP request timeouts are 30 seconds on Free, 1 minute on Hobby, 5 minutes on Pro and 15 minutes on Scale, and its jobs run each task for up to 5 minutes on Hobby, 30 minutes on Pro and 1 hour on Scale. If your problem is a request or a job that needs more time, stay on Cloud Run.

Where Gregale differs is long-lived connections. Gregale’s managed realtime service holds the client’s WebSocket or SSE connection itself, so a client can stay connected for hours while your app is parked, and the app isn’t billed for the open connection. It isn’t on Gregale Free; Hobby, at $10 a month, allows 200 concurrent connections per account, Pro 1,000 and Scale 5,000. See realtime and WebSocket hosting that scales to zero.

What we verified

Cloud Run’s timeouts, WebSocket behavior, billing and prices are from Google’s docs on December 3, 2026, and Gunicorn’s default from its settings reference. We did not run a 60-minute Cloud Run request for this page. Gregale’s limits are from its plans page and plan limits table on the same date.

Questions

What is the maximum timeout for Cloud Run?

A Cloud Run service request can run for up to 60 minutes (3,600 seconds); the default is 5 minutes. A Cloud Run job task can run for up to 168 hours (7 days), or 12 hours with GPUs.

How do I increase the Cloud Run timeout?

Run gcloud run services update SERVICE --timeout=3600, pass --timeout to gcloud run deploy, set timeoutSeconds in the service YAML, or change Request timeout in the console. Also raise any timeout in your server, such as Gunicorn’s 30-second worker timeout.

Do WebSockets time out on Cloud Run?

Yes. A WebSocket connection is a request, so it closes at the service’s request timeout: 5 minutes by default and 60 minutes at most. Clients need to reconnect, and the instance is billed as active while any connection is open.

What happens when a Cloud Run request times out?

Cloud Run closes the connection and returns HTTP 504. The container keeps running and may go on working on the request, so a handler should track the time it has left and stop cleanly.