Modern high-performance servers—whether NGINX, Node.js, Redis, Netty, or Envoy—achieve millions of concurrent connections not through raw CPU clock speeds, but through mechanical sympathy with the operating system kernel’s I/O subsystems.

A naive architecture allocating one OS thread per connection collapses under thread stack memory exhaustion and context-switching overhead (the classic C10K problem). Modern distributed systems overcome this by leveraging asynchronous event-driven I/O (epoll, kqueue) and kernel bypass/zero-copy primitives (sendfile, io_uring).

This module deconstructs the operating system mechanisms powering low-latency distributed systems: blocking vs. non-blocking sockets, epoll red-black trees and ready lists, page cache writeback dynamics, zero-copy data pipelines, and the lockless ring-buffer architecture of Linux io_uring.

What you will learn

  • Trace the evolution of network I/O from synchronous blocking sockets to select, poll, and O(1) epoll event notifications
  • Compare Level-Triggered and Edge-Triggered epoll semantics and prevent event loop starvation under high concurrency
  • Analyze the Linux Page Cache architecture: dirty page writeback, readahead heuristics, and direct I/O (O_DIRECT)
  • Implement Zero-Copy data transfers using sendfile(2) and splice(2) to eliminate user-space memory copies and context switches
  • Deconstruct Linux io_uring shared-memory ring buffers (SQ and CQ) achieving asynchronous zero-syscall I/O performance
STAGE TOPICS

Topics in this chapter