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
wrk2andk6, measuring error rates, queue depths, kernel context switches, and profiling CPU hotspots usingperfflame 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.