---
title: "Leveraging Go Worker Pools to Scale Server-side Data Sharing"
description: "Shopify's Server Pixels service, a Go pipeline that consumes over a billion customer events per day from Kafka, fell behind on consumer lag because it spawned an unbounded number of goroutines to process and produce event batches."
url: "https://swe.quest/articles/leveraging-go-worker-pools-to-scale-server-side-data-sharing-5ace4b0b544c8996"
canonical: "https://shopify.engineering/leveraging-go-worker-pools"
source: "Shopify Engineering"
published: "2022-09-09"
difficulty: "medium"
kind: "Case study"
reading_minutes: 7
tags: ["go","concurrency","performance","messaging","scalability"]
---

# Leveraging Go Worker Pools to Scale Server-side Data Sharing

A post on [Shopify Engineering](https://swe.quest/sources/shopify.md), published 2022-09-09, 7 min read, Case study. Original: [https://shopify.engineering/leveraging-go-worker-pools](https://shopify.engineering/leveraging-go-worker-pools)

## Summary

Shopify's Server Pixels service, a Go pipeline that consumes over a billion customer events per day from Kafka, fell behind on consumer lag because it spawned an unbounded number of goroutines to process and produce event batches. Replacing that with a fixed-size worker pool fed by a jobs channel, built on a reusable Worker interface and shut down gracefully with context cancellation and WaitGroups, bounded resource use. Throughput per pod rose from 7.75k to 12.9k events/sec with 15 workers, 19.3k with 50, and 21k after further tuning, a 170% gain. That headroom carried the service through a 46k events/sec peak during BFCM 2021.

Written by swe.quest, not by the author.

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

## Topics

- [Go](https://swe.quest/tags/go.md) (Languages)
- [Concurrency](https://swe.quest/tags/concurrency.md) (Compilers & runtimes)
- [Performance engineering](https://swe.quest/tags/performance.md) (Reliability & operations)
- [Queues & messaging](https://swe.quest/tags/messaging.md) (Backend & APIs)
- [Scaling](https://swe.quest/tags/scalability.md) (Distributed systems)

## Prerequisites

- Go goroutines and channels ([easy posts on Go](https://swe.quest/tags/go.md?difficulty=easy))
- Kafka consumers and producers ([easy posts on Queues & messaging](https://swe.quest/tags/messaging.md?difficulty=easy))

## Keywords

Server Pixels, Kafka, goroutines, worker pool, WaitGroup, BFCM

## Related posts

- [Keep the monolith, but split the workloads](https://swe.quest/articles/keep-the-monolith-but-split-the-workloads-a46b5ee6a5f1e352.md): incident.io · 2023-04-12 · Medium · 9 min read · Resilience, System design, PostgreSQL, Go, Microservices
  A Go monolith can get much of the reliability isolation of microservices by splitting workloads into separate deployments of the same binary, instead of breaking it into services.
- [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.
- [How to Reliably Scale Your Data Platform for High Volumes](https://swe.quest/articles/how-to-reliably-scale-your-data-platform-for-high-volumes-d29cb64aded6f294.md): Shopify Engineering · 2020-12-08 · Medium · 9 min read · SRE, Capacity planning, Data pipelines, Scaling, Resilience
  Shopify's Data Platform Engineering team prepared Tier 1 and Tier 2 ingestion and query services for a forecast near-doubling of BFCM 2020 traffic with a five-step reliability process.
- [Go Concurrency Patterns: Pipelines and cancellation - The Go Programming Language](https://swe.quest/articles/go-concurrency-patterns-pipelines-and-cancellation-the-go-programming-language-ce3e4fe9c1ba792c.md): The Go Blog · Medium · 15 min read · Go, Concurrency
  Go pipelines are built as stages of goroutines connected by channels, with fan-out to spread work across workers and fan-in (via a sync.WaitGroup-based merge) to combine results.
- [Using Server Sent Events to Simplify Real-time Streaming at Scale](https://swe.quest/articles/using-server-sent-events-to-simplify-real-time-streaming-at-scale-27a5424d07541ac7.md): Shopify Engineering · 2022-11-30 · Medium · 9 min read · Real-time systems, Stream processing, Go, Scaling, Load balancing
  Shopify replaced its 2021 BFCM Live Map delivery path, in which WebSocket fed a presentation layer that clients polled through a mailbox system every 10+ seconds, with a Go Server Sent Events server.

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)
