Skip to content

In development. Expect rough edges and changes. The source code is not public yet.

Heroku Engineering 9 min read Case study mediumAdept

Router 2.0 Common Runtime Router: The Road to Beta

Heroku is replacing Hermes, its decade-old Erlang Common Runtime router, with Router 2.0 written in Go. Hermes became hard to upgrade: Erlang expertise declined, its dependencies were pinned, and features like HTTP/2 were blocked. The new L7 router runs in-memory behind an existing L4 proxy that also terminates TLS. Using the Strangler pattern, it routes per-app traffic either through Hermes or directly to dynos, and it shares an HTTP library with the Private Spaces router. Before beta, the team added gated deployment automation, continuous load testing tied to SLOs, and W3C Network Error Logging to measure real client routing failures.

Related posts

  • Tips & Tricks for Migrating to Router 2.0

    Heroku Engineering mediumAdept

    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. You can confirm which router is in use through the Via response header (heroku-router vs. vegur) or through router log fields: protocol now reads http2.0/http1.1, and there are new tls and tls_version fields. HTTP/2 is on by default for custom domains with valid TLS. It terminates at the router, which forwards HTTP/1.1 to dynos. Keepalives to dynos are always on, which lowers latency but triggers a Puma connection-handling bug that inflates tail latency. Both HTTP/2 and keepalives can be disabled through labs flags.

  • The Adventures of Rendezvous in Heroku’s New Architecture

    Heroku Engineering mediumAdept

    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. The root cause was a single-threaded agent loop using IO.select on the raw TCP socket. The NLB's larger TLS frames left decrypted bytes buffered inside OpenSSL's SSLSocket where IO.select couldn't see them, so the loop blocked until an idle timeout longer than the router's 30s limit. The fix split the agent into one thread per direction and changed the read logic so buffered SSL data is drained before selecting again.

  • Pumas, Routers & Keepalives—Oh my!

    Heroku Engineering mediumAdept

    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. Under load with roughly 200ms of server-side work, keepalive connections pushed p95/p99 response times above 2 seconds. The cause was traced by reproducing it locally with hey and ab, which showed the slowdown occurs with any keepalive client hitting Puma directly. Tuning Go's http.Transport MaxIdleConnsPerHost reduced connection churn but did not fix latency. Puma 7.0.4 or later fixes the bug.

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

    Heroku Engineering mediumAdept

    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.

  • Scaling Beyond Limits: Harnessing Route Server for a Stable Cluster

    Zalando Engineering mediumAdept

    Zalando put a Route Server between its Skipper ingress proxies and the Kubernetes API after roughly 180 Skipper instances per cluster, each polling Ingresses and RouteGroups, overloaded etcd and throttled the API server. Route Server polls the API every 3 seconds, converts resources into an Eskip routing table and serves it with an ETag, so unchanged tables return HTTP 304. If Route Server is down, Skipper keeps its last known routes and an alert fires. Rollout used disabled, pre-processing (shadow, with route-table diffs) and execution modes, tier by tier, with zero downtime. Skipper's autoscaling ceiling rose to 300 pods, and one Route Server deployment handles about 100 RPS.

The quest for software engineering knowledge.

Look:
Layout: