Open heart surgery on Nginx - changing configuration without reloading
summary
Demonstrates a patch that lets Nginx apply a single vhost change without a full reload by running the normal config parser at runtime and propagating updates via a shared memory pool, using reference counting per virtual host and per-host memory pools so old configs free only after zero users. Handles multi-worker propagation, Lua JIT cache invalidation by hashing code, and a file descriptor cache with descriptor duplication. Works but adds significant complexity and race conditions around full reloads and per-worker state.
AI-written summary · about
chapters (15)
- 0:00Intro
- 0:37Overview
- 2:07Processing models
- 3:59Changing configuration without reloading
- 7:40Why does this happen
- 10:16Commercial options
- 11:43Thirdparty modules
- 14:07Allin implementation
- 16:10How to start the update
- 17:35How to do the updates
- 19:20Nginx shared memory
- 26:34Config mixup
- 27:31Temporary pool
- 29:41Lower code
- 31:08Conclusion
related talks
43mnginx for fun and performance
01h 30mReference Architecture for Running Modern APIs w/ NGINX Unit & Web Server
40mNginx + Lua = OpenResty
54mSpeeding Up and Offloading a Web Server by Transparently Caching on SSD
44mScalable nginx Configuration
23mStanding On the Shoulders of Giants...
44mScalable nginx configuration
44msmart balancing with nginx+lua
