OS & Kernel for Backend Engineers: Processes, Memory, I/O & the Durability Path

What the kernel is really doing under your NestJS service, Postgres and Redis: fork and copy-on-write, scheduling and CFS throttling, page faults and the OOM killer, file descriptors, epoll/io_uring, libuv, socket buffers, acceptor patterns with SO_REUSEPORT, and the full write() → fsync → device-cache → media path.

About 160 minutes · 18 exam questions · 11 interview questions · 2 code labs

What you will learn

  1. Processes, threads and fork(): copy-on-write and why Postgres and Redis fork
  2. CPU scheduling: context switches, preemption, spinlocks vs mutexes and CFS throttling
  3. Virtual memory: page faults, the TLB, huge pages, overcommit and the OOM killer
  4. File descriptors: the lifecycle, ulimit and leaks
  5. Blocking vs non-blocking I/O: select, poll, epoll (level vs edge) and io_uring
  6. Node on the kernel: libuv's epoll loop, the thread pool and what really blocks
  7. Kernel socket buffers and backpressure: Recv-Q, Send-Q and the write() that never blocks
  8. Listener and acceptor patterns: from one listener to SO_REUSEPORT socket sharding
  9. Mapping it to Node: cluster vs reusePort vs worker_threads vs PM2 vs one process per pod
  10. The durability path: write() → page cache → fsync → device cache → media
  11. Group commit, WAL, checkpoints and crash recovery (redo)
  12. Why Postgres, Redis, Node and nginx chose their process models
  13. Debugging toolkit: strace, perf, /proc, vmstat, iostat and ss — and what to look for

Previous: Requirements & The Interview Framework