A foundational anti-pattern in distributed systems engineering is leaping prematurely to horizontal clustering, sharding, and complex distributed coordination without first understanding what a single machine can achieve.

A single modern server equipped with 64 CPU cores, 256 GB of RAM, PCIe NVMe storage, and dual 25 GbE network interfaces can handle hundreds of thousands of requests per second when engineered with mechanical sympathy. Distributing prematurely introduces network latencies, partial failure modes, consensus overhead, and distributed transaction complexity where a well-tuned single node or simple vertical scaling might easily suffice.

This module provides the rigorous engineering foundation for measuring and optimizing a single node before distributing:

  • Server Resource Anatomy: Profiling CPU instructions-per-cycle (IPC), cache line false sharing, NUMA memory node latency, storage IOPS vs. sequential throughput, and kernel networking packet-per-second (PPS) limits.
  • Mathematical QPS Capacity Formulation: Bounding throughput by the minimum bottleneck:
  • Concurrency, Queuing & Little’s Law: Applying to quantify how average concurrency () scales with arrival rate () and service time (), and why operating near resource utilization leads to catastrophic p99 tail latency inflation.
  • Finding the Saturation Knee: Executing closed-loop vs. open-loop load testing with wrk2 and k6, measuring error rates, queue depths, kernel context switches, and profiling CPU hotspots using perf flame graphs while avoiding coordinated omission.
  • Vertical vs. Horizontal Scaling Decisions: Concrete cost-per-million-requests analysis comparing single-node vertical upgrades (scale-up) against multi-node horizontal clusters (scale-out) fronted by load balancers.

What you will learn

  • Calculate theoretical single-node capacity limits across CPU, memory bandwidth, storage IOPS, network PPS, and OS socket descriptors
  • Derive sustainable QPS limits using CPU utilization models: QPS_CPU ≈ (Cores × Target Utilization) / (CPU Seconds per Request)
  • Apply Little's Law (L = λW) to explain queue growth, concurrency accumulation, and p99 latency degradation as systems approach saturation
  • Identify the empirical saturation knee through systematic benchmarking with wrk2, k6, perf, and Linux profiling tools while avoiding coordinated omission
  • Evaluate the economic and operational trade-offs of vertical scaling (scale-up) vs. horizontal distribution (scale-out) under realistic latency SLOs
STAGE TOPICS

Topics in this chapter