# Heroku H13: Connection closed without response

> Heroku H13 means your dyno accepted a connection and closed it without writing a response. Learn the keep-alive race, Unicorn timeout cause and per-server fixes.

Canonical: https://scaplet.com/errors/cdn/heroku-h13

Guide Error · CDN and hosting errors

Heroku H13 means your dyno accepted a connection and closed it without writing a response. Learn the keep-alive race, Unicorn timeout cause and per-server fixes.

5 min

read

9

sources

Oct 30, 2026

updated

Scaplet Editorial Team

author

In one line

Heroku H13 means a process in your web dyno accepted a connection and then closed the socket without writing anything, so the router returned a 503. The two documented causes are a server timeout shorter than 30 seconds that fires before a worker handles the request, and a keep-alive idle timeout under 90 seconds that races the router.

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-h13%20(%22Heroku%20H13%3A%20Connection%20closed%20without%20response%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-h13%20(%22Heroku%20H13%3A%20Connection%20closed%20without%20response%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-h13%20(%22Heroku%20H13%3A%20Connection%20closed%20without%20response%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-h13%20(%22Heroku%20H13%3A%20Connection%20closed%20without%20response%22)%20in%205%20bullet%20points%2C%20then%20tell%20me%20the%20one%20thing%20I%20should%20do%20next.)

On this page

## 5 parts, 5 minutes.

1. [What H13 looks like 01](#what-h13-looks-like)
2. [Cause 1: your server's timeout fires first 02](#cause-1-your-server-s-timeout-fires-first)
3. [Cause 2: the keep-alive race with the router 03](#cause-2-the-keep-alive-race-with-the-router)
4. [Work out which cause you have 04](#work-out-which-cause-you-have)
5. [What H13 means for crawlers 05](#what-h13-means-for-crawlers)

_01_H13 beside the codes it is confused with

## What H13 looks like

H13 is logged when "a process in your web dyno accepts a connection but then closes the socket without writing anything to it." The router logs it as an error with status 503. Heroku's example shows both a connect time and a service time, which tells you the connection was made and something then went wrong inside the dyno.

Code

### H13

What the socket did

Accepted, then closed with nothing written

Documented trigger

Server timeout under 30 seconds; keep-alive race

Code

### H18

What the socket did

Connected, some data sent, then destroyed before a complete response

Documented trigger

Also the keep-alive race; or a response sent before the request body was fully read

Code

### H12

What the socket did

Held open past 30 seconds with no response data

Documented trigger

Slow request, see [H12](/errors/cdn/heroku-h12-request-timeout)

Code

### H10

What the socket did

No live dyno at all

Documented trigger

Crash or boot timeout, see [H10](/errors/cdn/heroku-h10-app-crashed)

Heroku's H13 example

```
2010-10-06T21:51:37-07:00 heroku[router]: at=error code=H13 desc="Connection closed without response" method=GET path="/" host=example-app-1234567890ab.herokuapp.com fwd=17.17.17.17 dyno=web.1 connect=3030ms service=9767ms status=503 bytes=0
```

_02_Check it

## Cause 1: your server's timeout fires first

Heroku's example: a Unicorn web server "configured with a timeout shorter than 30s" where "a request has not been processed by a worker before the timeout happens". Unicorn closes the connection before any data is written, which is an H13. The router limit is 30 seconds; a shorter server limit means the server cuts the connection and the router sees a socket with nothing on it.

The same article warns that with Unicorn or Gunicorn, your main worker can time out and kill web workers. Gunicorn restarts a worker that has not completed any work within the last 30 seconds by default, and Heroku's Gunicorn guide shows `--timeout` for lowering it. If requests queue behind slow ones, workers hit that timeout while requests wait. Fix the slow request, add worker processes, or tune the timeout deliberately.

Procfile: Gunicorn timeout, Heroku's example value

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

_03_Fix it on your stack

## Cause 2: the keep-alive race with the router

Heroku's routers keep a pool of connections to your dynos. An idle pooled connection is closed by the router after 90 seconds, quietly, with no error code. Heroku's warning: if your server's idle timeout is under 90 seconds, "this may introduce a race condition between the router sending a request and the dyno's server closing a stale connection", which "can lead to H18: Server Request Interrupted or H13: Connection closed without response errors."

Node.js: keep connections open longer than the router does
Node.js: keep connections open longer than the router does

```
const server = app.listen(process.env.PORT); // milliseconds; Heroku recommends 90 seconds or greater server.keepAliveTimeout = 95 * 1000;
```

config/puma.rb
config/puma.rb

```
persistent_timeout 95
```

Procfile: Gunicorn
Procfile: Gunicorn

```
web: gunicorn hello:app --keep-alive 95
```

The recommendation is to set server idle connection timeouts to 90 seconds or greater so the router initiates the close. The defaults of common servers are below that, which is why this shows up as sporadic H13s on an otherwise healthy app.

Default idle or keep-alive settings against the 90 second router timeout
| Server | Setting | Default | Safe for Heroku as is? |
| Node.js `http` | `server.keepAliveTimeout` | 5000 ms (5 seconds) | No - raise it above 90 seconds |
| Puma | `persistent_timeout` | 65 seconds | No - raise it to 90 or more |
| Gunicorn | `--keep-alive` | 2 seconds | No - raise it, or confirm your worker class |

Gunicorn's `keepalive` setting is described as "the number of seconds to wait for requests on a Keep-Alive connection". Check that your worker class honors it before relying on it. Node's `server.keepAliveTimeout` is documented as milliseconds of inactivity before a socket is destroyed, with a `server.keepAliveTimeoutBuffer` added on top.

_04_How it works

## Work out which cause you have

Raise the idle timeout when
- H13s are sporadic and quick
- Your server's keep-alive default is under 90 seconds
- The app is otherwise healthy

Disable keep-alive to the dyno when
- You cannot change the server's idle timeout
- You are on a Cedar-generation app (Heroku says it cannot be disabled on Fir)
- You accept losing connection reuse between router and dyno

1. 01

### Pull the H13 lines

Run `heroku logs --dyno router --tail` and note the `connect` and `service` values on each H13. Compare them with your server's timeout and keep-alive settings.
2. 02

### Look at the app log at the same time

Run `heroku logs --source app --tail` and check for the server's own timeout or worker-killed message at the same timestamp.
3. 03

### Compare your server's idle timeout with 90 seconds

If it is lower, apply the table above first. It is a one-line change.
4. 04

### Run more than one process per dyno

Heroku's request-timeout article lists Unicorn or Gunicorn with more worker processes as the most effective way to improve queueing inside a dyno.

_05_Good to know

## What H13 means for crawlers

Because H13 is returned as a 503, Google treats it as a server error: crawlers "temporarily slow down with crawling", and indexed URLs are kept but "eventually dropped" if errors persist. Sporadic H13s are less damaging than steady ones, but a crawler is one of the clients that holds connections, so fix the keep-alive race rather than waiting it out. See [5xx server errors](/seo-issues/server-errors-5xx).

A request can succeed on retry

A stale-connection H13 is a race, so the same request often works a moment later. That makes it easy to dismiss and easy to miss in manual testing. The router log is where it shows up.

Sources · 9

## Every fact, linked and dated.

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

- heroku.com
- nodejs.org
- githubusercontent.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: HTTP Routing](https://devcenter.heroku.com/articles/http-routing) devcenter.heroku.com · checked 2026-11-01
3. 03 [Heroku Dev Center: Request Timeout](https://devcenter.heroku.com/articles/request-timeout) 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 [Node.js: HTTP, server.keepAliveTimeout](https://nodejs.org/api/http.html) nodejs.org · checked 2026-11-01
6. 06 [Gunicorn source: config.py (Keepalive setting)](https://raw.githubusercontent.com/benoitc/gunicorn/master/gunicorn/config.py) raw.githubusercontent.com · checked 2026-11-01
7. 07 [Puma source: lib/puma/dsl.rb (persistent_timeout)](https://raw.githubusercontent.com/puma/puma/master/lib/puma/dsl.rb) raw.githubusercontent.com · checked 2026-11-01
8. 08 [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
9. 09 [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_ What causes Heroku H13?

A process in the web dyno accepted a connection and closed the socket without writing a response. Heroku names a server timeout shorter than 30 seconds, such as Unicorn's, and a keep-alive idle timeout shorter than the router's 90 seconds as the documented causes.

_02_ Why do I get random H13 errors on a healthy app?

Likely the keep-alive race. The router closes idle pooled connections after 90 seconds, and a server with a shorter idle timeout may close the same connection while the router sends a request on it. Raise the server idle timeout to 90 seconds or more.

_03_ Is H13 my application's fault?

It starts in the dyno, so the fix is in your server or app configuration, not on Heroku's side. Check your server's timeout and keep-alive settings and look for workers being killed.

_04_ What is the difference between H13 and H18?

H13 is a socket that closed with nothing written. H18 is a socket that connected and sent some data but was destroyed before a complete response, or a server that responded before reading the whole request body.

## Keep learning

[All errors](/errors)

[Learn Heroku H10: App crashed CDN and hosting errors](/errors/cdn/heroku-h10-app-crashed) [Related 503 Service Unavailable HTTP status codes](/errors/http/503) [Read next Heroku H12: Request timeout CDN and hosting errors](/errors/cdn/heroku-h12-request-timeout) [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 H12: Request timeout](/errors/cdn/heroku-h12-request-timeout) [Heroku H14: No web processes running](/errors/cdn/heroku-h14)

Nearby in errors
[AWS Lambda timeout](/errors/cdn/lambda-timeout)

More in CDN and hosting errors
[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) [Vercel FUNCTION_INVOCATION_TIMEOUT](/errors/cdn/vercel-function-invocation-timeout)

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
