Reliable High-Performance HTTP Infrastructure with nginx and Lua
summary
Built an in-house API gateway using nginx and Lua plus HAProxy, Ansible, OpenStack and Jenkins, replacing a vendor product with ~3,000 lines of Lua and Python. Capacity uses concurrent request limiting via shared-memory counters instead of token buckets, globally averaging limits across nodes. Results: about 400 endpoints hosted, a light day of 367 million requests (≈4,000 req/s), median latency for a key API falls from ~200ms to ~20ms, proxy overhead is sub-50ms, and the system prevents at least one major outage.
AI-written summary · about
chapters (13)
- 0:00Introduction to project
- 3:10Challenges with legacy system
- 8:25Goals for new architecture
- 10:11Why nginx and Lua
- 14:24Plugin architecture design
- 20:52Single data center setup
- 24:48Capacity management approach
- 29:02Deployment workflow
- 31:10Performance results
- 35:27Outage prevention success
- 36:32Implementation challenges
- 39:21Key takeaways and advice
- 40:45Q&A session
related talks
44msmart balancing with nginx+lua
20mShoving Your Application Code Into the Web Server
47mOptimizing nginx – from Beginner to Expert to Crazy
23mStanding On the Shoulders of Giants...
25mShould I do my own API Gateway?
24mServerless API Gateways for High Scale Systems Performance Cost and Security
45mNginx: The power within
40mNginx + Lua = OpenResty
