---
title: "Upgrade to Puma 7 and Unlock the Power of Fair Scheduled Keep-alive"
description: "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."
url: "https://swe.quest/articles/upgrade-to-puma-7-and-unlock-the-power-of-fair-scheduled-keep-alive-798a2f5419631b82"
canonical: "https://www.heroku.com/blog/upgrade-to-puma-7-and-unlock-the-power-of-fair-scheduled-keep-alive/"
source: "Heroku Engineering"
published: "2025-11-05"
difficulty: "medium"
kind: "Deep dive"
reading_minutes: 11
tags: ["ruby","concurrency","performance","networking"]
---

# Upgrade to Puma 7 and Unlock the Power of Fair Scheduled Keep-alive

A post on [Heroku Engineering](https://swe.quest/sources/heroku.md), published 2025-11-05, 11 min read, Deep dive. Original: [https://www.heroku.com/blog/upgrade-to-puma-7-and-unlock-the-power-of-fair-scheduled-keep-alive/](https://www.heroku.com/blog/upgrade-to-puma-7-and-unlock-the-power-of-fair-scheduled-keep-alive/)

## Summary

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. Puma 7 fixes this by requeuing pipelined and keep-alive requests at the back of the queue and removing the wait\_until\_not\_full block on the accept loop. To keep load balanced across workers, it extends wait\_for\_less\_busy\_worker with a proportional sleep, so busier workers wait longer before accepting. Capacity is unchanged, but overload delay is now spread fairly; upgrading to 7.1.0+ is recommended, especially for Heroku Router 2.0 users who disabled keep-alives.

Written by swe.quest, not by the author.

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

## Topics

- [Ruby](https://swe.quest/tags/ruby.md) (Languages)
- [Concurrency](https://swe.quest/tags/concurrency.md) (Compilers & runtimes)
- [Performance engineering](https://swe.quest/tags/performance.md) (Reliability & operations)
- [Networking](https://swe.quest/tags/networking.md) (Infrastructure)

## Prerequisites

- HTTP keep-alive and pipelining
- thread pools
- socket accept loops

## Keywords

Puma, Puma 7, HTTP/1.1 keep-alive, HTTP pipelining, Heroku Router 2.0, wait\_for\_less\_busy\_worker, max\_fast\_inline

## Related posts

- [Learn How to Lower Heroku Dyno Latency through Persistent Connections (Keep-alive)](https://swe.quest/articles/learn-how-to-lower-heroku-dyno-latency-through-persistent-connections-keep-alive-3816d278b532e549.md): Heroku Engineering · 2025-11-04 · Medium · 6 min read · Networking, Performance engineering, Ruby, Cloud platforms
  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.
- [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.
- [Worker Backpressure (Part 1)](https://swe.quest/articles/worker-backpressure-part-1-6d000eabc0ad7f1d.md): Canva Engineering · 2026-09-17 · Medium · 11 min read · Resilience, Queues & messaging, SRE
  Canva added Worker Backpressure to its shared queue library: each worker records success/failure outcomes, a pluggable controller maintains a backoff factor (0.0 to 1.0) against a failure-rate set point, and the factor scales down how many messages the worker may poll and process concurrently.
- [Node.js at scale, rebalanced: how we cut cost by 38%](https://swe.quest/articles/node-js-at-scale-rebalanced-how-we-cut-cost-by-38-1008b397ea498cc9.md): Booking.com Engineering · 2026-09-29 · Medium · 17 min read · JavaScript, Performance engineering, Cost optimization, Load balancing, Runtimes & VMs
  Booking.com cut compute costs for its largest Node.js React SSR service by 38% (30% fewer pods, 20% less memory per pod, up to 10% lower tail latency) without touching service code, by moving from pm2's cluster-based processes to wattpm worker threads and revisiting long-untouched configuration.
- [Enhancing Distributed System Load Shedding with TCP Congestion Control Algorithm](https://swe.quest/articles/enhancing-distributed-system-load-shedding-with-tcp-congestion-control-algorithm-c180104e3f071048.md): Zalando Engineering · 2024-04-22 · Medium · 9 min read · Resilience, Event-driven architecture, Queues & messaging, Microservices
  Zalando's customer communication platform applies TCP-style AIMD (Additive Increase Multiplicative Decrease) congestion control at its ingestion point to shed load and prioritize critical messages.

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)
