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