---
title: "Short Time Outs and Asynchronous Requests on Heroku"
description: "Heroku’s short request timeout and H12 errors reflect a scaling problem: standard web servers process queued requests serially, so one long operation can block others. The post separates slow server-side actions, such as video processing or PDF generation, from file uploads, and recommends background processes for the former and direct browser uploads to Amazon S3 or Google Cloud Storage for the latter. When a client must wait for completion, it describes polling or a WebSocket, noting that WebSocket connections close after 55 seconds of inactivity and ordinary pages still need to respond within 30 seconds. Avoiding lengthy web-process work improves performance and scalability; rack-timeout for Ruby or expressjs’ timeout for Node can terminate requests after a few seconds, with a recommended limit no higher than 10 seconds."
---

# Short Time Outs and Asynchronous Requests on Heroku

[Heroku](https://yomu.fyi/company/heroku) · Damien Mathieu · Dec 5, 2014

**Type:** Explainer

## Summary

Heroku’s short request timeout and H12 errors reflect a scaling problem: standard web servers process queued requests serially, so one long operation can block others. The post separates slow server-side actions, such as video processing or PDF generation, from file uploads, and recommends background processes for the former and direct browser uploads to Amazon S3 or Google Cloud Storage for the latter. When a client must wait for completion, it describes polling or a WebSocket, noting that WebSocket connections close after 55 seconds of inactivity and ordinary pages still need to respond within 30 seconds. Avoiding lengthy web-process work improves performance and scalability; rack-timeout for Ruby or expressjs’ timeout for Node can terminate requests after a few seconds, with a recommended limit no higher than 10 seconds.

## Context

Customers encounter H12 errors when long-running requests occupy standard web servers and queued requests cannot be processed within the timeout window. Slow actions can consume substantial memory or CPU, while file uploads may take unpredictable amounts of time because of the client’s connection.

## Approach / What changed

Run slow actions asynchronously in background processes, upload files directly from the browser to storage services such as Amazon S3 or Google Cloud Storage, and use polling or WebSockets when clients need completion updates. Configure rack-timeout or expressjs’ timeout to stop requests that remain queued or execute too long.

## Takeaways

- Standard web servers process queued requests serially, so a long-running operation can prevent other requests from being handled promptly.
- Direct JavaScript uploads to Amazon S3 or Google Cloud Storage keep slow file transfers from passing through the web server.
- WebSocket connections can remain open while they receive data regularly, but close after 55 seconds of inactivity; rack-timeout and expressjs’ timeout can terminate requests sooner.

**Tags:** [Heroku](https://yomu.fyi/topic/heroku), [Scalability](https://yomu.fyi/topic/scalability), [WebSockets](https://yomu.fyi/topic/websockets)

- Source: [Heroku](https://www.heroku.com/blog/timeout-quickly)
- Source URL: https://www.heroku.com/blog/timeout-quickly
- Ingested by Yomu: 2026-09-09T14:23:44.816Z

[Read original post](https://www.heroku.com/blog/timeout-quickly)
