---
title: "Migrating Millions of Concurrent Websockets to Envoy"
description: "Slack moved its websocket ingress tier, serving millions of concurrent connections, from HAProxy to Envoy Proxy."
url: "https://swe.quest/articles/migrating-millions-of-concurrent-websockets-to-envoy-b99b542be70019c3"
canonical: "https://slack.engineering/migrating-millions-of-concurrent-websockets-to-envoy/"
source: "Slack Engineering"
published: "2021-03-15"
difficulty: "medium"
kind: "Case study"
reading_minutes: 11
tags: ["load-balancing","realtime","deployment","configuration","networking"]
---

# Migrating Millions of Concurrent Websockets to Envoy

A post on [Slack Engineering](https://swe.quest/sources/slack.md), published 2021-03-15, 11 min read, Case study. Original: [https://slack.engineering/migrating-millions-of-concurrent-websockets-to-envoy/](https://slack.engineering/migrating-millions-of-concurrent-websockets-to-envoy/)

## Summary

Slack moved its websocket ingress tier, serving millions of concurrent connections, from HAProxy to Envoy Proxy. HAProxy reloads spawned long-lived draining processes that had to be reaped and rate-limited. Envoy's dynamic clusters, hot restarts and panic routing removed that operational overhead. Envoy config was generated through custom Chef resources with --mode validate checks, and traffic shifted region by region via NS1 weighted DNS in 10–100% steps on a parallel stack, completing in six months with no customer impact. Key lessons: the organically grown HAProxy config hid behaviours services depended on, a test suite for load balancer routing would have saved effort, and limiting Chef libraries to a subset of Envoy features kept them simple but made later additions like vhosts awkward.

Written by swe.quest, not by the author.

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

## Topics

- [Load balancing](https://swe.quest/tags/load-balancing.md) (Infrastructure)
- [Real-time systems](https://swe.quest/tags/realtime.md) (Backend & APIs)
- [Deployment](https://swe.quest/tags/deployment.md) (Reliability & operations)
- [Configuration management](https://swe.quest/tags/configuration.md) (Reliability & operations)
- [Networking](https://swe.quest/tags/networking.md) (Infrastructure)

## Prerequisites

- reverse proxies and load balancers ([easy posts on Load balancing](https://swe.quest/tags/load-balancing.md?difficulty=easy))
- WebSocket protocol basics
- DNS weighted routing ([easy posts on DNS](https://swe.quest/tags/dns.md?difficulty=easy))

## Keywords

Envoy Proxy, HAProxy, Slack, Chef, NS1, WebSocket, AWS NLB

## Related posts

- [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.
- [Slack’s Migration to a Cellular Architecture](https://swe.quest/articles/slack-s-migration-to-a-cellular-architecture-7c9634739e313402.md): Slack Engineering · 2023-08-22 · Medium · 8 min read · Resilience, Load balancing, Distributed systems, Cloud platforms, SRE
  Slack moved its critical user-facing services in us-east-1 to a cellular architecture where each availability zone is a cell that can be drained, after a 2021 gray-failure network outage in one AZ caused user-visible errors across all AZs.
- [Traffic 101: Packets Mostly Flow](https://swe.quest/articles/traffic-101-packets-mostly-flow-e9828aceea724731.md): Slack Engineering · 2023-08-28 · Medium · 9 min read · Networking, Load balancing, DNS, Resilience, CDN & edge
  A Slack request reaches its main region in AWS us-east-1 through a chain of hops.
- [Productionizing Envoy Mobile at Lyft](https://swe.quest/articles/productionizing-envoy-mobile-at-lyft-4d8e6979981e9ef6.md): Lyft Engineering · 2022-09-13 · Easy · 7 min read · Mobile, Networking, Observability, Deployment
  Nearly all network requests from Lyft's iOS and Android apps now run through Envoy Mobile, replacing URLSession and OkHttp after a gradual rollout starting December 2021, and it matches or beats them on business metrics across billions of daily requests.
- [Building the Next Evolution of Cloud Networks at Slack – A Retrospective](https://swe.quest/articles/building-the-next-evolution-of-cloud-networks-at-slack-a-retrospective-d090221ea56ede12.md): Slack Engineering · 2021-10-20 · Medium · 10 min read · Cloud platforms, Networking, DNS, Testing
  A year after launching Whitecastle, its AWS network redesign built on Transit Gateway, Slack found that proxy environment variables (http\_proxy/no\_proxy) were the biggest migration drag.

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)
