---
title: "Node.js at scale, rebalanced: how we cut cost by 38%"
description: "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."
url: "https://swe.quest/articles/node-js-at-scale-rebalanced-how-we-cut-cost-by-38-1008b397ea498cc9"
canonical: "https://medium.com/booking-com-development/node-js-at-scale-rebalanced-how-we-cut-cost-by-38-62ce247a3002"
source: "Booking.com Engineering"
published: "2026-09-29"
difficulty: "medium"
kind: "Case study"
reading_minutes: 17
tags: ["javascript","performance","cost-optimization","load-balancing","runtimes"]
---

# Node.js at scale, rebalanced: how we cut cost by 38%

A post on [Booking.com Engineering](https://swe.quest/sources/booking.md), published 2026-09-29, 17 min read, Case study. Original: [https://medium.com/booking-com-development/node-js-at-scale-rebalanced-how-we-cut-cost-by-38-62ce247a3002](https://medium.com/booking-com-development/node-js-at-scale-rebalanced-how-we-cut-cost-by-38-62ce247a3002)

## Summary

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. Synthetic k6 tests showed 20-50% more throughput within latency SLOs, validated through a side-by-side production A/B split at the routing layer. Production exposed uneven worker load because SO\_REUSEPORT's connection hashing interacted badly with nginx loopback connections recycled via tcp\_tw\_reuse. Giving each worker its own port and load-balancing in nginx fixed it, which also opened the door to smarter balancing between heavy renders and light metadata requests.

Written by swe.quest, not by the author.

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

## Topics

- [JavaScript](https://swe.quest/tags/javascript.md) (Languages)
- [Performance engineering](https://swe.quest/tags/performance.md) (Reliability & operations)
- [Cost optimization](https://swe.quest/tags/cost-optimization.md) (Reliability & operations)
- [Load balancing](https://swe.quest/tags/load-balancing.md) (Infrastructure)
- [Runtimes & VMs](https://swe.quest/tags/runtimes.md) (Compilers & runtimes)

## Prerequisites

- Node.js event loop ([easy posts on JavaScript](https://swe.quest/tags/javascript.md?difficulty=easy))
- React server-side rendering ([easy posts on React](https://swe.quest/tags/react.md?difficulty=easy))
- Linux socket basics ([easy posts on Linux](https://swe.quest/tags/linux.md?difficulty=easy))
- nginx upstreams

## Keywords

Node.js, pm2, wattpm, worker threads, SO\_REUSEPORT, nginx, React SSR, k6

## Related posts

- [Fully Loaded Node – A Node.JS Holiday Season, part 2](https://swe.quest/articles/fully-loaded-node-a-node-js-holiday-season-part-2-16ddab92917d79be.md): Mozilla Hacks · 2012-11-20 · Medium · 7 min read · JavaScript, Concurrency, Resilience, Scaling, Performance engineering
  Node.js runs JavaScript on a single core, so CPU-heavy work needs special handling to keep a server responsive.
- [Server rendering benchmarks: Railway vs Cloudflare vs Vercel](https://swe.quest/articles/server-rendering-benchmarks-railway-vs-cloudflare-vs-vercel-d854a3e98b5ee41e.md): Railway · 2025-10-20 · Medium · 10 min read · Performance engineering, Serverless, JavaScript, Cloud platforms
  Running Theo Browne's SSR benchmark suite (400 requests, 20 concurrent connections, from an EC2 client in us-west-1) against Railway with 10 replicas, Cloudflare Workers and Vercel Functions gave mixed results.
- [Node.js and the tale of worker threads](https://swe.quest/articles/node-js-and-the-tale-of-worker-threads-2f7f52d719f58af7.md): Zalando Engineering · 2024-07-24 · Medium · 10 min read · JavaScript, Kubernetes, Incidents & postmortems, Debugging, Observability
  A Node.js service using cluster mode called os.cpus().length inside a Kubernetes container, which returns the host's core count, not the pod's CPU allocation.
- [Bun v1.1.25](https://swe.quest/articles/bun-v1-1-25-f1451af45f97830b.md): Bun · 2024-08-21 · Medium · 7 min read · JavaScript, Runtimes & VMs, WebAssembly
  Bun v1.1.25 adds node:cluster support, which lets a pool of workers share one port via reusePort for multi-core HTTP throughput.
- [How we built JSR](https://swe.quest/articles/how-we-built-jsr-b17e975077f4123a.md): Deno · 2024-04-12 · Medium · 18 min read · System design, JavaScript, Web performance, Rust, PostgreSQL
  JSR, the JavaScript Registry, splits into components with different reliability targets: a highly available Postgres cluster behind a Rust/Hyper API on Google Cloud Run targeting 99.9%, and a global CDN for package source and npm tarballs targeting 100% uptime.

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)
