---
title: "Learn How to Lower Heroku Dyno Latency through Persistent Connections (Keep-alive)"
description: "HTTP keep-alive connections cut latency by reusing TCP connections, so repeat requests skip the handshake and TCP slow start and run at full bandwidth."
url: "https://swe.quest/articles/learn-how-to-lower-heroku-dyno-latency-through-persistent-connections-keep-alive-3816d278b532e549"
canonical: "https://www.heroku.com/blog/learn-how-to-lower-heroku-dyno-latency-keep-alive/"
source: "Heroku Engineering"
published: "2025-11-04"
difficulty: "medium"
kind: "How-to"
reading_minutes: 6
tags: ["networking","performance","ruby","cloud"]
---

# Learn How to Lower Heroku Dyno Latency through Persistent Connections (Keep-alive)

A post on [Heroku Engineering](https://swe.quest/sources/heroku.md), published 2025-11-04, 6 min read, How-to. Original: [https://www.heroku.com/blog/learn-how-to-lower-heroku-dyno-latency-keep-alive/](https://www.heroku.com/blog/learn-how-to-lower-heroku-dyno-latency-keep-alive/)

## Summary

HTTP keep-alive connections cut latency by reusing TCP connections, so repeat requests skip the handshake and TCP slow start and run at full bandwidth. HTTP/1.0 opened one connection per request; HTTP/1.1 decoupled requests from connections through pipelining and keep-alive. Heroku Router 2.0 now uses keep-alive to dynos by default. Ruby apps that disabled keep-alives over earlier latency spikes should upgrade to Puma 7.1.0+ and can check settings with PUMA\_LOG\_CONFIG and the http-disable-keepalive-to-dyno labs flag.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [Networking](https://swe.quest/tags/networking.md) (Infrastructure)
- [Performance engineering](https://swe.quest/tags/performance.md) (Reliability & operations)
- [Ruby](https://swe.quest/tags/ruby.md) (Languages)
- [Cloud platforms](https://swe.quest/tags/cloud.md) (Infrastructure)

## Prerequisites

- HTTP basics
- TCP basics ([easy posts on Networking](https://swe.quest/tags/networking.md?difficulty=easy))

## Keywords

Heroku Router 2.0, Puma, TCP slow start, HTTP/1.1, keep-alive, Heroku

## Related posts

- [Upgrade to Puma 7 and Unlock the Power of Fair Scheduled Keep-alive](https://swe.quest/articles/upgrade-to-puma-7-and-unlock-the-power-of-fair-scheduled-keep-alive-798a2f5419631b82.md): Heroku Engineering · 2025-11-05 · Medium · 11 min read · Ruby, Concurrency, Performance engineering, Networking
  Puma 6 and earlier let a single keep-alive connection monopolize a thread for up to 10 requests via the "fast inline" loop originally built for HTTP pipelining, so under overload about one in ten requests waited roughly 10x longer while later keep-alive requests cut the line.
- [Pumas, Routers & Keepalives—Oh my!](https://swe.quest/articles/pumas-routers-keepalives-oh-my-4b676798ea4106ef.md): Heroku Engineering · 2024-11-21 · Medium · 17 min read · Debugging, Performance engineering, Ruby, Load balancing, Networking
  Elevated tail latency seen by some Puma apps after enabling Heroku Router 2.0 turned out to be a Puma bug, not a router problem.
- [Tips & Tricks for Migrating to Router 2.0](https://swe.quest/articles/tips-tricks-for-migrating-to-router-2-0-d21a58134b52266a.md): Heroku Engineering · 2024-11-21 · Medium · 5 min read · Load balancing, Networking, Cloud platforms, Deployment
  Heroku Router 2.0 is now generally available and will become the default, so apps should be validated on a staging copy first by enabling the http-routing-2-dot-0 feature and restarting dynos to drop legacy-router connections.
- [Router 2.0 Common Runtime Router: The Road to Beta](https://swe.quest/articles/router-2-0-common-runtime-router-the-road-to-beta-588e480683057806.md): Heroku Engineering · 2023-10-30 · Medium · 9 min read · Load balancing, Go, Refactoring & migrations, Deployment, Observability
  Heroku is replacing Hermes, its decade-old Erlang Common Runtime router, with Router 2.0 written in Go.
- [The Adventures of Rendezvous in Heroku’s New Architecture](https://swe.quest/articles/the-adventures-of-rendezvous-in-heroku-s-new-architecture-fa7c708c1d11ea33.md): Heroku Engineering · 2022-01-19 · Medium · 9 min read · Incidents & postmortems, Debugging, Ruby, Networking, Load balancing
  Moving Heroku's Rendezvous proxy, which splices CLI and one-off dyno connections across NATs, from EC2 Classic to VPC behind AWS Network Load Balancers with TLS termination broke one customer's request-scoped one-off dyno workflow with H12 router timeouts.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
