Updated Nov 23, 20266 min read

Cloud Run 503 Service Unavailable: Causes and Fixes

How to tell which of the four Cloud Run 503 errors you have, from the exact log message: no available instance, malformed response, memory limit and concurrency, and what to change for each, including moving bursty work off the request path.

Illustration for Cloud Run 503 Service Unavailable: Causes and Fixes

Cloud Run returns 503 for several different failures, and the status code alone does not say which one. The Cloud Logging entry has the answer in its message text, and each message has a different fix.

This guide goes through the messages in the order they show up in practice, with the settings to change for each.

Which Cloud Run 503 do you have?

The Cloud Run troubleshooting guide, checked on November 23, 2026, lists the messages below. Search the service's logs for the text in the first column.

Log messageLikely causeFirst fix
"The request failed because either the HTTP response was malformed or connection to the instance had an error."Out-of-memory kill, failed liveness probe or a framework timeoutCheck memory and probe logs
"While handling this request, the container instance was found to be using too much memory and was terminated."Memory limit exceededRaise memory or fix the leak
"The Cloud Run service probably has reached its maximum container instance limit."CPU-heavy requests with high concurrencyRaise max instances or lower concurrency
"The request was aborted because there was no available instance."Instance limit reached or a burst faster than scalingMax instances, min instances, CPU boost

The last message appears as a 429 when the cause is the instance limit and as a 500 when Cloud Run could not scale fast enough, so a 503 with other text is worth checking against the first three rows first.

How do you fix the malformed response error?

Look in the logs at the same timestamp for three things. Out-of-memory messages mean the container was killed mid-request, and the fix is more memory or less memory use. Liveness probe failures, which appear as "LIVENESS HTTP probe failed", mean the instance did not answer the probe in time and was shut down, so raise the probe timeout or find what blocks the event loop. Framework timeouts matter when requests end with 503 before the Cloud Run timeout: Node.js servers can end connections through the server.timeout property, and Python servers behind Gunicorn stop workers at the default 30-second worker timeout, which logs [CRITICAL] WORKER TIMEOUT.

If the service goes through a Serverless VPC Access connector, check the connector's throughput chart as well. A connector that saturates produces 503s under load tests that look like an application problem.

How do you fix the max instances and concurrency errors?

Check the container instance count metric in Cloud Monitoring. If it sits at the configured maximum, raise --max-instances or request a quota increase, and make sure a revision-level limit is not capping a service-level one. When requests are CPU heavy, lower --concurrency so each instance takes fewer at once, since an instance at 100% CPU with 80 requests in flight returns errors instead of finishing any of them, as described in Cloud Run concurrency.

For bursts that arrive faster than instances start, set --min-instances to at least 1 so a warm instance exists, and enable --cpu-boost to give containers extra CPU while they start. Google also recommends that clients retry with exponential backoff, since a burst that lasts a second is only visible in Cloud Monitoring at fine resolution.

gcloud run services update api --region=europe-west1 \ --max-instances=50 --min-instances=1 --concurrency=20 --cpu-boost

What if the work should not be on the request path?

A webhook receiver that does its processing inside the request holds an instance for the full duration of every call, so a burst of 500 webhooks needs 500 slots of the slowest part of the work. Accepting the request, writing it to a queue and returning in milliseconds turns the burst into a backlog that a bounded number of workers drain at their own pace.

How does Encore queue bursty work on Cloud Run?

Encore brings infrastructure from code, so the queue behind a burst-prone endpoint is a Topic and a Subscription in the service. Per the GCP infrastructure docs, the platform provisions Pub/Sub with dead-letter topics and runs services on Cloud Run. Encore provisions an IAM role for the service, or a service account on GCP.

Application code passes through Encore and infrastructure guardrails to resources provisioned in your own AWS or GCP account.
Get started
brew install encoredev/tap/encore &&
encore app create
Copy

Run in your terminal to get started locally.

A webhook receiver that acknowledges immediately and processes with a bounded handler:

// webhooks/webhooks.ts import { api, APIError } from "encore.dev/api"; import { Topic, Subscription } from "encore.dev/pubsub"; import { Bucket } from "encore.dev/storage/objects"; interface WebhookEvent { eventId: string; type: string; payload: string; } const events = new Topic<WebhookEvent>("webhook-events", { deliveryGuarantee: "at-least-once" }); const archive = new Bucket("webhook-archive", { versioned: false }); // Returns as soon as the event is queued, so a burst never holds an instance for the full processing time. export const receive = api( { expose: true, method: "POST", path: "/webhooks/incoming" }, async (req: WebhookEvent): Promise<{ queued: boolean }> => { if (!req.eventId || !req.type) throw APIError.invalidArgument("eventId and type are required"); // In production, verify the provider's signature header here and reject anything unsigned. await events.publish(req); return { queued: true }; }, ); new Subscription(events, "process-event", { maxConcurrency: 10, ackDeadline: "60s", retryPolicy: { minBackoff: "10s", maxBackoff: "5m", maxRetries: 5 }, handler: async (event) => { const key = `${event.type}/${event.eventId}.json`; // The same event ID overwrites the same object, so a redelivery changes nothing. await archive.upload(key, Buffer.from(JSON.stringify(event)), { contentType: "application/json" }); }, });

The maxConcurrency setting is per service instance, and the Pub/Sub docs note it does not apply in every environment, so test the handler's limits under load before relying on the number. A message that keeps failing ends up in the dead-letter topic instead of retrying forever. Locally, encore run starts Pub/Sub and a bucket, so you can post to /webhooks/incoming and watch the handler without deploying.

To deploy, connect your GCP project as described in Connect your cloud account and push with git push encore.

A coding agent that is asked to fix 503s on a webhook endpoint can add the topic and subscription in the same change as the endpoint and run the burst locally, with no Pub/Sub topic or service account to create in the console.

Best fit: Teams on Cloud Run whose webhook or import endpoints return 503 during bursts and want the queue, retries and dead-letter topic in the service code.

What should you check first?

Find the exact message in Cloud Logging, match it to the table, and change one setting at a time. Check memory before concurrency, since a container that is killed for memory looks like a connection error and no instance setting fixes it.

Frequently asked questions

Why does Cloud Run return 503 Service Unavailable?

Usually because instances cannot take more requests: the service reached its maximum instance count, a container ran out of memory and was terminated, a liveness probe failed, or the response was malformed. The text of the log message tells you which one, and each has a different fix.

What does "malformed response or connection to the instance had an error" mean?

The container closed the connection or sent an invalid HTTP response, which is most often an out-of-memory kill, a failed liveness probe or a framework timeout that is shorter than the Cloud Run request timeout. Check Cloud Logging for memory messages and probe failures first.

How do I stop Cloud Run 503 errors during traffic spikes?

Raise the maximum instances if the service is capped, set minimum instances so warm capacity exists, enable startup CPU boost and lower concurrency if requests are CPU heavy. For bursts of slow work, accept the request, queue it and return quickly.

How do I absorb bursts on Cloud Run without managing Pub/Sub?

With Encore you declare a Topic and a Subscription in code, the endpoint publishes the work and returns, and the subscription handler processes it with its own retries. On GCP the deploy provisions Pub/Sub and runs the services on Cloud Run in your project.

Deploy to your cloud on AWS and Google Cloud
without managing infrastructure

Encore lets developers and agents define application infrastructure directly in code, then automatically provisions it from local development to production in your AWS or GCP account.

~/orders — claude
Claude Code
Claude Code v2.1.180Opus 5.5~/orders