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
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.
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.
Four quick questions, then a straight answer.
From your answers, this is quietly costing you traffic and nobody has the hours to chase it. Scaplet finds every affected page, drafts the fixes and tracks how AI answers mention you.
A data platform shipped 46 fixes without a ticket.
This looks handled. Re-check after a redesign, a migration or a big content push; that is when it breaks.
Your site is small and you have the time. Work through the steps on this page, starting with the pages that get the most traffic.
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.
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/]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.
curl -sS -o /dev/null -w "%{http_code} %{time_total}s\n" https://your-app.herokuapp.com/slow-path
heroku logs --dyno router --tailRun the curl below. A response that returns 503 after about 30 seconds matches H12. A 503 that returns instantly is H10 or H14.
Run heroku logs --dyno router --tail and look for code=H12 with service=30001ms-style values.
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.
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.
web: gunicorn hello:app --timeout 10timeout 15Heroku'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.
4 questions people ask next, answered from the sources on this page.
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.
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.
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.
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 your client and Google see is 503.
Run the free audit, then approve the fixes. Every change can be undone.