# Heroku H12: Request timeout

> Heroku H12 means a request got no response data within 30 seconds. See the router log line, the 30 and 55 second windows, and fixes by stack and workload.

Canonical: https://scaplet.com/errors/cdn/heroku-h12-request-timeout

Guide Error · CDN and hosting errors

Heroku H12 means a request got no response data within 30 seconds. See the router log line, the 30 and 55 second windows, and fixes by stack and workload.

5 min

read

6

sources

Oct 31, 2026

updated

Scaplet Editorial Team

author

In one line

Heroku H12 means a request took longer than 30 seconds, so the router returned a 503 and logged `code=H12 desc="Request timeout"`. The limit is measured by the router, including time queued inside the dyno. Your app keeps working on the request after the router gives up, so fix slow work, move it to a background job, or stream data to keep the connection alive.

30-second check

## Where does your site stand?

Four quick questions, then a straight answer.

1/4Have you checked your own site for this?

Summarize this page with [ChatGPT](https://chatgpt.com/?hints=search&q=Summarize%20https%3A%2F%2Fscaplet.com%2Ferrors%2Fcdn%2Fheroku-h12-request-timeout%20(%22Heroku%20H12%3A%20Request%20timeout%22)%20in%205%20bullet%20points%2C%20then%20tell%20me%20the%20one%20thing%20I%20should%20do%20next.) [Claude](https://claude.ai/new?q=Summarize%20https%3A%2F%2Fscaplet.com%2Ferrors%2Fcdn%2Fheroku-h12-request-timeout%20(%22Heroku%20H12%3A%20Request%20timeout%22)%20in%205%20bullet%20points%2C%20then%20tell%20me%20the%20one%20thing%20I%20should%20do%20next.) [Perplexity](https://www.perplexity.ai/search?q=Summarize%20https%3A%2F%2Fscaplet.com%2Ferrors%2Fcdn%2Fheroku-h12-request-timeout%20(%22Heroku%20H12%3A%20Request%20timeout%22)%20in%205%20bullet%20points%2C%20then%20tell%20me%20the%20one%20thing%20I%20should%20do%20next.) [![Google](/logos/ai/google-color.svg)AI Mode](https://www.google.com/search?udm=50&q=Summarize%20https%3A%2F%2Fscaplet.com%2Ferrors%2Fcdn%2Fheroku-h12-request-timeout%20(%22Heroku%20H12%3A%20Request%20timeout%22)%20in%205%20bullet%20points%2C%20then%20tell%20me%20the%20one%20thing%20I%20should%20do%20next.)

On this page

## 6 parts, 5 minutes.

1. [What the router measures 01](#what-the-router-measures)
2. [The windows and limits that decide H12 versus its neighbours 02](#the-windows-and-limits-that-decide-h12-versus-its-neighbours)
3. [Reproduce it and measure it 03](#reproduce-it-and-measure-it)
4. [Fixes by cause 04](#fixes-by-cause)
5. [Streaming, long-polling and uploads 05](#streaming-long-polling-and-uploads)
6. [What H12 means for SEO 06](#what-h12-means-for-seo)

_01_Check it

## What the router measures

An HTTP request that takes longer than 30 seconds to complete produces H12. Heroku's documentation is precise about what counts: "This 30-second limit is measured by the router, and includes all time spent in the dyno, including the kernel's incoming connection queue and the app itself." A request that waits behind other requests inside a busy dyno spends its 30 seconds the same way as one stuck on a slow query.

Two things to read from that example. `service=30001ms` is the signature of H12. And the app logged `Completed in 37000ms` five seconds after the router had already answered 503. Heroku says the dyno "will continue to process the request, even though it won't be able to send any response", so a timed-out request still burns CPU and can slow the next one.

Heroku's H12 example: the router gives up, the app does not

```
2010-10-06T21:51:37-07:00 heroku[router]: at=error code=H12 desc="Request timeout" method=GET path="/" host=example-app-1234567890ab.herokuapp.com fwd=17.17.17.17 dyno=web.1 connect=6ms service=30001ms status=503 bytes=0 2010-10-06T21:51:42-07:00 app[web.2]: Completed in 37000ms (View: 27, DB: 21) | 200 OK [http://myapp.heroku.com/]
```

_02_Documented routing timeouts

## The windows and limits that decide H12 versus its neighbours

Limit

### Initial response window

Value

30 seconds

What happens past it

The web process must send response data (a full response or some bytes). Otherwise H12

Limit

### Rolling window after the first byte

Value

55 seconds

What happens past it

Each byte sent or received resets it. With no data for 55 seconds the connection is terminated and H15 or H28 is logged

Limit

### Total time to connect to a dyno

Value

75 seconds

What happens past it

The router retries connecting; if every dyno is quarantined for the full 75 seconds it answers 503 with H34

Limit

### Router to dyno keep-alive idle timeout

Value

90 seconds

What happens past it

The router quietly closes the idle connection. A server idle timeout under 90 seconds can race with it and cause H18 or H13

Limit

### Private Spaces, connection refused or timed out

Value

30 seconds

What happens past it

The router does not try another dyno and returns H12

The first row is the one most people hit. A response that has started streaming is governed by the 55 second window instead, which is how long-polling and server-sent events stay open on Heroku.

_03_How it works

## Reproduce it and measure it

Time the request and watch the router

```
curl -sS -o /dev/null -w "%{http_code} %{time_total}s\n" https://your-app.herokuapp.com/slow-path heroku logs --dyno router --tail
```

1. 01

### Time the failing URL

Run the `curl` below. A response that returns 503 after about 30 seconds matches H12. A 503 that returns instantly is H10 or H14.
2. 02

### Confirm in the router log

Run `heroku logs --dyno router --tail` and look for `code=H12` with `service=30001ms`-style values.
3. 03

### Find where the time goes

In the app log lines for the same request, compare the Heroku example's `View` and `DB` figures, or your own timing logs, to see whether the wait is the database, an outside API or your code.
4. 04

### Check for queueing

If each request is fast alone but H12 appears under load, requests are queueing inside the dyno behind slow ones. Heroku suggests the New Relic add-on for visibility into request queue time.

_04_What Heroku documents for each cause

## Fixes by cause

Cause

### An infinite loop in the code

Fix

Reproduce locally, possibly with a copy of the production database, and fix the bug

Cause

### Long work inside the web process: sending email, remote API calls, scraping, [rendering](/glossary/rendering) an image or PDF, heavy computation, slow or N+1 database queries

Fix

Move it into a background job on a worker dyno and return immediately

Cause

### An external service is slow or down

Fix

Set a timeout on outgoing HTTP requests and plan for the failure case, or move the call to the background

Cause

### Large uploads on a slow connection take over 30 seconds

Fix

Upload directly to S3 instead of through the dyno

Cause

### Requests queue behind a single-threaded server

Fix

Run more processes per dyno (Unicorn or Gunicorn), make slow requests faster, then add dynos

Procfile: Gunicorn with a worker timeout below the router's 30 seconds

```
web: gunicorn hello:app --timeout 10
```

config/unicorn.rb: Heroku's example

```
timeout 15
```

Heroku's guidance on lower server-side timeouts: Gunicorn restarts a worker that has not completed any work within 30 seconds by default, and with Unicorn the master sends SIGKILL to a worker after the timeout with no exception raised. The `rack-timeout` gem set below 30 seconds, for example 15, does raise an error, which makes the slow request far easier to trace. Note that Heroku lists a Unicorn timeout under 30 seconds, with a request still waiting for a worker, as one cause of [H13](/errors/cdn/heroku-h13).

Keep it in the request when
- The slow part is one query you can index or one call you can cache
- A user is waiting and a second or two of work can be made fast
- You can stay under the 30 second window with margin

Move it to a worker when
- It sends email, renders files or calls slow outside APIs
- Its runtime varies with input size
- The user can be shown a status page and polled

_05_Good to know

## Streaming, long-polling and uploads

After the first byte, each byte resets a 55 second window. For server-sent events, detect when the client has hung up and close the connection promptly, because a connection held open for 55 seconds with no data ends in a timeout. If you cannot stream, send the first bytes early so the initial 30 seconds is satisfied.

A longer app timeout does not raise the router limit

No setting in your app server extends the 30 second router window. The Request Timeout article documents no setting that changes it; the levers are to respond sooner or send data sooner.

_06_Explained

## What H12 means for SEO

H12 is a 503 to the crawler. Google says 5xx and 429 responses "prompt Google's crawlers to temporarily slow down with crawling" and that indexed URLs are kept but "eventually dropped". Slow pages that sometimes cross 30 seconds are rarer than outright crashes, but they cost crawl rate the same way. See timeout errors and [5xx server errors](/seo-issues/server-errors-5xx) for how to find the affected URLs.

Sources · 6

## Every fact, linked and dated.

Official docs first. The date is when we last opened each page.

- heroku.com
- google.com
- mozilla.org

1. 01 [Heroku Dev Center: Heroku Error Codes](https://devcenter.heroku.com/articles/error-codes) devcenter.heroku.com · checked 2026-11-01
2. 02 [Heroku Dev Center: Request Timeout](https://devcenter.heroku.com/articles/request-timeout) devcenter.heroku.com · checked 2026-11-01
3. 03 [Heroku Dev Center: HTTP Routing](https://devcenter.heroku.com/articles/http-routing) devcenter.heroku.com · checked 2026-11-01
4. 04 [Heroku Dev Center: Deploying Python Applications with Gunicorn](https://devcenter.heroku.com/articles/python-gunicorn) devcenter.heroku.com · checked 2026-11-01
5. 05 [How HTTP status codes affect Google's crawlers](https://developers.google.com/crawling/docs/troubleshooting/http-status-codes) developers.google.com · checked 2026-11-01
6. 06 [MDN: 503 Service Unavailable](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/503) developer.mozilla.org · checked 2026-11-01

Questions

## Asked a lot.

4 questions people ask next, answered from the sources on this page.

_01_ How long is the Heroku request timeout?

The initial window is 30 seconds for the web process to return response data. After that, each byte sent or received resets a rolling 55 second window. Past 30 seconds with no data you get H12; past 55 seconds with no data mid-response you get H15 or H28.

_02_ Can I increase the Heroku 30 second timeout?

Not through app settings. The limit is enforced by the router. Heroku's documented answers are to speed up the work, move it to a background job, upload large files directly to S3, or stream data so the rolling 55 second window applies.

_03_ Why does my app keep running after an H12?

Heroku says the web dyno that was processing the request is left untouched and continues to process it even though it cannot send a response. Add a server-level or application-level timeout shorter than 30 seconds to stop runaway requests.

_04_ Is H12 the same as a 504?

No. Heroku's router returns H12 with `status=503`. A 504 is the gateway timeout code in HTTP, so the meaning is close, but the [status code](/glossary/http-status-codes) your client and Google see is 503.

## Keep learning

[All errors](/errors)

[Learn Heroku H10: App crashed CDN and hosting errors](/errors/cdn/heroku-h10-app-crashed) [Related 504 Gateway Timeout HTTP status codes](/errors/http/504) [Read next Heroku H13: Connection closed without response CDN and hosting errors](/errors/cdn/heroku-h13) [Do Run a free site audit Free, about two minutes](/site-audit)

More Heroku errors
[Heroku 503 Service Unavailable](/errors/cdn/heroku-503) [Heroku H10: App crashed](/errors/cdn/heroku-h10-app-crashed) [Heroku H13: Connection closed without response](/errors/cdn/heroku-h13) [Heroku H14: No web processes running](/errors/cdn/heroku-h14)

More in CDN and hosting errors
[Cloudflare 504 Gateway Timeout](/errors/cdn/cloudflare-504) [Cloudflare Pages 404 Not Found](/errors/cdn/cloudflare-pages-404) [Cloudflare too many redirects (ERR_TOO_MANY_REDIRECTS)](/errors/cdn/cloudflare-too-many-redirects) [Cloudflare verify you are human loop](/errors/cdn/cloudflare-verify-you-are-human-loop) [CloudFront 400: Bad Request](/errors/cdn/cloudfront-400) [CloudFront 404 Not Found](/errors/cdn/cloudfront-404) [CloudFront 503: Service Unavailable](/errors/cdn/cloudfront-503) [Firebase Hosting 404](/errors/cdn/firebase-hosting-404) [GitHub Pages 404 Not Found](/errors/cdn/github-pages-404) [Google Cloud 502 Bad Gateway](/errors/cdn/google-cloud-502) [Heroku 503 Service Unavailable](/errors/cdn/heroku-503) [Heroku H10: App crashed](/errors/cdn/heroku-h10-app-crashed) [Heroku H12: Request timeout](/errors/cdn/heroku-h12-request-timeout) [Heroku H13: Connection closed without response](/errors/cdn/heroku-h13) [Heroku H14: No web processes running](/errors/cdn/heroku-h14) [Netlify build failed](/errors/cdn/netlify-build-failed) [Netlify function timeout](/errors/cdn/netlify-function-timeout) [Render 502 Bad Gateway](/errors/cdn/render-502) [S3 Access Denied (403 Forbidden)](/errors/cdn/s3-access-denied) [Vercel 413: FUNCTION_PAYLOAD_TOO_LARGE](/errors/cdn/vercel-payload-too-large) [Vercel 429: Too Many Requests](/errors/cdn/vercel-429) [Vercel 500: Internal Server Error](/errors/cdn/vercel-500) [Vercel build failed](/errors/cdn/vercel-build-failed) [Vercel domain not working](/errors/cdn/vercel-domain-not-working)

Terms on this page
[Rendering](/glossary/rendering) [HTTP status codes](/glossary/http-status-codes)

Free · 2 minutes

## Tools point. Agencies advise. _This one ships._

Run the free audit, then approve the fixes. Every change can be undone.

[Audit my site free](/site-audit)

Free, no card 60 seconds Nobody will call you

- **46** fixes shipped without a ticket Brightpipe
- **0→7** ChatGPT citations in six weeks Paylane
