
Node.js Internals, Runtime & Networking Guide | NodeBook
Author(s): thenodebook (Author)
- Publisher Finelybook 出版社: thenodebook
- Publication Date 出版日期: 2026
- Language 语言: English
- Print length 页数: 630 pages
Book Description
NodeBook explains what happens inside the runtime when your application handles I/O, schedules work, allocates memory, and serves traffic.
Libuv & Event Loop Internals
Understand poll/check/idle phases, threadpool queueing, and platform differences across epoll, kqueue, and IOCP.
V8 Compilation Pipeline
Debug deoptimizations, hidden class transitions, and polymorphic inline cache misses with practical examples.
Zero-Copy Stream Architecture
Implement binary protocols with backpressure-aware transforms, scatter/gather I/O, and external memory management.
Native Addon Development
Build thread-safe N-API modules, move work through uv_queue_work, and handle memory across JavaScript and C++ boundaries.
Production Observability
Propagate trace context with AsyncLocalStorage, control metrics cardinality, and analyze latency with flamegraphs.
Production Memory Management
Tune generational GC flags, track retainers in heap snapshots, handle external memory pressure and OOM mitigation.
Most Node.js tutorials stop at syntax. NodeBook focuses on runtime behavior. This example shows how backpressure changes memory use under load.
The problem: unbounded buffering
Buffering an entire file before sending it can exhaust the V8 heap under concurrent traffic.
The fix: stream backpressure
Read in chunks, respect `highWaterMark`, and pause the readable stream when the writable side applies pressure.
finelybook
